aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/enums/ItemList.java2
-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
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java12
-rw-r--r--src/main/java/gregtech/api/util/GT_Utility.java20
6 files changed, 74 insertions, 16 deletions
diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java
index b9dada473b..8b77861164 100644
--- a/src/main/java/gregtech/api/enums/ItemList.java
+++ b/src/main/java/gregtech/api/enums/ItemList.java
@@ -653,7 +653,7 @@ public enum ItemList implements IItemContainer {
Teleporter,
Cover_NeedsMaintainance,
Casing_Turbine,
- MobRep_LV, MobRep_MV, MobRep_HV, MobRep_EV, MobRep_IV, LargeGasTurbine, LargeHPSteamTurbine, LargePlasmaTurbine, Cover_PlayerDetector, Machine_Multi_HeatExchanger;
+ MobRep_LV, MobRep_MV, MobRep_HV, MobRep_EV, MobRep_IV, LargeGasTurbine, LargeHPSteamTurbine, LargePlasmaTurbine, Cover_PlayerDetector, Machine_Multi_HeatExchanger, Uraniumcell_1, Uraniumcell_2, Uraniumcell_4, Moxcell_1, Moxcell_2, Moxcell_4;
public static final ItemList[]
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) {
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java
index 40c45c5cfb..637d4a04e6 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java
@@ -255,15 +255,18 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
if (!GT_Utility.isStackValid(aStack)) {
return false;
}
- if (GT_ModHandler.isElectricItem(aStack, this.mTier)) {
+ if (mInventory[aIndex]==null && GT_ModHandler.isElectricItem(aStack, this.mTier)) {
return true;
}
return false;
}
public long[] getStoredEnergy() {
+ boolean scaleOverflow =false;
+ boolean storedOverflow = false;
long tScale = getBaseMetaTileEntity().getEUCapacity();
long tStored = getBaseMetaTileEntity().getStoredEU();
+ long tStep = 0;
if (mInventory != null) {
for (ItemStack aStack : mInventory) {
if (GT_ModHandler.isElectricItem(aStack)) {
@@ -271,8 +274,11 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
if (aStack.getItem() instanceof GT_MetaBase_Item) {
Long[] stats = ((GT_MetaBase_Item) aStack.getItem()).getElectricStats(aStack);
if (stats != null) {
+ if(stats[0]>Long.MAX_VALUE/2){scaleOverflow=true;}
tScale = tScale + stats[0];
- tStored = tStored + ((GT_MetaBase_Item) aStack.getItem()).getRealCharge(aStack);
+ tStep = ((GT_MetaBase_Item) aStack.getItem()).getRealCharge(aStack);
+ if(tStep > Long.MAX_VALUE/2){storedOverflow=true;}
+ tStored = tStored + tStep;
}
} else if (aStack.getItem() instanceof IElectricItem) {
tStored = tStored + (long) ic2.api.item.ElectricItem.manager.getCharge(aStack);
@@ -282,6 +288,8 @@ public class GT_MetaTileEntity_BasicBatteryBuffer extends GT_MetaTileEntity_Tier
}
}
+ if(scaleOverflow){tScale=Long.MAX_VALUE;}
+ if(storedOverflow){tStored=Long.MAX_VALUE;}
return new long[]{tStored, tScale};
}
diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java
index 06615a681b..2fd4b477db 100644
--- a/src/main/java/gregtech/api/util/GT_Utility.java
+++ b/src/main/java/gregtech/api/util/GT_Utility.java
@@ -21,6 +21,7 @@ import ic2.api.recipe.IRecipeInput;
import ic2.api.recipe.RecipeInputItemStack;
import ic2.api.recipe.RecipeInputOreDict;
import ic2.api.recipe.RecipeOutput;
+import ic2.api.recipe.ICannerBottleRecipeManager;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
@@ -801,6 +802,25 @@ public class GT_Utility {
return copyMetaData(Items.feather.getDamage(aStack) + 1, aStack);
return null;
}
+ public static synchronized boolean removeIC2BottleRecipe(ItemStack aContainer, ItemStack aInput, Map<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput> aRecipeList, ItemStack aOutput){
+ if ((isStackInvalid(aInput) && isStackInvalid(aOutput) && isStackInvalid(aContainer)) || aRecipeList == null) return false;
+ boolean rReturn = false;
+ Iterator<Map.Entry<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput>> tIterator = aRecipeList.entrySet().iterator();
+ aOutput = GT_OreDictUnificator.get(aOutput);
+ while (tIterator.hasNext()) {
+ Map.Entry<ic2.api.recipe.ICannerBottleRecipeManager.Input, RecipeOutput> tEntry = tIterator.next();
+ if (aInput == null || tEntry.getKey().matches(aContainer, aInput)) {
+ List<ItemStack> tList = tEntry.getValue().items;
+ if (tList != null) for (ItemStack tOutput : tList)
+ if (aOutput == null || areStacksEqual(GT_OreDictUnificator.get(tOutput), aOutput)) {
+ tIterator.remove();
+ rReturn = true;
+ break;
+ }
+ }
+ }
+ return rReturn;
+ }
public static synchronized boolean removeSimpleIC2MachineRecipe(ItemStack aInput, Map<IRecipeInput, RecipeOutput> aRecipeList, ItemStack aOutput) {
if ((isStackInvalid(aInput) && isStackInvalid(aOutput)) || aRecipeList == null) return false;