Fixed coolant cell working in fluid reactor

Closes #76
This commit is contained in:
TheDarkDnKTv 2021-03-15 04:42:59 +02:00
parent 5f73df956e
commit d10e71863b
2 changed files with 23 additions and 14 deletions

View file

@ -40,20 +40,24 @@ public class GT_CoolantCellIC_Item extends GT_CoolantCell_Item implements IReact
@Override
public int alterHeat(IReactor aReactor, ItemStack aStack, int x, int y, int aHeat) {
int tHeat = getHeatOfStack(aStack);
tHeat += aHeat;
if (tHeat > heatStorage) {
aReactor.setItemAt(x, y, (ItemStack)null);
aHeat = heatStorage - tHeat + 1;
} else {
if (tHeat < 0) {
aHeat = tHeat;
tHeat = 0;
} else {
aHeat = 0;
}
setHeatForStack(aStack, tHeat);
if (!aReactor.isFluidCooled() || aHeat > 0) {
tHeat += aHeat;
if (tHeat > heatStorage) {
aReactor.setItemAt(x, y, (ItemStack)null);
aHeat = heatStorage - tHeat + 1;
} else {
if (tHeat < 0) {
aHeat = tHeat;
tHeat = 0;
} else {
aHeat = 0;
}
setHeatForStack(aStack, tHeat);
}
}
return aHeat;
}
}

View file

@ -44,7 +44,12 @@ public class GT_CoolantCell_Item extends GT_Generic_Item {
@Override
public void addAdditionalToolTips(List aList, ItemStack aStack) {
super.addAdditionalToolTips(aList, aStack);
aList.add(I18n.format("item.coolant.stored.tooltip", getHeatOfStack(aStack)));
int heat = getHeatOfStack(aStack);
if (heat > 0) {
aList.add(I18n.format("ic2.reactoritem.heatwarning.line1"));
aList.add(I18n.format("ic2.reactoritem.heatwarning.line2"));
}
aList.add(I18n.format("item.coolant.stored.tooltip", heat));
}
protected static int getHeatOfStack(ItemStack aStack) {