diff options
author | draknyte1 <draknyte1@hotmail.com> | 2017-02-14 22:53:38 +1000 |
---|---|---|
committer | draknyte1 <draknyte1@hotmail.com> | 2017-02-14 22:53:38 +1000 |
commit | 099ad908e559e0d4753fe265462b2263dc6f3ba3 (patch) | |
tree | f86580ef3ed0423680761dc3fe36f0e84363af2b /src/Java/gtPlusPlus/core/item/base | |
parent | c5a1e14c4e5ba4cd514c8f8a7050fe74de6183bb (diff) | |
download | GT5-Unofficial-099ad908e559e0d4753fe265462b2263dc6f3ba3.tar.gz GT5-Unofficial-099ad908e559e0d4753fe265462b2263dc6f3ba3.tar.bz2 GT5-Unofficial-099ad908e559e0d4753fe265462b2263dc6f3ba3.zip |
+ Added Plasma cells for all missing elements. (Adds a few extra, which will get removed).
+ Added a function to generate Plasma.
- Removed Bedrockium generation.
$ Fixed the chemical symbol for Thallium.
$ Fixed an issue where a String in ClientProxy.java was being set server side.
Diffstat (limited to 'src/Java/gtPlusPlus/core/item/base')
-rw-r--r-- | src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java | 1 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/item/base/cell/BaseItemPlasmaCell.java | 81 |
2 files changed, 82 insertions, 0 deletions
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_); + } + +} |