From c1a96e33563c00d0c053f1e4f56312566a47bf08 Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Fri, 1 Apr 2016 20:02:42 +0200 Subject: [PATCH] Tool tip --- .../api/items/GT_RadioactiveCellIC_Item.java | 36 +++++++++---------- .../api/items/GT_RadioactiveCell_Item.java | 16 +++++---- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java b/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java index 59326a06..eeec476d 100644 --- a/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java +++ b/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java @@ -61,9 +61,9 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement // int heat = sumUp(pulses) * 4; int heat = triangularNumber(pulses) * 4; - + heat = getFinalHeat(reactor, yourStack, x, y, heat); - + ArrayList heatAcceptors = new ArrayList(); checkHeatAcceptor(reactor, x - 1, y, heatAcceptors); checkHeatAcceptor(reactor, x + 1, y, heatAcceptors); @@ -84,22 +84,22 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement } } if (getDamageOfStack(yourStack) >= getMaxDamageEx() - 1) { - reactor.setItemAt(x, y, sDepleted.copy()); + reactor.setItemAt(x, y, sDepleted.copy()); } else if (heatrun) { damageItemStack(yourStack, 1); } } - + protected int getFinalHeat(IReactor reactor, ItemStack stack, int x, int y, int heat) { - if (sMox&&reactor.isFluidCooled()) - { - float breedereffectiveness = reactor.getHeat() / reactor.getMaxHeat(); - if (breedereffectiveness > 0.5D) { - heat *= 2; - } + if (sMox&&reactor.isFluidCooled()) + { + float breedereffectiveness = (float)reactor.getHeat() / (float)reactor.getMaxHeat(); + if (breedereffectiveness > 0.5D) { + heat *= 2; } - return heat; + } + return heat; } private void checkHeatAcceptor(IReactor reactor, int x, int y, ArrayList heatAcceptors) { @@ -111,13 +111,13 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement } public boolean acceptUraniumPulse(IReactor reactor, ItemStack yourStack, ItemStack pulsingStack, int youX, int youY, int pulseX, int pulseY, boolean heatrun) { - if (!heatrun) { - if(sMox){ - float breedereffectiveness = (float)reactor.getHeat() / (float)reactor.getMaxHeat(); - float ReaktorOutput = 1.5F * breedereffectiveness + 1.0F; - reactor.addOutput(ReaktorOutput * this.sEnergy); - }else{ - reactor.addOutput((float) (1.0F * this.sEnergy));} + if (!heatrun) { + if(sMox){ + float breedereffectiveness = (float)reactor.getHeat() / (float)reactor.getMaxHeat(); + float ReaktorOutput = 1.5F * breedereffectiveness + 1.0F; + reactor.addOutput(ReaktorOutput * this.sEnergy); + }else{ + reactor.addOutput((float) (1.0F * this.sEnergy));} } return true; } diff --git a/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java b/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java index 9ef52663..e990fc29 100644 --- a/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java +++ b/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java @@ -1,6 +1,7 @@ package gregtech.api.items; import ic2.core.util.StackUtil; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -36,11 +37,12 @@ public class GT_RadioactiveCell_Item } return b; } - + protected static int triangularNumber(int x) - { - return (x * x + x) / 2; - } + { + return (x * x + x) / 2; + } + protected boolean outputPulseForStack(ItemStack aStack) { NBTTagCompound tNBT = aStack.getTagCompound(); if (tNBT == null) { @@ -133,9 +135,9 @@ public class GT_RadioactiveCell_Item setDamageForStack(stack, getDamageOfStack(stack) + Dmg); } - public void addAdditionalToolTips(List aList, ItemStack aStack) { - super.addAdditionalToolTips(aList, aStack); + public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { + super.addAdditionalToolTips(aList, aStack, aPlayer); //aList.add("Time left: " + (this.maxDelay - getDurabilityOfStack(aStack)) + " secs"); aList.add("Durability: " + (this.maxDmg - getDurabilityOfStack(aStack)) + "/" + this.maxDmg); } -} +} \ No newline at end of file