aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/items
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api/items')
-rw-r--r--src/main/java/gregtech/api/items/GT_MetaBase_Item.java1
-rw-r--r--src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java51
-rw-r--r--src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java4
3 files changed, 43 insertions, 13 deletions
diff --git a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java b/src/main/java/gregtech/api/items/GT_MetaBase_Item.java
index 66c928340f..c1d8e428b8 100644
--- a/src/main/java/gregtech/api/items/GT_MetaBase_Item.java
+++ b/src/main/java/gregtech/api/items/GT_MetaBase_Item.java
@@ -563,6 +563,7 @@ public abstract class GT_MetaBase_Item extends GT_Generic_Item implements ISpeci
if (tStats != null && (tStats[3] == -1 || tStats[3] == -3) && getRealCharge(aStack) > 0) return 1;
tStats = getFluidContainerStats(aStack);
if (tStats != null) return (int) (long) tStats[1];
+ if(getDamage(aStack)==32763)return 1;
return 64;
}
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 9be65b1586..ba1007f60f 100644
--- a/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java
+++ b/src/main/java/gregtech/api/items/GT_RadioactiveCellIC_Item.java
@@ -19,8 +19,11 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
public final float sEnergy;
public final int sRadiation;
public final float sHeat;
+ 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) {
+
+ 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;
@@ -28,6 +31,8 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
this.sEnergy = aEnergy;
this.sRadiation = aRadiation;
this.sHeat = aHeat;
+ this.sDepleted = aDepleted;
+ this.sMox = aMox;
}
@@ -54,7 +59,10 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
} 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);
- int heat = sumUp(pulses) * 4;
+ //int heat = sumUp(pulses) * 4;
+
+ int heat = triangularNumber(pulses) * 4;
+ heat = getFinalHeat(reactor, yourStack, x, y, heat);
ArrayList<ItemStackCoord> heatAcceptors = new ArrayList();
checkHeatAcceptor(reactor, x - 1, y, heatAcceptors);
@@ -76,20 +84,32 @@ public class GT_RadioactiveCellIC_Item extends GT_RadioactiveCell_Item implement
}
}
if (getDamageOfStack(yourStack) >= getMaxDamageEx() - 1) {
- switch (this.numberOfCells) {
- case 1:
- reactor.setItemAt(x, y, ItemList.Depleted_Thorium_1.get(1, new Object[0]));
- break;
- case 2:
- reactor.setItemAt(x, y, ItemList.Depleted_Thorium_2.get(1, new Object[0]));
- break;
- case 4:
- reactor.setItemAt(x, y, ItemList.Depleted_Thorium_4.get(1, new Object[0]));
- }
+ // switch (this.numberOfCells) {
+ // case 1:
+ //reactor.setItemAt(x, y, ItemList.Depleted_Thorium_1.get(1, new Object[0]));
+ // break;
+ // case 2:
+ //reactor.setItemAt(x, y, ItemList.Depleted_Thorium_2.get(1, new Object[0]));
+ // break;
+ // case 4:
+ // reactor.setItemAt(x, y, ItemList.Depleted_Thorium_4.get(1, new Object[0]));
+ //}
+ reactor.setItemAt(x, y, sDepleted.copy());
} else if (heatrun) {
damageItemStack(yourStack, 1);
}
}
+ protected int getFinalHeat(IReactor reactor, ItemStack stack, int x, int y, int heat)
+ {
+ if (sMox&&reactor.isFluidCooled())
+ {
+ float breedereffectiveness = reactor.getHeat() / reactor.getMaxHeat();
+ if (breedereffectiveness > 0.5D) {
+ heat *= 2;
+ }
+ }
+ return heat;
+ }
private void checkHeatAcceptor(IReactor reactor, int x, int y, ArrayList<ItemStackCoord> heatAcceptors) {
ItemStack thing = reactor.getItemAt(x, y);
@@ -101,7 +121,12 @@ 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) {
if (!heatrun) {
- reactor.addOutput((float) (1.0F * this.sEnergy));
+ if(sMox){
+ float breedereffectiveness = reactor.getHeat() / reactor.getMaxHeat();
+ float ReaktorOutput = 1.5F * breedereffectiveness + 1.0F;
+ reactor.addOutput(ReaktorOutput * this.sEnergy);
+ }else{
+ reactor.addOutput((float) (1.0F * this.sEnergy));}
}
return true;
}
diff --git a/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java b/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java
index 7ceaf43f2e..9ef5266329 100644
--- a/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java
+++ b/src/main/java/gregtech/api/items/GT_RadioactiveCell_Item.java
@@ -37,6 +37,10 @@ public class GT_RadioactiveCell_Item
return b;
}
+ protected static int triangularNumber(int x)
+ {
+ return (x * x + x) / 2;
+ }
protected boolean outputPulseForStack(ItemStack aStack) {
NBTTagCompound tNBT = aStack.getTagCompound();
if (tNBT == null) {