Tool tip
This commit is contained in:
parent
aeb50268c7
commit
c1a96e3356
2 changed files with 27 additions and 25 deletions
|
@ -61,9 +61,9 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
|
||||||
// int heat = sumUp(pulses) * 4;
|
// int heat = sumUp(pulses) * 4;
|
||||||
|
|
||||||
int heat = triangularNumber(pulses) * 4;
|
int heat = triangularNumber(pulses) * 4;
|
||||||
|
|
||||||
heat = getFinalHeat(reactor, yourStack, x, y, heat);
|
heat = getFinalHeat(reactor, yourStack, x, y, heat);
|
||||||
|
|
||||||
ArrayList<ItemStackCoord> heatAcceptors = new ArrayList();
|
ArrayList<ItemStackCoord> heatAcceptors = new ArrayList();
|
||||||
checkHeatAcceptor(reactor, x - 1, y, heatAcceptors);
|
checkHeatAcceptor(reactor, x - 1, y, heatAcceptors);
|
||||||
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) {
|
if (getDamageOfStack(yourStack) >= getMaxDamageEx() - 1) {
|
||||||
reactor.setItemAt(x, y, sDepleted.copy());
|
reactor.setItemAt(x, y, sDepleted.copy());
|
||||||
} else if (heatrun) {
|
} else if (heatrun) {
|
||||||
damageItemStack(yourStack, 1);
|
damageItemStack(yourStack, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getFinalHeat(IReactor reactor, ItemStack stack, int x, int y, int heat)
|
protected int getFinalHeat(IReactor reactor, ItemStack stack, int x, int y, int heat)
|
||||||
{
|
{
|
||||||
if (sMox&&reactor.isFluidCooled())
|
if (sMox&&reactor.isFluidCooled())
|
||||||
{
|
{
|
||||||
float breedereffectiveness = reactor.getHeat() / reactor.getMaxHeat();
|
float breedereffectiveness = (float)reactor.getHeat() / (float)reactor.getMaxHeat();
|
||||||
if (breedereffectiveness > 0.5D) {
|
if (breedereffectiveness > 0.5D) {
|
||||||
heat *= 2;
|
heat *= 2;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return heat;
|
}
|
||||||
|
return heat;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkHeatAcceptor(IReactor reactor, int x, int y, ArrayList<ItemStackCoord> heatAcceptors) {
|
private void checkHeatAcceptor(IReactor reactor, int x, int y, ArrayList<ItemStackCoord> 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) {
|
public boolean acceptUraniumPulse(IReactor reactor, ItemStack yourStack, ItemStack pulsingStack, int youX, int youY, int pulseX, int pulseY, boolean heatrun) {
|
||||||
if (!heatrun) {
|
if (!heatrun) {
|
||||||
if(sMox){
|
if(sMox){
|
||||||
float breedereffectiveness = (float)reactor.getHeat() / (float)reactor.getMaxHeat();
|
float breedereffectiveness = (float)reactor.getHeat() / (float)reactor.getMaxHeat();
|
||||||
float ReaktorOutput = 1.5F * breedereffectiveness + 1.0F;
|
float ReaktorOutput = 1.5F * breedereffectiveness + 1.0F;
|
||||||
reactor.addOutput(ReaktorOutput * this.sEnergy);
|
reactor.addOutput(ReaktorOutput * this.sEnergy);
|
||||||
}else{
|
}else{
|
||||||
reactor.addOutput((float) (1.0F * this.sEnergy));}
|
reactor.addOutput((float) (1.0F * this.sEnergy));}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package gregtech.api.items;
|
package gregtech.api.items;
|
||||||
|
|
||||||
import ic2.core.util.StackUtil;
|
import ic2.core.util.StackUtil;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
|
@ -36,11 +37,12 @@ public class GT_RadioactiveCell_Item
|
||||||
}
|
}
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static int triangularNumber(int x)
|
protected static int triangularNumber(int x)
|
||||||
{
|
{
|
||||||
return (x * x + x) / 2;
|
return (x * x + x) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean outputPulseForStack(ItemStack aStack) {
|
protected boolean outputPulseForStack(ItemStack aStack) {
|
||||||
NBTTagCompound tNBT = aStack.getTagCompound();
|
NBTTagCompound tNBT = aStack.getTagCompound();
|
||||||
if (tNBT == null) {
|
if (tNBT == null) {
|
||||||
|
@ -133,9 +135,9 @@ public class GT_RadioactiveCell_Item
|
||||||
setDamageForStack(stack, getDamageOfStack(stack) + Dmg);
|
setDamageForStack(stack, getDamageOfStack(stack) + Dmg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAdditionalToolTips(List aList, ItemStack aStack) {
|
public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
|
||||||
super.addAdditionalToolTips(aList, aStack);
|
super.addAdditionalToolTips(aList, aStack, aPlayer);
|
||||||
//aList.add("Time left: " + (this.maxDelay - getDurabilityOfStack(aStack)) + " secs");
|
//aList.add("Time left: " + (this.maxDelay - getDurabilityOfStack(aStack)) + " secs");
|
||||||
aList.add("Durability: " + (this.maxDmg - getDurabilityOfStack(aStack)) + "/" + this.maxDmg);
|
aList.add("Durability: " + (this.maxDmg - getDurabilityOfStack(aStack)) + "/" + this.maxDmg);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue