Now Mox cells working like in ic2

This commit is contained in:
Dream-Master 2015-12-30 01:05:10 +01:00
parent e9754ee222
commit d741647dbe

View file

@ -22,7 +22,6 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
public final ItemStack sDepleted; public final ItemStack sDepleted;
public final boolean sMox; public final boolean sMox;
public GT_RadioactiveCellIC_Item(String aUnlocalized, String aEnglish, int aCellcount, int maxDamage, float aEnergy, int aRadiation, float aHeat, ItemStack aDepleted, boolean aMox) { public GT_RadioactiveCellIC_Item(String aUnlocalized, String aEnglish, int aCellcount, int maxDamage, float aEnergy, int aRadiation, float aHeat, ItemStack aDepleted, boolean aMox) {
super(aUnlocalized, aEnglish, aCellcount); super(aUnlocalized, aEnglish, aCellcount);
setMaxStackSize(64); setMaxStackSize(64);
@ -59,9 +58,10 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
} else { } else {
pulses += checkPulseable(reactor, x - 1, y, yourStack, x, y, heatrun) + checkPulseable(reactor, x + 1, y, yourStack, x, y, heatrun) + checkPulseable(reactor, x, y - 1, yourStack, x, y, heatrun) + checkPulseable(reactor, x, y + 1, yourStack, x, y, heatrun); pulses += checkPulseable(reactor, x - 1, y, yourStack, x, y, heatrun) + checkPulseable(reactor, x + 1, y, yourStack, x, y, heatrun) + checkPulseable(reactor, x, y - 1, yourStack, x, y, heatrun) + checkPulseable(reactor, x, y + 1, yourStack, x, y, heatrun);
//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();
@ -84,17 +84,17 @@ 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 = (float)reactor.getHeat() / (float)reactor.getMaxHeat(); float breedereffectiveness = reactor.getHeat() / reactor.getMaxHeat();
if (breedereffectiveness > 0.5D) { if (breedereffectiveness > 0.5D) {
heat *= 2; heat *= 2;
} }
@ -113,7 +113,7 @@ 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 = reactor.getHeat() / 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{