diff options
author | Jordan Byrne <draknyte1@hotmail.com> | 2017-12-29 13:17:13 +1000 |
---|---|---|
committer | Jordan Byrne <draknyte1@hotmail.com> | 2017-12-29 13:17:13 +1000 |
commit | d1963f3f97fb6478fdfb0a5c64dd7c5a2d156c93 (patch) | |
tree | 61717e0cf32788a531053249080c7fd2d2a089ab /src/Java/gtPlusPlus/core/item | |
parent | d9bb6aa63908828d5844c29c1b76956ea2079cf2 (diff) | |
download | GT5-Unofficial-d1963f3f97fb6478fdfb0a5c64dd7c5a2d156c93.tar.gz GT5-Unofficial-d1963f3f97fb6478fdfb0a5c64dd7c5a2d156c93.tar.bz2 GT5-Unofficial-d1963f3f97fb6478fdfb0a5c64dd7c5a2d156c93.zip |
+ Added dehydrator recipes for denser ore types.
$ Fixed Ore Blocks not generating as intended.
% Improved Ore Generator.
Diffstat (limited to 'src/Java/gtPlusPlus/core/item')
-rw-r--r-- | src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java new file mode 100644 index 0000000000..cb3455f0c5 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java @@ -0,0 +1,72 @@ +package gtPlusPlus.core.item.base.itemblock; + +import java.util.List; + +import gtPlusPlus.core.block.base.BlockBaseOre; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.material.ORES; +import gtPlusPlus.core.material.nuclear.FLUORIDES; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.entity.EntityUtils; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class ItemBlockOre extends ItemBlock{ + + private final BlockBaseOre mThisOre; + private final Material mThisMaterial; + private final int mThisRadiation; + private final int mThisColour; + + public ItemBlockOre(final Block block) { + super(block); + if (block instanceof BlockBaseOre){ + this.mThisOre = (BlockBaseOre) block; + this.mThisMaterial = this.mThisOre.getMaterialEx(); + this.mThisRadiation = this.mThisMaterial.vRadiationLevel; + this.mThisColour = this.mThisMaterial.getRgbAsHex(); + } + else { + this.mThisOre = null; + this.mThisMaterial = null; + this.mThisRadiation = 0; + this.mThisColour = Utils.rgbtoHexValue(255, 255, 255); + } + } + + public int getRenderColor(final int aMeta) { + return this.mThisColour; + } + + @Override + public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { + //Radioactive? + if (this.mThisRadiation > 0){ + list.add(CORE.GT_Tooltip_Radioactive); + } + + /** + * Tooltip Handler for Ores + */ + if (this.mThisMaterial == FLUORIDES.FLUORITE){ + list.add("Mined from Sandstone and Limestone."); + } + else if (this.mThisMaterial != FLUORIDES.FLUORITE){ + list.add("Mined from the Dark Dimension."); + } + super.addInformation(stack, aPlayer, list, bool); + } + + @Override + public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) { + if (this.mThisRadiation > 0){ + EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.mThisRadiation, world, entityHolding); + } + } + +} |