diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core/item')
4 files changed, 84 insertions, 2 deletions
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 47b527aeab..ce5f8a2bce 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -578,7 +578,7 @@ public final class ModItems { if (LoadedMods.Extra_Utils|| LOAD_ALL_CONTENT){ Utils.LOG_INFO("ExtraUtilities Found - Loading Resources."); try { - MaterialGenerator.generate(ALLOY.BEDROCKIUM); + //MaterialGenerator.generate(ALLOY.BEDROCKIUM); } catch (NullPointerException e){ e.getClass(); } diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index eb5694f1a9..5b585aed16 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -180,6 +180,7 @@ public class BaseItemComponent extends Item{ BOLT("Bolt", " Bolt", "bolt"), ROTOR("Rotor", " Rotor", "rotor"), RING("Ring", " Ring", "ring"), + PLASMACELL("CellPlasma", " Plasma Cell", "cellPlasma"), CELL("Cell", " Cell", "cell"), NUGGET("Nugget", " Nugget", "nugget"); diff --git a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java new file mode 100644 index 0000000000..ba32be9b53 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java @@ -0,0 +1,81 @@ +package gtPlusPlus.core.item.base.cell; + +import gtPlusPlus.core.item.base.BaseItemComponent; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.util.Utils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BaseItemPlasmaCell extends BaseItemComponent{ + + private IIcon base; + private IIcon overlay; + ComponentTypes PlasmaCell = ComponentTypes.PLASMACELL; + private int tickCounter = 0; + private int tickCounterMax = 200; + private short[] fluidColour; + + public BaseItemPlasmaCell(Material material) { + super(material, ComponentTypes.PLASMACELL); + fluidColour = (short[]) ((material == null) ? extraData : material.getRGBA()); + } + + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses(){ + return true; + } + + @Override + public void registerIcons(IIconRegister i) { + this.base = i.registerIcon(CORE.MODID + ":" + "item"+PlasmaCell.getComponent()); + this.overlay = i.registerIcon(CORE.MODID + ":" + "item"+PlasmaCell.getComponent()+"_Overlay"); + //this.overlay = cellMaterial.getFluid(1000).getFluid().get + } + + + @Override + public int getColorFromItemStack(ItemStack stack, int renderPass) { + if (renderPass == 0){ + return Utils.rgbtoHexValue(230, 230, 230); + } + return componentColour; + } + + @Override + public IIcon getIconFromDamageForRenderPass(int damage, int pass) { + if(pass == 0) { + return this.base; + } + return this.overlay; + } + + @Override + public String getItemStackDisplayName(ItemStack cell) { + return materialName+" Plasma Cell"; + } + + @Override + public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) { + if (componentMaterial != null){ + if (!world.isRemote){ + if(tickCounter < tickCounterMax ){ + tickCounter++; + } + else if(tickCounter >= tickCounterMax){ + entityHolding.attackEntityFrom(DamageSource.onFire, 2); + tickCounter = 0; + } + } + } + super.onUpdate(iStack, world, entityHolding, p_77663_4_, p_77663_5_); + } + +} diff --git a/src/Java/gtPlusPlus/core/item/init/ItemsMultiTools.java b/src/Java/gtPlusPlus/core/item/init/ItemsMultiTools.java index ca67ea1b54..6a55356f1e 100644 --- a/src/Java/gtPlusPlus/core/item/init/ItemsMultiTools.java +++ b/src/Java/gtPlusPlus/core/item/init/ItemsMultiTools.java @@ -43,7 +43,7 @@ public class ItemsMultiTools { toolFactory(ALLOY.TANTALLOY_61); toolFactory(ALLOY.STABALLOY); toolFactory(ALLOY.QUANTUM); - toolFactory(ALLOY.BEDROCKIUM); + //toolFactory(ALLOY.BEDROCKIUM); toolFactory(ALLOY.POTIN); toolFactory(ALLOY.TUMBAGA); toolFactory(ALLOY.TALONITE); |