diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2022-12-24 04:12:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-23 21:12:36 +0100 |
commit | d8a737faaba655253666b343c052ea2ce61221ca (patch) | |
tree | 781d5cd83a9bd204e096c83fcaeb5a61040e276c /src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java | |
parent | d0d00ccb75318793c0fcd0a05c60affb403bfa96 (diff) | |
download | GT5-Unofficial-d8a737faaba655253666b343c052ea2ce61221ca.tar.gz GT5-Unofficial-d8a737faaba655253666b343c052ea2ce61221ca.tar.bz2 GT5-Unofficial-d8a737faaba655253666b343c052ea2ce61221ca.zip |
add NEI handler for ic2 fuel rods (#1580)
* add NEI handler for ic2 fuel rods
Signed-off-by: Glease <4586901+Glease@users.noreply.github.com>
* fix typo
Signed-off-by: Glease <4586901+Glease@users.noreply.github.com>
* rename variable to cover up the original intention
Signed-off-by: Glease <4586901+Glease@users.noreply.github.com>
Signed-off-by: Glease <4586901+Glease@users.noreply.github.com>
Diffstat (limited to 'src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java')
-rw-r--r-- | src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java | 11 |
1 files changed, 9 insertions, 2 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 894c03db90..95c584fd6a 100644 --- a/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java +++ b/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java @@ -1,6 +1,7 @@ package gregtech.api.items; import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Utility; import ic2.api.reactor.IReactor; import ic2.api.reactor.IReactorComponent; @@ -12,6 +13,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implements IReactorComponent { + private static final int MYSTERIOUS_MULTIPLIER_HEAT = 4; public final int numberOfCells; public final float sEnergy; public final int sRadiation; @@ -38,6 +40,11 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement this.sHeat = aHeat; this.sDepleted = aDepleted; this.sMox = aMox; + if (aDepleted != null && aEnergy > 0 && aHeat > 0) { + // avoid adding depleted cells to recipe map + GT_Values.RA.addIC2ReactorFuelCell( + new ItemStack(this), aDepleted, aMox, aHeat * MYSTERIOUS_MULTIPLIER_HEAT, aEnergy, aCellcount); + } } private static int checkPulseable(IReactor reactor, int x, int y, ItemStack me, int mex, int mey, boolean heatrun) { @@ -74,11 +81,11 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement // int heat = sumUp(pulses) * 4; - int heat = triangularNumber(pulses) * 4; + int heat = triangularNumber(pulses) * MYSTERIOUS_MULTIPLIER_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, y - 1, heatAcceptors); |