aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-01-15 15:19:05 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-01-15 15:19:05 +0000
commit86bf45662a877c8ce9ca9551b41c789c098dc698 (patch)
tree9cb2c65a914312afbbe7887966d43d5feed95505 /src
parent05efaa691d2ebe9fd4811444dbf6f0de1ca142b6 (diff)
downloadGT5-Unofficial-86bf45662a877c8ce9ca9551b41c789c098dc698.tar.gz
GT5-Unofficial-86bf45662a877c8ce9ca9551b41c789c098dc698.tar.bz2
GT5-Unofficial-86bf45662a877c8ce9ca9551b41c789c098dc698.zip
+ Added recipes for the control cores and the respective module for multiblocks.
+ Added recipes for the Circuit Programmer, Lead Lined Chest & the RTG. % Adjust Computer Cube recipe to now require an assembler. % Adjusted recipes using MAX tier machine components to use the correct parts in GTNH. % Greatly reduced EU capacity for the Computer Cube. $ Mostly finished work on the Generator Array. (Still requires some fine tuning but the general result is solid) $ Fixed a weird bug with hand-pumps, causing crashes due to an invalid offset for IIcons.
Diffstat (limited to 'src')
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java108
-rw-r--r--src/Java/gtPlusPlus/core/recipe/LOADER_Machine_Components.java101
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java10
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java276
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java7
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java405
7 files changed, 679 insertions, 230 deletions
diff --git a/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java b/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
index 2943951734..b42ac41a37 100644
--- a/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
+++ b/src/Java/gtPlusPlus/core/item/tool/misc/GregtechPump.java
@@ -5,6 +5,7 @@ import static gregtech.api.enums.GT_Values.V;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -26,7 +27,6 @@ import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE;
@@ -70,7 +70,7 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
if (aStack == null || aPlayer == null || aWorld == null || aWorld.isRemote) {
return false;
}
- if (tryDrainTile(aStack, aWorld, aPlayer, aX, aY, aZ)) {
+ if (!aWorld.isRemote && tryDrainTile(aStack, aWorld, aPlayer, aX, aY, aZ)) {
return true;
} else {
//return super.onItemUse(aStack, aPlayer, aWorld, aX, aY, aZ, a4, p_77648_8_, p_77648_9_, p_77648_10_);
@@ -92,18 +92,18 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
public final short mOffset, mItemAmount;
public final BitSet mEnabledItems;
public final BitSet mVisibleItems;
- public final IIcon[][] mIconList;
/** The unlocalized name of this item. */
private String unlocalizedName;
- private final ArrayList<Pair<Integer, EnumRarity>> rarity = new ArrayList<>();
- private final ArrayList<Pair<Integer, EnumChatFormatting>> descColour = new ArrayList<>();
- private final ArrayList<Pair<Integer, String>> itemName = new ArrayList<>();
- private final ArrayList<Pair<Integer, String>> itemDescription = new ArrayList<>();
- private final ArrayList<Pair<Integer, Boolean>> hasEffect = new ArrayList<>();
+ private final HashMap<Integer, IIcon> mIconMap = new LinkedHashMap<Integer, IIcon>();
+ private final HashMap<Integer, EnumRarity> rarity = new LinkedHashMap<Integer, EnumRarity>();
+ private final HashMap<Integer, EnumChatFormatting> descColour = new LinkedHashMap<Integer, EnumChatFormatting>();
+ private final HashMap<Integer, String> itemName = new LinkedHashMap<Integer, String>();
+ private final HashMap<Integer, String> itemDescription = new LinkedHashMap<Integer, String>();
+ private final HashMap<Integer, Boolean> hasEffect = new LinkedHashMap<Integer, Boolean>();
- public final HashMap<Short, Long[]> mElectricStats = new HashMap<>();
- public final HashMap<Short, Short> mBurnValues = new HashMap<>();
+ public final HashMap<Short, Long[]> mElectricStats = new LinkedHashMap<Short, Long[]>();
+ public final HashMap<Short, Short> mBurnValues = new LinkedHashMap<Short, Short>();
public void registerPumpType(final int aID, final String aPumpName, final int aEuMax, final int aTier) {
ModItems.toolGregtechPump.registerItem(aID, // ID
@@ -127,7 +127,6 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
this.mVisibleItems = new BitSet(aItemAmount);
this.mOffset = (short) Math.min(32766, aOffset);
this.mItemAmount = (short) Math.min(aItemAmount, 32766 - this.mOffset);
- this.mIconList = new IIcon[aItemAmount][1];
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setUnlocalizedName(unlocalizedName);
@@ -158,26 +157,28 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
this.addItem(id, localizedName, EnumChatFormatting.YELLOW + "Electric", new Object[] {});
if (euStorage > 0 && tier > 0)
this.setElectricStats(this.mOffset + id, euStorage, GT_Values.V[tier], tier, -3L, true);
- this.rarity.add(new Pair<>(id, regRarity));
- this.itemName.add(new Pair<>(id, localizedName));
- this.itemDescription.add(new Pair<>(id, description));
- this.descColour.add(new Pair<>(id, colour));
- this.hasEffect.add(new Pair<>(id, Effect));
+ this.rarity.put(id, regRarity);
+ this.itemName.put(id, localizedName);
+ this.itemDescription.put(id, description);
+ this.descColour.put(id, colour);
+ this.hasEffect.put(id, Effect);
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(final ItemStack par1ItemStack) {
- if (this.rarity.get(par1ItemStack.getItemDamage() - this.mOffset) != null) {
- return this.rarity.get(par1ItemStack.getItemDamage() - this.mOffset).getValue();
+ int h = getCorrectMetaForItemstack(par1ItemStack);
+ if (this.rarity.get(h) != null) {
+ return this.rarity.get(h);
}
return EnumRarity.common;
}
@Override
public boolean hasEffect(final ItemStack par1ItemStack) {
- if (this.hasEffect.get(par1ItemStack.getItemDamage() - this.mOffset) != null) {
- return this.hasEffect.get(par1ItemStack.getItemDamage() - this.mOffset).getValue();
+ int h = getCorrectMetaForItemstack(par1ItemStack);
+ if (this.hasEffect.get(h) != null) {
+ return this.hasEffect.get(h);
}
return false;
}
@@ -186,14 +187,17 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
@Override
public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, List aList, final boolean aF3_H) {
// aList.add("Meta: "+(aStack.getItemDamage()-mOffset));
- if ((this.descColour.get(aStack.getItemDamage() - this.mOffset) != null)
- && (this.itemDescription.get(aStack.getItemDamage() - this.mOffset) != null)) {
- aList.add(this.descColour.get(aStack.getItemDamage() - this.mOffset).getValue()
- + this.itemDescription.get(aStack.getItemDamage() - this.mOffset).getValue());
+
+ int aOffsetMeta = getCorrectMetaForItemstack(aStack);
+
+ if ((this.descColour.get(aOffsetMeta) != null)
+ && (this.itemDescription.get(aOffsetMeta) != null)) {
+ aList.add(this.descColour.get(aOffsetMeta)
+ + this.itemDescription.get(aOffsetMeta));
}
- if (aStack.getItemDamage() - 1000 <= 3) {
+ if (aOffsetMeta <= 3) {
FluidStack f = getFluid(aStack);
aList.add("Can also drain any other standard fluid container block.");
aList.add(EnumChatFormatting.BLUE + (f != null ? f.getLocalizedName() : "No Fluids Contained"));
@@ -518,13 +522,8 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
@SideOnly(Side.CLIENT)
public final void registerIcons(final IIconRegister aIconRegister) {
for (short i = 0, j = (short) this.mEnabledItems.length(); i < j; i++) {
- if (this.mEnabledItems.get(i)) {
- for (byte k = 1; k < this.mIconList[i].length; k++) {
- this.mIconList[i][k] = aIconRegister
- .registerIcon(CORE.MODID + ":" + (this.getUnlocalizedName() + "/" + i + "/" + k));
- }
- this.mIconList[i][0] = aIconRegister
- .registerIcon(CORE.MODID + ":" + (this.getUnlocalizedName() + "/" + i));
+ if (this.mEnabledItems.get(i)) {
+ mIconMap.put((int) i, aIconRegister.registerIcon(CORE.MODID + ":" + (this.getUnlocalizedName() + "/" + i)));
}
}
}
@@ -533,8 +532,15 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
public final IIcon getIconFromDamage(final int aMetaData) {
if (aMetaData < 0) {
return null;
+ }
+ if (aMetaData < this.mOffset) {
+ return mIconMap.get(0);
+ }
+ else {
+ int newMeta = aMetaData - this.mOffset;
+ newMeta = (Math.max(0, Math.min(3, newMeta)));
+ return mIconMap.get(newMeta);
}
- return (aMetaData - this.mOffset) < this.mIconList.length ? this.mIconList[aMetaData - this.mOffset][0] : null;
}
/**
@@ -685,12 +691,12 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
}
@Override
- public String getItemStackDisplayName(final ItemStack par1ItemStack) {
- int keyValue = (par1ItemStack.getItemDamage() - this.mOffset);
+ public String getItemStackDisplayName(final ItemStack aStack) {
+ int keyValue = (getCorrectMetaForItemstack(aStack));
if (keyValue < 0 || keyValue > 3) {
keyValue = 0;
}
- return this.itemName.get(keyValue).getValue();
+ return this.itemName.get(keyValue);
}
/**
@@ -756,7 +762,9 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
if (container.getTagCompound().hasKey("mInit") && container.getTagCompound().getBoolean("mInit")) {
return container.getTagCompound().getInteger("mCapacity");
}
- return (container.getItemDamage() - 1000 + 1) * 16000;
+ int aMeta = this.getCorrectMetaForItemstack(container);
+ int aCapacity = (aMeta == 0 ? 2000 : (aMeta == 1 ? 8000 : (aMeta == 2 ? 32000 : 128000)));
+ return aCapacity;
}
public int fill(ItemStack container, FluidStack resource) {
@@ -893,10 +901,13 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
}
if (!aNewNBT.hasKey("mInit")) {
+ int aMeta = this.getCorrectMetaForItemstack(aStack);
+ aNewNBT.setInteger("mMeta", aMeta);
aNewNBT.setBoolean("mInit", true);
aNewNBT.setString("mFluid", "@@@@@");
aNewNBT.setInteger("mFluidAmount", 0);
- aNewNBT.setInteger("mCapacity", (aStack.getItemDamage() - 1000 + 1) * 16000);
+ int aCapacity = (aMeta == 0 ? 2000 : (aMeta == 1 ? 8000 : (aMeta == 2 ? 32000 : 128000)));
+ aNewNBT.setInteger("mCapacity", aCapacity);
aStack.setTagCompound(aNewNBT);
}
}
@@ -1236,5 +1247,26 @@ public class GregtechPump extends Item implements ISpecialElectricItem, IElectri
return false;
}
}
+
+
+ public int getCorrectMetaForItemstack(ItemStack aStack) {
+ if (aStack == null) {
+ return 0;
+ }
+ else {
+ if (aStack.getItemDamage() < this.mOffset) {
+ return 0;
+ }
+ else {
+ int newMeta = aStack.getItemDamage() - this.mOffset;
+ newMeta = (Math.max(0, Math.min(3, newMeta)));
+ return newMeta;
+ }
+ }
+
+
+
+
+ }
}
diff --git a/src/Java/gtPlusPlus/core/recipe/LOADER_Machine_Components.java b/src/Java/gtPlusPlus/core/recipe/LOADER_Machine_Components.java
index 065a0fe2f4..460b29e802 100644
--- a/src/Java/gtPlusPlus/core/recipe/LOADER_Machine_Components.java
+++ b/src/Java/gtPlusPlus/core/recipe/LOADER_Machine_Components.java
@@ -12,7 +12,7 @@ public class LOADER_Machine_Components {
public static void initialise(){
registerDefaultComponents();
-
+
if (!CORE.GTNH){
if(CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
registerGTExperimentalComponents();
@@ -25,49 +25,49 @@ public class LOADER_Machine_Components {
registerGTNHComponents();
}
}
-
+
private static void registerDefaultComponents(){
//Machine Components
- CI.electricMotor_LV = ItemList.Electric_Motor_LV.get(1);
- CI.electricMotor_MV = ItemList.Electric_Motor_MV.get(1);
- CI.electricMotor_HV = ItemList.Electric_Motor_HV.get(1);
- CI.electricMotor_EV = ItemList.Electric_Motor_EV.get(1);
- CI.electricMotor_IV = ItemList.Electric_Motor_IV.get(1);
- CI.electricPump_LV = ItemList.Electric_Pump_LV.get(1);
- CI.electricPump_MV = ItemList.Electric_Pump_MV.get(1);
- CI.electricPump_HV = ItemList.Electric_Pump_HV.get(1);
- CI.electricPump_EV = ItemList.Electric_Pump_EV.get(1);
- CI.electricPump_IV = ItemList.Electric_Pump_IV.get(1);
- CI.electricPiston_LV = ItemList.Electric_Piston_LV.get(1);
- CI.electricPiston_MV = ItemList.Electric_Piston_MV.get(1);
- CI.electricPiston_HV = ItemList.Electric_Piston_HV.get(1);
- CI.electricPiston_EV = ItemList.Electric_Piston_EV.get(1);
- CI.electricPiston_IV = ItemList.Electric_Piston_IV.get(1);
- CI.robotArm_LV = ItemList.Robot_Arm_LV.get(1);
- CI.robotArm_MV = ItemList.Robot_Arm_MV.get(1);
- CI.robotArm_HV = ItemList.Robot_Arm_HV.get(1);
- CI.robotArm_EV = ItemList.Robot_Arm_EV.get(1);
- CI.robotArm_IV = ItemList.Robot_Arm_IV.get(1);
- CI.conveyorModule_LV = ItemList.Conveyor_Module_LV.get(1);
- CI.conveyorModule_MV = ItemList.Conveyor_Module_MV.get(1);
- CI.conveyorModule_HV = ItemList.Conveyor_Module_HV.get(1);
- CI.conveyorModule_EV = ItemList.Conveyor_Module_EV.get(1);
- CI.conveyorModule_IV = ItemList.Conveyor_Module_IV.get(1);
- CI.emitter_LV = ItemList.Emitter_LV.get(1);
- CI.emitter_MV = ItemList.Emitter_MV.get(1);
- CI.emitter_HV = ItemList.Emitter_HV.get(1);
- CI.emitter_EV = ItemList.Emitter_EV.get(1);
- CI.emitter_IV = ItemList.Emitter_IV.get(1);
- CI.fieldGenerator_LV = ItemList.Field_Generator_LV.get(1);
- CI.fieldGenerator_MV = ItemList.Field_Generator_MV.get(1);
- CI.fieldGenerator_HV = ItemList.Field_Generator_HV.get(1);
- CI.fieldGenerator_EV = ItemList.Field_Generator_EV.get(1);
- CI.fieldGenerator_IV = ItemList.Field_Generator_IV.get(1);
- CI.sensor_LV = ItemList.Sensor_LV.get(1);
- CI.sensor_MV = ItemList.Sensor_MV.get(1);
- CI.sensor_HV = ItemList.Sensor_HV.get(1);
- CI.sensor_EV = ItemList.Sensor_EV.get(1);
- CI.sensor_IV = ItemList.Sensor_IV.get(1);
+ CI.electricMotor_LV = ItemList.Electric_Motor_LV.get(1);
+ CI.electricMotor_MV = ItemList.Electric_Motor_MV.get(1);
+ CI.electricMotor_HV = ItemList.Electric_Motor_HV.get(1);
+ CI.electricMotor_EV = ItemList.Electric_Motor_EV.get(1);
+ CI.electricMotor_IV = ItemList.Electric_Motor_IV.get(1);
+ CI.electricPump_LV = ItemList.Electric_Pump_LV.get(1);
+ CI.electricPump_MV = ItemList.Electric_Pump_MV.get(1);
+ CI.electricPump_HV = ItemList.Electric_Pump_HV.get(1);
+ CI.electricPump_EV = ItemList.Electric_Pump_EV.get(1);
+ CI.electricPump_IV = ItemList.Electric_Pump_IV.get(1);
+ CI.electricPiston_LV = ItemList.Electric_Piston_LV.get(1);
+ CI.electricPiston_MV = ItemList.Electric_Piston_MV.get(1);
+ CI.electricPiston_HV = ItemList.Electric_Piston_HV.get(1);
+ CI.electricPiston_EV = ItemList.Electric_Piston_EV.get(1);
+ CI.electricPiston_IV = ItemList.Electric_Piston_IV.get(1);
+ CI.robotArm_LV = ItemList.Robot_Arm_LV.get(1);
+ CI.robotArm_MV = ItemList.Robot_Arm_MV.get(1);
+ CI.robotArm_HV = ItemList.Robot_Arm_HV.get(1);
+ CI.robotArm_EV = ItemList.Robot_Arm_EV.get(1);
+ CI.robotArm_IV = ItemList.Robot_Arm_IV.get(1);
+ CI.conveyorModule_LV = ItemList.Conveyor_Module_LV.get(1);
+ CI.conveyorModule_MV = ItemList.Conveyor_Module_MV.get(1);
+ CI.conveyorModule_HV = ItemList.Conveyor_Module_HV.get(1);
+ CI.conveyorModule_EV = ItemList.Conveyor_Module_EV.get(1);
+ CI.conveyorModule_IV = ItemList.Conveyor_Module_IV.get(1);
+ CI.emitter_LV = ItemList.Emitter_LV.get(1);
+ CI.emitter_MV = ItemList.Emitter_MV.get(1);
+ CI.emitter_HV = ItemList.Emitter_HV.get(1);
+ CI.emitter_EV = ItemList.Emitter_EV.get(1);
+ CI.emitter_IV = ItemList.Emitter_IV.get(1);
+ CI.fieldGenerator_LV = ItemList.Field_Generator_LV.get(1);
+ CI.fieldGenerator_MV = ItemList.Field_Generator_MV.get(1);
+ CI.fieldGenerator_HV = ItemList.Field_Generator_HV.get(1);
+ CI.fieldGenerator_EV = ItemList.Field_Generator_EV.get(1);
+ CI.fieldGenerator_IV = ItemList.Field_Generator_IV.get(1);
+ CI.sensor_LV = ItemList.Sensor_LV.get(1);
+ CI.sensor_MV = ItemList.Sensor_MV.get(1);
+ CI.sensor_HV = ItemList.Sensor_HV.get(1);
+ CI.sensor_EV = ItemList.Sensor_EV.get(1);
+ CI.sensor_IV = ItemList.Sensor_IV.get(1);
}
private static void registerGTExperimentalComponents(){
@@ -172,8 +172,17 @@ public class LOADER_Machine_Components {
CI.sensor_ZPM = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32696, 1);
CI.sensor_UV = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32697, 1);
+ // Thanks 0lafe
+ CI.electricMotor_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32596, 1);
+ CI.electricPump_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32618, 1);
+ CI.electricPiston_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32648, 1);
+ CI.robotArm_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32658, 1);
+ CI.conveyorModule_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32638, 1);
+ CI.emitter_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32688, 1);
+ CI.fieldGenerator_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32678, 1);
+ CI.sensor_MAX = ItemUtils.simpleMetaStack("gregtech:gt.metaitem.01", 32698, 1);
+
registerComponentsULV();
- registerComponentsMAX();
}
private static boolean registerComponentsULV(){
@@ -189,8 +198,9 @@ public class LOADER_Machine_Components {
return true;
}
- private static boolean registerComponentsMAX(){
- //Max Tier Components Blood Never added... Useless, lol.
+ private static boolean registerComponentsMAX() {
+
+ // Max Tier Components Blood Never added... Useless, lol.
CI.electricMotor_MAX = GregtechItemList.Electric_Motor_MAX.get(1);
CI.electricPump_MAX = GregtechItemList.Electric_Pump_MAX.get(1);
CI.electricPiston_MAX = GregtechItemList.Electric_Piston_MAX.get(1);
@@ -199,6 +209,7 @@ public class LOADER_Machine_Components {
CI.emitter_MAX = GregtechItemList.Emitter_MAX.get(1);
CI.fieldGenerator_MAX = GregtechItemList.Field_Generator_MAX.get(1);
CI.sensor_MAX = GregtechItemList.Sensor_MAX.get(1);
+
return true;
}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
index 13c80297e4..e2c69277f6 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
@@ -876,15 +876,15 @@ public class RECIPES_GREGTECH {
CI.electricMotor_LV,
ItemUtils.getItemStackOfAmountFromOreDict("circuitBasic", 2),
ItemUtils.getItemStackOfAmountFromOreDict("ringBrass", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("rodBrass", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickBrass", 1),
ItemUtils.getItemStackOfAmountFromOreDict("plateSteel", 2)
}, null, ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 1, 1), 10*20, 30);
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
CI.electricPump_MV,
CI.electricMotor_MV,
ItemUtils.getItemStackOfAmountFromOreDict("circuitAdvanced", 2),
- ItemUtils.getItemStackOfAmountFromOreDict("ringMagnalium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("rodMagnalium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("ringInvar", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickInvar", 1),
ItemUtils.getItemStackOfAmountFromOreDict("plateAluminium", 2)
}, null, ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 2, 1), 10*20*2, 120);
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
@@ -892,7 +892,7 @@ public class RECIPES_GREGTECH {
CI.electricMotor_HV,
ItemUtils.getItemStackOfAmountFromOreDict("circuitData", 2),
ItemUtils.getItemStackOfAmountFromOreDict("ringChrome", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("rodChrome", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickChrome", 1),
ItemUtils.getItemStackOfAmountFromOreDict("plateStainlessSteel", 2)
}, null, ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 3, 1), 10*20*3, 480);
@@ -901,7 +901,7 @@ public class RECIPES_GREGTECH {
CI.electricMotor_EV,
ItemUtils.getItemStackOfAmountFromOreDict("circuitElite", 2),
ItemUtils.getItemStackOfAmountFromOreDict("ringTitanium", 1),
- ItemUtils.getItemStackOfAmountFromOreDict("rodTitanium", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("stickTitanium", 1),
ItemUtils.getItemStackOfAmountFromOreDict("plateTungstenSteel", 2)
}, null, ItemUtils.simpleMetaStack(ModItems.itemGenericToken, 4, 1), 10*20*4, 1960);
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
index 10c5c09f8c..0040edfa99 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
@@ -1,5 +1,7 @@
package gtPlusPlus.core.recipe;
+import static gtPlusPlus.core.lib.CORE.GTNH;
+
import gregtech.api.enums.*;
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.api.objects.Logger;
@@ -9,13 +11,14 @@ import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.ALLOY;
import gtPlusPlus.core.material.ELEMENT;
+import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.*;
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.everglades.dimension.Dimension_Everglades;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
+import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
@@ -204,6 +207,7 @@ public class RECIPES_Machines {
private static void run(){
initModItems();
+ controlCores();
}
private static void initModItems(){
@@ -217,7 +221,7 @@ public class RECIPES_Machines {
boiler_Coal = ItemList.Machine_Bronze_Boiler.get(1);
//IV MACHINES
- if (!CORE.GTNH){
+ if (!GTNH){
EV_MACHINE_Electrolyzer = ItemList.Machine_EV_Electrolyzer.get(1);
EV_MACHINE_BendingMachine= ItemList.Machine_EV_Bender.get(1);
EV_MACHINE_Wiremill= ItemList.Machine_EV_Wiremill.get(1);
@@ -270,7 +274,7 @@ public class RECIPES_Machines {
private static void runModRecipes(){
if (LoadedMods.Gregtech){
//Determines Casing Recipe Output
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH){
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !GTNH){
Casing_Amount=2;
}
else {
@@ -278,22 +282,71 @@ public class RECIPES_Machines {
}
- //Computer Cube
- RecipeUtils.addShapedGregtechRecipe(
- CI.getDataOrb(),ItemList.Cover_Screen.get(1),"circuitMaster",
- ItemList.Cover_Screen.get(1),CI.machineHull_EV,ItemList.Cover_Screen.get(1),
- "circuitMaster",ItemList.Cover_Screen.get(1),CI.getDataOrb(),
- GregtechItemList.Gregtech_Computer_Cube.get(1));
+ //Computer Cube
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(CI.getDataOrb(), 4 * (GTNH ? 2 : 1)),
+ ItemList.Cover_Screen.get(4),
+ CI.machineHull_IV,
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(7), 2)
+ },
+ ELEMENT.getInstance().TANTALUM.getFluid(144 * 16),
+ GregtechItemList.Gregtech_Computer_Cube.get(1),
+ 60 * 20 * 3,
+ 8000);
+
+ //Circuit programmer
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(CI.robotArm_LV, 4 * (GTNH ? 2 : 1)),
+ ItemList.Cover_Controller.get(1, CI.electricMotor_MV),
+ CI.machineHull_MV,
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(2), 2),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(3), 2)
+ },
+ ELEMENT.getInstance().IRON.getFluid(144 * 4),
+ ItemUtils.getSimpleStack(ModBlocks.blockCircuitProgrammer),
+ 60 * 10 * 1,
+ 30);
+
+ //Lead Lined Chest
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.machineHull_LV,
+ ItemUtils.getItemStackOfAmountFromOreDict("plateRubber", 32),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDenseLead", 9),
+ ItemUtils.getSimpleStack(Blocks.chest)
+ },
+ ELEMENT.getInstance().LEAD.getFluid(144 * 16),
+ ItemUtils.getSimpleStack(ModBlocks.blockDecayablesChest),
+ 60 * 10 * 3,
+ 60);
+
+ //RTG
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ ItemUtils.getItemStackWithMeta(true, "IC2:blockGenerator:6", "IC2-RTG", 6, 1),
+ ALLOY.NITINOL_60.getPlate(GTNH ? 32 : 8),
+ ALLOY.MARAGING350.getGear(GTNH ? 16 : 4),
+ ItemUtils.getSimpleStack(GTNH ? CI.fieldGenerator_IV : CI.fieldGenerator_EV, 8 ),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireFinePlatinum", GTNH ? 64 : 32),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(GTNH ? 7 : 6), GTNH ? 5 : 4)
+ },
+ ALLOY.NIOBIUM_CARBIDE.getFluid(144 * 16),
+ GregtechItemList.RTG.get(1),
+ 60 * 20 * 10,
+ 8000);
+
//Buffer Core
RecipeUtils.addShapedGregtechRecipe(
CI.component_Plate[1], cableTier1, CI.component_Plate[1],
- "circuitPrimitive", "plateStaballloy", "circuitPrimitive",
+ "circuitPrimitive", "plateStaballoy", "circuitPrimitive",
CI.component_Plate[1], cableTier1, CI.component_Plate[1],
RECIPE_BufferCore_ULV);
RecipeUtils.addShapedGregtechRecipe(
CI.component_Plate[2], cableTier2, CI.component_Plate[2],
- CI.circuitTier1, CI.machineHull_HV, CI.circuitTier1,
+ RECIPE_BufferCore_ULV, CI.machineHull_HV, RECIPE_BufferCore_ULV,
CI.component_Plate[2], cableTier2, CI.component_Plate[2],
RECIPE_BufferCore_LV);
RecipeUtils.addShapedGregtechRecipe(
@@ -570,8 +623,8 @@ public class RECIPES_Machines {
//Tiered Tanks
if (CORE.ConfigSwitches.enableMachine_FluidTanks){
- Logger.WARNING("Is New Horizons Loaded? "+CORE.GTNH);
- if (!CORE.GTNH){
+ Logger.WARNING("Is New Horizons Loaded? "+GTNH);
+ if (!GTNH){
RecipeUtils.addShapedGregtechRecipe(
CI.component_Plate[1], CI.component_Plate[1], CI.component_Plate[1],
CI.component_Plate[1], pipeTier1, CI.component_Plate[1],
@@ -786,14 +839,14 @@ public class RECIPES_Machines {
RECIPE_TreeFarmController = GregtechItemList.Industrial_TreeFarm.get(1);
RECIPE_TreeFarmFrame = GregtechItemList.TreeFarmer_Structural.get(Casing_Amount);
//Industrial Tree Farm Controller
- if (!CORE.GTNH) {
+ if (!GTNH) {
RecipeUtils.addShapedGregtechRecipe(
"plateEglinSteel", "rotorEglinSteel", "plateEglinSteel",
"cableGt02Steel", "pipeMediumSteel", "cableGt02Steel",
"plateEglinSteel", CI.machineCasing_MV, "plateEglinSteel",
RECIPE_TreeFarmController);
}
- if (CORE.GTNH) {
+ if (GTNH) {
RecipeUtils.addShapedGregtechRecipe(
"plateEglinSteel", "rotorEglinSteel", "plateEglinSteel",
"cableGt02Silver", "pipeMediumStainlessSteel", "cableGt02Silver",
@@ -973,7 +1026,7 @@ public class RECIPES_Machines {
RECIPE_LFTROuterCasing = GregtechItemList.Casing_Reactor_I.get(1); //Hastelloy
ItemStack controlCircuit = ItemUtils.getSimpleStack(ModItems.itemCircuitLFTR);
- if(!CORE.GTNH) {
+ if(!GTNH) {
RecipeUtils.addShapedGregtechRecipe(
controlCircuit, "cableGt12NaquadahAlloy", controlCircuit,
"plateDoubleHastelloyN", GregtechItemList.Gregtech_Computer_Cube.get(1), "plateDoubleHastelloyN",
@@ -1013,7 +1066,7 @@ public class RECIPES_Machines {
ItemStack mInnerTank;
- if (CORE.GTNH || !CORE.ConfigSwitches.enableMachine_FluidTanks){
+ if (GTNH || !CORE.ConfigSwitches.enableMachine_FluidTanks){
mInnerTank = ItemList.Quantum_Tank_LV.get(1);
}
else {
@@ -1301,7 +1354,7 @@ public class RECIPES_Machines {
ItemStack o_Fermenter;
ItemStack o_Distillery;
ItemStack o_Extractor;
- if (CORE.GTNH) {
+ if (GTNH) {
o_Compressor = ItemList.Machine_IV_Compressor.get(1);
o_Lathe = ItemList.Machine_IV_Lathe.get(1);
o_Electromagnet = ItemList.Machine_IV_Polarizer.get(1);
@@ -1395,17 +1448,17 @@ public class RECIPES_Machines {
ItemList.FusionComputer_UV.get(1),
(int) GT_Values.V[5],
new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(9), 4 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(7), 32 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getItemStackOfAmountFromOreDict("wireGt16Superconductor", 8 * (CORE.GTNH ? 4 : 2)),
- ItemUtils.getItemStackOfAmountFromOreDict("plateDenseNeutronium", 2 * (CORE.GTNH ? 5 : 1)),
- ItemUtils.getSimpleStack((CORE.GTNH ? CI.fieldGenerator_MAX : CI.fieldGenerator_ZPM), 5),
- ItemList.Energy_LapotronicOrb2.get(1 * (CORE.GTNH ? 64 : 8)),
- CORE.GTNH ? GregtechItemList.Compressed_Fusion_Reactor.get(1) : ItemList.FusionComputer_UV.get(1),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(9), 4 * (GTNH ? 2 : 1)),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(7), 32 * (GTNH ? 2 : 1)),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireGt16Superconductor", 8 * (GTNH ? 4 : 2)),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDenseNeutronium", 2 * (GTNH ? 5 : 1)),
+ ItemUtils.getSimpleStack((GTNH ? CI.fieldGenerator_MAX : CI.fieldGenerator_ZPM), 5),
+ ItemList.Energy_LapotronicOrb2.get(1 * (GTNH ? 64 : 8)),
+ GTNH ? GregtechItemList.Compressed_Fusion_Reactor.get(1) : ItemList.FusionComputer_UV.get(1),
GregtechItemList.Casing_Fusion_Internal.get(1)
},
new FluidStack[] {
- ALLOY.PIKYONIUM.getFluid(32 * 144 * (CORE.GTNH ? 2 : 1)),
+ ALLOY.PIKYONIUM.getFluid(32 * 144 * (GTNH ? 2 : 1)),
ALLOY.HG1223.getFluid(64 * 144)
},
GregtechItemList.FusionComputer_UV2.get(1),
@@ -1417,17 +1470,17 @@ public class RECIPES_Machines {
ItemList.Casing_Fusion2.get(1),
(int) GT_Values.V[4],
new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(5), 8 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(4), 16 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getItemStackOfAmountFromOreDict("blockTungstenCarbide", 4 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getItemStackOfAmountFromOreDict("plateNeutronium", 2 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getSimpleStack((CORE.GTNH ? CI.electricMotor_MAX : CI.electricMotor_ZPM), 3 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getSimpleStack((CORE.GTNH ? CI.electricPiston_UV : CI.electricPiston_LuV), 4 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getSimpleStack((CORE.GTNH ? CI.machineHull_MAX : CI.machineHull_ZPM), 1 * (CORE.GTNH ? 2 : 1)),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(5), 8 * (GTNH ? 2 : 1)),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(4), 16 * (GTNH ? 2 : 1)),
+ ItemUtils.getItemStackOfAmountFromOreDict("blockTungstenCarbide", 4 * (GTNH ? 2 : 1)),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateNeutronium", 2 * (GTNH ? 2 : 1)),
+ ItemUtils.getSimpleStack((GTNH ? CI.electricMotor_MAX : CI.electricMotor_ZPM), 3 * (GTNH ? 2 : 1)),
+ ItemUtils.getSimpleStack((GTNH ? CI.electricPiston_UV : CI.electricPiston_LuV), 4 * (GTNH ? 2 : 1)),
+ ItemUtils.getSimpleStack((GTNH ? CI.machineHull_MAX : CI.machineHull_ZPM), 1 * (GTNH ? 2 : 1)),
ItemList.Casing_Fusion2.get(1)
},
new FluidStack[] {
- Materials.NaquadahAlloy.getMolten(576 * (CORE.GTNH ? 2 : 1)),
+ Materials.NaquadahAlloy.getMolten(576 * (GTNH ? 2 : 1)),
ALLOY.ZERON_100.getFluid(16 * 144)
},
GregtechItemList.Casing_Fusion_External.get(1),
@@ -1439,18 +1492,18 @@ public class RECIPES_Machines {
ItemList.Casing_Fusion_Coil.get(1),
(int) GT_Values.V[4],
new ItemStack[] {
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(8), 4 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), 8 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getItemStackOfAmountFromOreDict("plateNeutronium", 2 * (CORE.GTNH ? 3 : 1)),
- ItemUtils.getSimpleStack((CORE.GTNH ? CI.emitter_MAX : CI.emitter_ZPM), 2 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getSimpleStack((CORE.GTNH ? CI.sensor_MAX : CI.sensor_ZPM), 2 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getSimpleStack((CORE.GTNH ? CI.fieldGenerator_MAX : CI.fieldGenerator_LuV), 2 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getSimpleStack((CORE.GTNH ? ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(8), 8) : CI.getDataOrb()), 8 * (CORE.GTNH ? 2 : 1)),
- ItemList.Energy_LapotronicOrb2.get(2 * (CORE.GTNH ? 16 : 1)),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(8), 4 * (GTNH ? 2 : 1)),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), 8 * (GTNH ? 2 : 1)),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateNeutronium", 2 * (GTNH ? 3 : 1)),
+ ItemUtils.getSimpleStack((GTNH ? CI.emitter_MAX : CI.emitter_ZPM), 2 * (GTNH ? 2 : 1)),
+ ItemUtils.getSimpleStack((GTNH ? CI.sensor_MAX : CI.sensor_ZPM), 2 * (GTNH ? 2 : 1)),
+ ItemUtils.getSimpleStack((GTNH ? CI.fieldGenerator_MAX : CI.fieldGenerator_LuV), 2 * (GTNH ? 2 : 1)),
+ ItemUtils.getSimpleStack((GTNH ? ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(8), 8) : CI.getDataOrb()), 8 * (GTNH ? 2 : 1)),
+ ItemList.Energy_LapotronicOrb2.get(2 * (GTNH ? 16 : 1)),
ItemList.Casing_Fusion_Coil.get(1)
},
new FluidStack[] {
- ALLOY.CINOBITE.getFluid(16 * 144 * (CORE.GTNH ? 2 : 1)),
+ ALLOY.CINOBITE.getFluid(16 * 144 * (GTNH ? 2 : 1)),
ALLOY.ABYSSAL.getFluid(64 * 144)
},
GregtechItemList.Casing_Fusion_Internal.get(1),
@@ -1461,7 +1514,7 @@ public class RECIPES_Machines {
ItemStack aDrillController;
- if (CORE.GTNH) {
+ if (GTNH) {
aDrillController = ItemList.valueOf("OreDrill4").get(1);
}
else {
@@ -1479,11 +1532,11 @@ public class RECIPES_Machines {
new ItemStack[] {
aDrillController,
ItemUtils.getItemStackOfAmountFromOreDict("frameGtTriniumNaquadahCarbonite", 3),
- ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(9), 2 * (CORE.GTNH ? 4 : 1)),
- ItemUtils.getSimpleStack((CORE.GTNH ? CI.conveyorModule_UV : CI.conveyorModule_ZPM), 2 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getSimpleStack((CORE.GTNH ? CI.electricPump_UV : CI.electricPump_ZPM), 4 * (CORE.GTNH ? 2 : 1)),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(9), 2 * (GTNH ? 4 : 1)),
+ ItemUtils.getSimpleStack((GTNH ? CI.conveyorModule_UV : CI.conveyorModule_ZPM), 2 * (GTNH ? 2 : 1)),
+ ItemUtils.getSimpleStack((GTNH ? CI.electricPump_UV : CI.electricPump_ZPM), 4 * (GTNH ? 2 : 1)),
},
- ALLOY.LAFIUM.getFluid(144 * 8 * (CORE.GTNH ? 2 : 1)),
+ ALLOY.LAFIUM.getFluid(144 * 8 * (GTNH ? 2 : 1)),
GregtechItemList.BedrockMiner_MKI.get(1),
(int) GT_Values.V[5],
(int) GT_Values.V[7]);
@@ -1492,12 +1545,12 @@ public class RECIPES_Machines {
CORE.RA.addSixSlotAssemblingRecipe(
new ItemStack[] {
ItemUtils.getItemStackOfAmountFromOreDict("frameGtTriniumNaquadahCarbonite", 4),
- ItemUtils.getItemStackOfAmountFromOreDict("plateDoubleTriniumTitaniumAlloy", 1 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getItemStackOfAmountFromOreDict("gearGtPikyonium64B", 2 * (CORE.GTNH ? 2 : 1)),
- ALLOY.TRINIUM_REINFORCED_STEEL.getPlateDouble(4 * (CORE.GTNH ? 2 : 1)),
- ItemUtils.getSimpleStack((CORE.GTNH ? CI.machineHull_UV : CI.machineHull_LuV), 1 * (CORE.GTNH ? 2 : 1)),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateDoubleTriniumTitaniumAlloy", 1 * (GTNH ? 2 : 1)),
+ ItemUtils.getItemStackOfAmountFromOreDict("gearGtPikyonium64B", 2 * (GTNH ? 2 : 1)),
+ ALLOY.TRINIUM_REINFORCED_STEEL.getPlateDouble(4 * (GTNH ? 2 : 1)),
+ ItemUtils.getSimpleStack((GTNH ? CI.machineHull_UV : CI.machineHull_LuV), 1 * (GTNH ? 2 : 1)),
},
- ALLOY.MARAGING350.getFluid(144 * 16 * (CORE.GTNH ? 2 : 1)),
+ ALLOY.MARAGING350.getFluid(144 * 16 * (GTNH ? 2 : 1)),
GregtechItemList.Casing_BedrockMiner.get(1),
(int) GT_Values.V[4],
(int) GT_Values.V[6]);
@@ -1538,4 +1591,121 @@ public class RECIPES_Machines {
Logger.INFO("Done loading recipes for the Various machine blocks.");
}
+
+
+ private static void controlCores() {
+
+ Material[] aMat_A = new Material[] {
+ ALLOY.POTIN,
+ ALLOY.ZIRCONIUM_CARBIDE,
+ ALLOY.TANTALLOY_61,
+ ALLOY.INCONEL_792,
+ ALLOY.STABALLOY,
+ ALLOY.TALONITE,
+ ALLOY.HASTELLOY_N,
+ ALLOY.HG1223,
+ ALLOY.LAFIUM,
+ ALLOY.PIKYONIUM
+ };
+ Material[] aMat_B = new Material[] {
+ ALLOY.TUMBAGA,
+ ALLOY.SILICON_CARBIDE,
+ ALLOY.EGLIN_STEEL,
+ ALLOY.NICHROME,
+ ALLOY.TUNGSTEN_CARBIDE,
+ ALLOY.STELLITE,
+ ALLOY.HASTELLOY_C276,
+ ALLOY.NITINOL_60,
+ ALLOY.ZERON_100,
+ ALLOY.CINOBITE
+ };
+
+ Item aBaseCore = ModItems.itemControlCore;
+ ItemStack[] aInputPrevTier = new ItemStack[] {
+ ItemUtils.getItemStack("miscutils:item.itemBufferCore5", 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 0, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 1, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 2, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 3, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 4, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 5, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 6, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 7, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 8, 1),
+ };
+ ItemStack[] aOutput = new ItemStack[] {
+ ItemUtils.simpleMetaStack(aBaseCore, 0, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 1, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 2, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 3, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 4, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 5, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 6, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 7, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 8, 1),
+ ItemUtils.simpleMetaStack(aBaseCore, 9, 1),
+
+ };
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ CI.machineHull_IV,
+ aOutput[2],
+ aMat_A[3].getGear(GTNH ? 4 : 2),
+ aMat_B[5].getPlateDouble(GTNH ? 16 : 8),
+ ItemUtils.getItemStack("miscutils:item.itemBufferCore"+(GTNH ? "5" : "4"), GTNH ? 4 : 2),
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(GTNH ? 4 : 3), GTNH ? 10 : 5)
+ },
+ aMat_B[4].getFluid(144 * 16), //Input Fluid
+ GregtechItemList.Hatch_Control_Core.get(1),
+ 60 * 20 * 5,
+ MaterialUtils.getVoltageForTier(4));
+
+
+ for (int i = 0; i < 10; i++) {
+ boolean aDub = i >= 5;
+
+ ItemStack aPlateStack = aMat_A[i].getPlateDouble((GTNH ? 16 : 8) * (aDub ? 2 : 1));
+ ItemStack aGearStack = aMat_B[i].getGear(GTNH ? 8 : 4 * (aDub ? 2 : 1));
+ ItemStack aRodStack = aMat_A[i].getLongRod(GTNH ? 32 : 16 * (aDub ? 2 : 1));
+ ItemStack aScrewStack = aMat_B[i].getScrew(32 * (aDub ? 2 : 1));
+
+ if (!ItemUtils.checkForInvalidItems(aPlateStack)) {
+ aPlateStack = aMat_A[i].getPlate((GTNH ? 16 : 8) * (aDub ? 2 : 1) * 2);
+ if (!ItemUtils.checkForInvalidItems(aPlateStack)) {
+ aPlateStack = aMat_B[i].getPlateDouble((GTNH ? 16 : 8) * (aDub ? 2 : 1));
+ if (!ItemUtils.checkForInvalidItems(aPlateStack)) {
+ aPlateStack = aMat_B[i].getPlate((GTNH ? 16 : 8) * (aDub ? 2 : 1) * 2);
+ }
+ }
+ }
+ if (!ItemUtils.checkForInvalidItems(aGearStack)) {
+ aGearStack = aMat_A[i].getGear(GTNH ? 8 : 4 * (aDub ? 2 : 1));
+ }
+ if (!ItemUtils.checkForInvalidItems(aRodStack)) {
+ aRodStack = aMat_B[i].getLongRod(GTNH ? 32 : 16 * (aDub ? 2 : 1));
+ }
+ if (!ItemUtils.checkForInvalidItems(aScrewStack)) {
+ aScrewStack = aMat_A[i].getScrew(32 * (aDub ? 2 : 1));
+ }
+
+ CORE.RA.addSixSlotAssemblingRecipe(
+ new ItemStack[] {
+ aInputPrevTier[i],
+ aPlateStack,
+ aGearStack,
+ aRodStack,
+ aScrewStack,
+ ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName((int) (4+Math.ceil((double) i / (double) 2))), GTNH ? (i * 2 * 2 * 2) : (i * 2 * 2))
+ },
+ aMat_A[i].getFluid(144 * 4 * (i+1)), //Input Fluid
+ aOutput[i],
+ 60 * 20 * 1 * (i+1),
+ MaterialUtils.getVoltageForTier(i));
+ }
+
+
+
+
+ }
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
index 90bb90f6d0..425606dd8e 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
@@ -286,6 +286,13 @@ public class ItemUtils {
else {
mTemp = Utils.sanitizeString(mTemp);
}
+
+
+
+ if (oredictName.contains("rod")) {
+ String s = "stick"+oredictName.substring(3);
+ oredictName = s;
+ }
// Banned Materials and replacements for GT5.8 compat.
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
index 120f1aab9e..b54eb770ec 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
@@ -233,7 +233,7 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 {
MathUtils.roundToClosestInt(432/2));
//Computer Cube
GregtechItemList.Gregtech_Computer_Cube.set(this.addItem(tLastID = 55, "Gregtech Computer Cube", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 8L), getTcAspectStack(TC_Aspects.METALLUM, 8L), getTcAspectStack(TC_Aspects.POTENTIA, 8L)}));
- this.setElectricStats(32000 + tLastID, Integer.MAX_VALUE, GT_Values.V[5], 5L, -3L, true);
+ this.setElectricStats(32000 + tLastID, GT_Values.V[6]* 10 * 60 * 20, GT_Values.V[5], 5L, -3L, true);
//FOOOOOOOOOOOOOOD
GregtechItemList.Food_Baked_Raisin_Bread.set(this.addItem(tLastID = 60, "Raisin Bread", "Extra Raisins, Just for ImQ009", new Object[]{new GT_FoodStat(5, 0.5F, EnumAction.eat, null, false, true, false, new int[0]), getTcAspectStack(TC_Aspects.CORPUS, 1L), getTcAspectStack(TC_Aspects.FAMES, 1L), getTcAspectStack(TC_Aspects.IGNIS, 1L)}));
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
index c643cdc1a0..8446737017 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java
@@ -4,21 +4,28 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.api.util.Recipe_GT;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map;
+import gregtech.common.GT_Pollution;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
@@ -77,34 +84,43 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc
}
@Override
- public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- if (mInventory[1] == null) return null;
- String tmp = mInventory[1].getUnlocalizedName().replaceAll("gt\\.blockmachines\\.basicgenerator\\.", "");
- if (tmp.startsWith("steamturbine")) {
- return Gregtech_Recipe_Map.sSteamTurbineFuels;
- }
- else if (tmp.startsWith("diesel")) {
- return GT_Recipe.GT_Recipe_Map.sDieselFuels;
- }
- else if (tmp.startsWith("gasturbine")) {
- return GT_Recipe.GT_Recipe_Map.sTurbineFuels;
- }
- else if (tmp.startsWith("semifluid")) {
- return GT_Recipe.GT_Recipe_Map.sDenseLiquidFuels;
- }
- else if (tmp.startsWith("rtg")) {
- return Gregtech_Recipe_Map.sRTGFuels;
- }
-
+ public boolean requiresVanillaGtGUI() {
+ return true;
+ }
- tmp = mInventory[1].getUnlocalizedName().replaceAll("gt\\.blockmachines\\.advancedgenerator\\.", "");
- if (tmp.startsWith("rocket")) {
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ this.mMode = getModeFromInventorySlot(this.getGUIItemStack());
+ if (this.mMode == MODE_NONE) {
+ return null;
+ }
+ else if (this.mMode == MODE_STEAM) {
+ return Recipe_GT.Gregtech_Recipe_Map.sSteamTurbineFuels;
+ }
+ else if (this.mMode == MODE_DIESEL) {
return GT_Recipe.GT_Recipe_Map.sDieselFuels;
- }
- else if (tmp.startsWith("geothermalFuel")) {
- return Gregtech_Recipe_Map.sGeoThermalFuels;
- }
-
+ }
+ else if (this.mMode == MODE_GAS) {
+ return GT_Recipe.GT_Recipe_Map.sTurbineFuels;
+ }
+ else if (this.mMode == MODE_SEMIFLUID) {
+ return Recipe_GT.Gregtech_Recipe_Map.sSemiFluidLiquidFuels;
+ }
+ else if (this.mMode == MODE_GEOTHERMAL) {
+ return Recipe_GT.Gregtech_Recipe_Map.sThermalFuels;
+ }
+ else if (this.mMode == MODE_ROCKETFUEL) {
+ return Recipe_GT.Gregtech_Recipe_Map.sRocketFuels;
+ }
+ else if (this.mMode == MODE_MAGIC_A) {
+ return GT_Recipe.GT_Recipe_Map.sMagicFuels;
+ }
+ else if (this.mMode == MODE_PLASMA) {
+ return GT_Recipe.GT_Recipe_Map.sPlasmaFuels;
+ }
+ else if (this.mMode == MODE_NAQUADAH) {
+ return GT_Recipe.GT_Recipe_Map.sFluidNaquadahReactorFuels;
+ }
return null;
}
@@ -122,84 +138,173 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc
}
public String mMachine = "";
+ protected int fuelConsumption = 0;
+ protected int fuelValue = 0;
+ protected int fuelRemaining = 0;
+ protected boolean boostEu = false;
+
+ int mMode = 0;
+
+ private final static int MODE_STEAM = 0;
+ private final static int MODE_DIESEL = 1;
+ private final static int MODE_GAS = 2;
+ private final static int MODE_SEMIFLUID = 3;
+ private final static int MODE_GEOTHERMAL = 4;
+ private final static int MODE_ROCKETFUEL = 5;
+ private final static int MODE_MAGIC_A = 6;
+ private final static int MODE_MAGIC_B_DISABLED = 7;
+ private final static int MODE_PLASMA = 8;
+ private final static int MODE_NAQUADAH = 9;
+ private final static int MODE_NONE = 100;
+
+ private final static int[] ID_STEAM = new int[] {962, 1120, 1121, 1122};
+ private final static int[] ID_GAS = new int[] {961, 1115, 1116, 1117};
+ private final static int[] ID_DIESEL = new int[] {960, 1110, 1111, 1112};
+ private final static int[] ID_SEMIFLUID = new int[] {837, 838, 839};
+ private final static int[] ID_GEOTHERMAL = new int[] {830, 831, 832};
+ private final static int[] ID_ROCKETFUEL = new int[] {793, 794, 795};
+ private final static int[] ID_MAGIC_A = new int[] {1123, 1124, 1125};
+ private final static int[] ID_MAGIC_B_DISABLED = new int[] {1127, 1128, 1129, 1130};
+ private final static int[] ID_PLASMA = new int[] {1196, 1197, 1198};
+ private final static int[] ID_NAQUADAH = new int[] {1190, 1191, 1192};
+
+ private static final int getModeFromInventorySlot(ItemStack aStack) {
+
+ if (aStack == null) {
+ return MODE_NONE;
+ }
+
+ String aItemStackName = aStack == null ? "" : aStack.getUnlocalizedName();
+ //Logger.INFO("Item Name: "+aItemStackName+" ("+aStack.getItemDamage()+")");
+ if (aItemStackName.toLowerCase().contains("gt.blockmachines")) {
+ for (int g : ID_STEAM) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_STEAM;
+ }
+ }
+ for (int g : ID_GAS) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_GAS;
+ }
+ }
+ for (int g : ID_DIESEL) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_DIESEL;
+ }
+ }
+ for (int g : ID_SEMIFLUID) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_SEMIFLUID;
+ }
+ }
+ for (int g : ID_GEOTHERMAL) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_GEOTHERMAL;
+ }
+ }
+ for (int g : ID_ROCKETFUEL) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_ROCKETFUEL;
+ }
+ }
+ for (int g : ID_MAGIC_A) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_MAGIC_A;
+ }
+ }
+ for (int g : ID_PLASMA) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_PLASMA;
+ }
+ }
+ for (int g : ID_NAQUADAH) {
+ if (aStack.getItemDamage() == g) {
+ return MODE_NAQUADAH;
+ }
+ }
+ }
+ return MODE_NONE;
+ }
+
@Override
public boolean checkRecipe(ItemStack aStack) {
- if (!isCorrectMachinePart(mInventory[1])) {
+
+ this.resetRecipeMapForAllInputHatches();
+ this.mMode = getModeFromInventorySlot(aStack);
+ if (mMode == MODE_NONE) {
+ Logger.INFO("Did not find valid generator.");
return false;
}
- GT_Recipe.GT_Recipe_Map map = getRecipeMap();
- if (map == null) return false;
- ArrayList<ItemStack> tInputList = getStoredInputs();
- int tTier = 0;
- if (mInventory[1].getUnlocalizedName().endsWith("1")) {
- tTier = 1;
- }else if (mInventory[1].getUnlocalizedName().endsWith("2")) {
- tTier = 2;
- }else if (mInventory[1].getUnlocalizedName().endsWith("3")) {
- tTier = 3;
- }else if (mInventory[1].getUnlocalizedName().endsWith("4")) {
- tTier = 4;
- }else if (mInventory[1].getUnlocalizedName().endsWith("5")) {
- tTier = 5;
- }else if (mInventory[1].getUnlocalizedName().endsWith("6")) {
- tTier = 6;
- }else if (mInventory[1].getUnlocalizedName().endsWith("7")) {
- tTier = 7;
- }else if (mInventory[1].getUnlocalizedName().endsWith("8")) {
- tTier = 8;
+ else {
+ Logger.INFO("Changed Mode to "+mMode);
}
-
- int fuelConsumption = 0;
- int fuelValue = 0;
- int fuelRemaining = 0;
- boolean boostEu = false;
-
- if(!mMachine.equals(mInventory[1].getUnlocalizedName()))mLastRecipe=null;
- mMachine = mInventory[1].getUnlocalizedName();
- Logger.WARNING("mMachine: "+mMachine);
- ArrayList<FluidStack> tFluids = getStoredFluids();
+ int aMulti = this.getGUIItemStack() != null ? this.getGUIItemStack().stackSize : 0;
+ if (aMulti > 16 || aMulti == 0) {
+ return false;
+ }
+
+
+
+ ArrayList<FluidStack> tFluids = this.getStoredFluids();
+
Collection<GT_Recipe> tRecipeList = this.getRecipeMap().mRecipeList;
- Logger.WARNING("tRecipeList: "+tRecipeList);
-
- if(tFluids.size() > 0 && tRecipeList != null) { //Does input hatch have a diesel fuel?
- Logger.WARNING("1");
- for (FluidStack hatchFluid1 : tFluids) { //Loops through hatches
- Logger.WARNING("2");
- for(GT_Recipe aFuel : tRecipeList) { //Loops through diesel fuel recipes
- Logger.WARNING("3");
- /*if (aFuel != null){
- for (FluidStack x : aFuel.mFluidInputs){
- if (x != null){
- Utils.LOG_WARNING("Recipe: "+x.getLocalizedName());
+ Logger.INFO("Got Recipe Map");
+ if (tFluids.size() > 0 && tRecipeList != null) {
+ Logger.INFO("Found Fuels for Map.");
+ Iterator<FluidStack> arg3 = tFluids.iterator();
+ int aCount = 0;
+ while (arg3.hasNext()) {
+ FluidStack hatchFluid1 = (FluidStack) arg3.next();
+ Logger.INFO("Iterating Fluid Found "+(aCount++)+" | "+hatchFluid1.getLocalizedName());
+ Iterator<GT_Recipe> arg5 = tRecipeList.iterator();
+
+ int Hatch = 0;
+ int totalFuelValue = 0;
+ while (arg5.hasNext()) {
+ Logger.INFO("Iterating Recipe "+(Hatch++));
+ GT_Recipe aFuel = (GT_Recipe) arg5.next();
+ FluidStack tLiquid;
+ boolean addedFuelOnce = false;
+ for (int a = 0; a < aMulti; a++) {
+ if ((tLiquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null
+ && hatchFluid1.isFluidEqual(tLiquid)) {
+ this.fuelConsumption = tLiquid.amount = this.boostEu
+ ? 4096 / aFuel.mSpecialValue
+ : 2048 / aFuel.mSpecialValue;
+ if (this.depleteInput(tLiquid)) {
+ Logger.INFO("Depleted Fuel");
+ this.boostEu = this.depleteInput(Materials.Oxygen.getGas(2L));
+ /*if (!tFluids.contains(Materials.Lubricant.getFluid(1L))) {
+ Logger.INFO("No Lube.");
+ return false;
+ }*/
+ if (this.mRuntime % 72 == 0 || this.mRuntime == 0) {
+ this.depleteInput(Materials.Lubricant.getFluid(this.boostEu ? 2L : 1L));
+ }
+ Logger.INFO("ADDING POWER");
+ this.fuelRemaining = hatchFluid1.amount;
+ totalFuelValue++;
}
}
- }*/
- FluidStack tLiquid;
- tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], aFuel.mFluidInputs[0].amount);
- Logger.WARNING("5");
- fuelConsumption = aFuel.mFluidInputs[0].amount;
- if(depleteInput(tLiquid)) { //Deplete that amount
- Logger.WARNING("6");
- boostEu = true;
- Logger.WARNING("7");
-
- fuelValue = aFuel.mEUt*aFuel.mDuration;
- fuelRemaining = hatchFluid1.amount; //Record available fuel
- this.mEUt = mEfficiency < 2000 ? 0 : 2048; //Output 0 if startup is less than 20%
- //this.mProgresstime = 1;
- this.mMaxProgresstime = 20;
- this.mEfficiencyIncrease = 9500;
- Logger.WARNING("9");
+ }
+ //Do things after consuming Fuel
+ if (totalFuelValue == aMulti) {
+ this.fuelValue = aFuel.mSpecialValue*aMulti;
+ this.mEUt = this.mEfficiency < 2000 ? 0 : aFuel.mSpecialValue*aMulti;
+ this.mProgresstime = aMulti;
+ this.mMaxProgresstime = aMulti;
+ this.mEfficiencyIncrease = 15*aMulti;
return true;
}
}
- // }
- //}
}
}
+
this.mEUt = 0;
this.mEfficiency = 0;
return false;
+
+
}
public static ItemStack[] clean(final ItemStack[] v) {
@@ -274,4 +379,128 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc
public int getEuDiscountForParallelism() {
return 0;
}
+
+
+
+
+
+
+ /**
+ * Code from single blocks
+ */
+
+
+ public void tryProcessFuelItems(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a) {
+ if (a != null
+ && aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() * 20L + this.getMinimumStoredEU()
+ && GT_Utility.getFluidForFilledItem(a, true) == null) {
+ int tFuelValue;
+ tFuelValue = this.getFuelValue(a);
+ if (tFuelValue > 0) {
+ ItemStack tEmptyContainer1 = this.getEmptyContainer(a);
+ if (this.addOutput(tEmptyContainer1)) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits((long) tFuelValue, true);
+ this.depleteInput(a);
+ GT_Pollution.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollutionPerTick(null));
+ }
+ }
+ }
+ }
+
+ public void tryProcessFuel(IGregTechTileEntity aBaseMetaTileEntity, long aTick, FluidStack mFluid) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10L == 0L) {
+ int tFuelValue;
+ if (mFluid != null) {
+ tFuelValue = this.getFuelValue(mFluid);
+ int tEmptyContainer = this.consumedFluidPerOperation(mFluid);
+ if (tFuelValue > 0 && tEmptyContainer > 0 && mFluid.amount > tEmptyContainer) {
+ long tFluidAmountToUse = Math.min((long) (mFluid.amount / tEmptyContainer),
+ (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue);
+ if (tFluidAmountToUse > 0L && aBaseMetaTileEntity
+ .increaseStoredEnergyUnits(tFluidAmountToUse * (long) tFuelValue, true)) {
+ GT_Pollution.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollutionPerTick(null));
+ mFluid.amount = (int) ((long) mFluid.amount
+ - tFluidAmountToUse * (long) tEmptyContainer);
+ }
+ }
+ }
+
+ //Check items
+ }
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity
+ .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU());
+ }
+
+ }
+
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return this.getFuelValue(aFluid) > 0;
+ }
+
+
+ public int consumedFluidPerOperation(FluidStack aLiquid) {
+ return 1;
+ }
+
+ public int getFuelValue(FluidStack aLiquid) {
+ if (aLiquid != null && this.getRecipeMap() != null) {
+ Collection<GT_Recipe> tRecipeList = this.getRecipeMap().mRecipeList;
+ if (tRecipeList != null) {
+ Iterator<GT_Recipe> arg3 = tRecipeList.iterator();
+
+ while (arg3.hasNext()) {
+ GT_Recipe tFuel = (GT_Recipe) arg3.next();
+ FluidStack tLiquid;
+ if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null
+ && aLiquid.isFluidEqual(tLiquid)) {
+ return (int) ((long) tFuel.mSpecialValue * (long) this.mEfficiency
+ * (long) this.consumedFluidPerOperation(tLiquid) / 100L);
+ }
+ }
+ }
+
+ return 0;
+ } else {
+ return 0;
+ }
+ }
+
+ public int getFuelValue(ItemStack aStack) {
+ if (!GT_Utility.isStackInvalid(aStack) && this.getRecipeMap() != null) {
+ GT_Recipe tFuel = this.getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE,
+ (FluidStack[]) null, new ItemStack[]{aStack});
+ return tFuel != null ? (int) ((long) tFuel.mSpecialValue * 1000L * (long) this.mEfficiency / 100L) : 0;
+ } else {
+ return 0;
+ }
+ }
+
+ public ItemStack getEmptyContainer(ItemStack aStack) {
+ if (!GT_Utility.isStackInvalid(aStack) && this.getRecipeMap() != null) {
+ GT_Recipe tFuel = this.getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE,
+ (FluidStack[]) null, new ItemStack[]{aStack});
+ return tFuel != null
+ ? GT_Utility.copy(new Object[]{tFuel.getOutput(0)})
+ : GT_Utility.getContainerItem(aStack, true);
+ } else {
+ return null;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
}