From a3aa117da7b7daedff109f826ec1e95cafaaad03 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Thu, 15 Sep 2016 15:50:54 +1000 Subject: $ Fixed the Skookum Choocher, not it: > Behaves like a wrench unless you hold shift > While shift is held, it prospects like a Hard Hammer. > It functions as a wrench when mining machines and a Hard Hammer when mining anything else. > There are over 100 types available from GT's materials. + Added in the FluidItemBlock.class --- .../core/item/base/itemblock/ItemBlockFluid.java | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java (limited to 'src/Java/gtPlusPlus/core/item') diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java new file mode 100644 index 0000000000..77af69f809 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockFluid.java @@ -0,0 +1,78 @@ +package gtPlusPlus.core.item.base.itemblock; + +import gtPlusPlus.core.fluids.BlockFluidBase; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.util.item.UtilsItems; +import gtPlusPlus.core.util.math.MathUtils; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemBlockFluid extends ItemBlock{ + + protected final int blockColour; + protected final int sRadiation; + protected Material thisFluid; + final BlockFluidBase baseBlock; + String name; + + public ItemBlockFluid(Block block) { + super(block); + this.baseBlock = (BlockFluidBase) block; + this.blockColour = baseBlock.getRenderColor(1); + this.thisFluid = baseBlock.getFluidMaterial(); + this.sRadiation=UtilsItems.getRadioactivityLevel(baseBlock.getUnlocalizedName()); + this.name = baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", ""); + //GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), UtilsItems.getSimpleStack(this)); + } + + public final Material setFluidMaterial(Material M){ + return thisFluid=M; + } + + public int getRenderColor(int aMeta) { + return blockColour; + } + + @Override + public String getItemStackDisplayName(ItemStack iStack) { + if (thisFluid != null){ + this.name = "Molten "+thisFluid.getLocalizedName(); + return name; + } + this.name = "Molten "+baseBlock.getLocalizedName().replace("tile", "").replace("fluid", "").replace("name", "").replace("block", "").replace(".", ""); + return name; + } + + @Override + public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) { + if (blockColour == 0){ + return MathUtils.generateSingularRandomHexValue(); + } + return blockColour; + + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) { + list.add("Temperature: "+MathUtils.celsiusToKelvin(thisFluid.getMeltingPoint_C())+"K"); + if (sRadiation > 0){ + list.add(CORE.GT_Tooltip_Radioactive); + } + super.addInformation(stack, aPlayer, list, bool); + } + + public String GetProperName() { + String tempIngot; + + tempIngot = "Molten "+baseBlock.getLocalizedName(); + + return tempIngot; + } + +} -- cgit