aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java
diff options
context:
space:
mode:
authorJason Mitchell <mitchej@gmail.com>2023-01-30 10:56:42 -0800
committerJason Mitchell <mitchej@gmail.com>2023-01-30 10:56:42 -0800
commit0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a (patch)
tree1e2c649f3a6ce3f6b2babd0098a5f4819e9cd0b6 /src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java
parentf8cc82edeb9810c45cba762d733a2c909a302faa (diff)
downloadGT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.tar.gz
GT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.tar.bz2
GT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.zip
[ci skip] spotlessApply with the new settings
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.java65
1 files changed, 28 insertions, 37 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 95c584fd6a..3abfad3347 100644
--- a/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java
+++ b/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java
@@ -1,18 +1,21 @@
package gregtech.api.items;
+import java.util.ArrayList;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
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;
import ic2.core.IC2Potion;
-import java.util.ArrayList;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-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;
@@ -21,16 +24,8 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
public final ItemStack sDepleted;
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);
setMaxStackSize(64);
this.maxDmg = maxDamage;
@@ -43,14 +38,18 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
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);
+ 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) {
ItemStack other = reactor.getItemAt(x, y);
- if ((other != null)
- && ((other.getItem() instanceof IReactorComponent))
+ if ((other != null) && ((other.getItem() instanceof IReactorComponent))
&& (((IReactorComponent) other.getItem())
.acceptUraniumPulse(reactor, other, me, x, y, mex, mey, heatrun))) {
return 1;
@@ -79,7 +78,7 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
+ 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) * MYSTERIOUS_MULTIPLIER_HEAT;
@@ -95,13 +94,12 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
int dheat = heat / heatAcceptors.size();
heat -= dheat;
- dheat = ((IReactorComponent) ((ItemStackCoord) heatAcceptors.get(0)).stack.getItem())
- .alterHeat(
- reactor,
- ((ItemStackCoord) heatAcceptors.get(0)).stack,
- ((ItemStackCoord) heatAcceptors.get(0)).x,
- ((ItemStackCoord) heatAcceptors.get(0)).y,
- dheat);
+ dheat = ((IReactorComponent) ((ItemStackCoord) heatAcceptors.get(0)).stack.getItem()).alterHeat(
+ reactor,
+ ((ItemStackCoord) heatAcceptors.get(0)).stack,
+ ((ItemStackCoord) heatAcceptors.get(0)).x,
+ ((ItemStackCoord) heatAcceptors.get(0)).y,
+ dheat);
heat += dheat;
heatAcceptors.remove(0);
}
@@ -129,23 +127,15 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
private void checkHeatAcceptor(IReactor reactor, int x, int y, ArrayList<ItemStackCoord> heatAcceptors) {
ItemStack thing = reactor.getItemAt(x, y);
- if ((thing != null)
- && ((thing.getItem() instanceof IReactorComponent))
+ if ((thing != null) && ((thing.getItem() instanceof IReactorComponent))
&& (((IReactorComponent) thing.getItem()).canStoreHeat(reactor, thing, x, y))) {
heatAcceptors.add(new ItemStackCoord(thing, x, y));
}
}
@Override
- 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 (sMox) {
float breedereffectiveness = (float) reactor.getHeat() / (float) reactor.getMaxHeat();
@@ -194,6 +184,7 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
}
private class ItemStackCoord {
+
public ItemStack stack;
public int x;
public int y;