From 259e6db3c913f2fbd2226102db12b7c4abb8f65c Mon Sep 17 00:00:00 2001
From: Alkalus <3060479+draknyte1@users.noreply.github.com>
Date: Mon, 19 Aug 2019 20:58:11 +0100
Subject: % Tweaked default Multiblock GUI for those without a slot. (Many will
still be broken) $ Fixed weirdly encoded symbol within
CONTAINER_Cyclotron.java, which didn't tend to play nice for some users. $
Fixed Cyclotron GUI bug. Closes #473
---
.../xmod/gregtech/api/gui/CONTAINER_Cyclotron.java | 231 ++-------------------
.../gregtech/api/gui/CONTAINER_MultiMachine.java | 49 ++++-
.../CONTAINER_MultiMachine_NoPlayerInventory.java | 27 +++
.../xmod/gregtech/api/gui/GUI_Cyclotron.java | 44 ++++
.../xmod/gregtech/api/gui/GUI_MultiMachine.java | 139 ++++++++++---
5 files changed, 250 insertions(+), 240 deletions(-)
create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java
create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java
(limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/gui')
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java
index 921871cebe..6d0eb6b14c 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_Cyclotron.java
@@ -1,232 +1,37 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.util.GT_LanguageManager;
-import java.util.Iterator;
-import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.ICrafting;
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ *
+ * The Container I use for all my Basic Machines
+ */
public class CONTAINER_Cyclotron extends GT_ContainerMetaTile_Machine {
-
- public int mActive = 0;
- public int mMaxProgressTime = 0;
- public int mProgressTime = 0;
- public long mEnergy = 0;
- public int mSteam = 0;
- public int mSteamStorage = 0;
- public int mStorage = 0;
- public int mOutput = 0;
- public int mInput = 0;
- public int mID = 0;
- public int mDisplayErrorCode = 0;
- private int oActive = 0;
- private int oMaxProgressTime = 0;
- private int oProgressTime = 0;
- private long oEnergy = 0;
- private int oSteam = 0;
- private int oSteamStorage = 0;
- private int oStorage = 0;
- private int oOutput = 0;
- private int oInput = 0;
- private int oID = 0;
- private int oDisplayErrorCode = 0;
- private int mTimer = 0;
- public CONTAINER_Cyclotron(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- this.mTileEntity = aTileEntity;
- if (this.mTileEntity != null && this.mTileEntity.getMetaTileEntity() != null) {
- this.addSlots(aInventoryPlayer);
- if (this.doesBindPlayerInventory()) {
- this.bindPlayerInventory(aInventoryPlayer);
- }
-
- this.detectAndSendChanges();
- } else {
- aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer;
- }
+ public CONTAINER_Cyclotron(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
- }
-
- public CONTAINER_Cyclotron(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity,
- boolean doesBindInventory) {
super(aInventoryPlayer, aTileEntity);
- this.mTileEntity = aTileEntity;
- if (this.mTileEntity != null && this.mTileEntity.getMetaTileEntity() != null) {
- this.addSlots(aInventoryPlayer);
- if (this.doesBindPlayerInventory() && doesBindInventory) {
- this.bindPlayerInventory(aInventoryPlayer);
- }
-
- this.detectAndSendChanges();
- } else {
- aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer;
- }
-
}
- public void detectAndSendChanges() {
- super.detectAndSendChanges();
- if (!this.mTileEntity.isClientSide() && this.mTileEntity.getMetaTileEntity() != null) {
- this.mStorage = (int) Math.min(2147483647L, this.mTileEntity.getEUCapacity());
- this.mEnergy = this.mTileEntity.getStoredEU();
- this.mSteamStorage = (int) Math.min(2147483647L, this.mTileEntity.getSteamCapacity());
- this.mSteam = (int) Math.min(2147483647L, this.mTileEntity.getStoredSteam());
- this.mOutput = (int) Math.min(2147483647L, this.mTileEntity.getOutputVoltage());
- this.mInput = (int) Math.min(2147483647L, this.mTileEntity.getInputVoltage());
- this.mDisplayErrorCode = this.mTileEntity.getErrorDisplayID();
- this.mProgressTime = this.mTileEntity.getProgress();
- this.mMaxProgressTime = this.mTileEntity.getMaxProgress();
- this.mActive = this.mTileEntity.isActive() ? 1 : 0;
- ++this.mTimer;
- Iterator var2 = this.crafters.iterator();
-
- while (true) {
- ICrafting var1;
- do {
- if (!var2.hasNext()) {
- this.oID = this.mID;
- this.oSteam = this.mSteam;
- this.oInput = this.mInput;
- this.oActive = this.mActive;
- this.oOutput = this.mOutput;
- this.oEnergy = this.mEnergy;
- this.oStorage = this.mStorage;
- this.oSteamStorage = this.mSteamStorage;
- this.oProgressTime = this.mProgressTime;
- this.oMaxProgressTime = this.mMaxProgressTime;
- this.oDisplayErrorCode = this.mDisplayErrorCode;
- return;
- }
-
- var1 = (ICrafting) var2.next();
- if (this.mTimer % 500 == 10 || this.oEnergy != this.mEnergy) {
-
- int uEnergy = (int) Math.min(2147483647L, this.mTileEntity.getStoredEU());
-
- var1.sendProgressBarUpdate(this, 0, uEnergy & '');
- var1.sendProgressBarUpdate(this, 1, uEnergy >>> 16);
- }
-
- if (this.mTimer % 500 == 10 || this.oStorage != this.mStorage) {
- var1.sendProgressBarUpdate(this, 2, this.mStorage & '');
- var1.sendProgressBarUpdate(this, 3, this.mStorage >>> 16);
- }
-
- if (this.mTimer % 500 == 10 || this.oOutput != this.mOutput) {
- var1.sendProgressBarUpdate(this, 4, this.mOutput);
- }
-
- if (this.mTimer % 500 == 10 || this.oInput != this.mInput) {
- var1.sendProgressBarUpdate(this, 5, this.mInput);
- }
-
- if (this.mTimer % 500 == 10 || this.oDisplayErrorCode != this.mDisplayErrorCode) {
- var1.sendProgressBarUpdate(this, 6, this.mDisplayErrorCode);
- }
-
- if (this.mTimer % 500 == 10 || this.oProgressTime != this.mProgressTime) {
- var1.sendProgressBarUpdate(this, 11, this.mProgressTime & '');
- var1.sendProgressBarUpdate(this, 12, this.mProgressTime >>> 16);
- }
-
- if (this.mTimer % 500 == 10 || this.oMaxProgressTime != this.mMaxProgressTime) {
- var1.sendProgressBarUpdate(this, 13, this.mMaxProgressTime & '');
- var1.sendProgressBarUpdate(this, 14, this.mMaxProgressTime >>> 16);
- }
-
- if (this.mTimer % 500 == 10 || this.oID != this.mID) {
- var1.sendProgressBarUpdate(this, 15, this.mID);
- }
-
- if (this.mTimer % 500 == 10 || this.oActive != this.mActive) {
- var1.sendProgressBarUpdate(this, 16, this.mActive);
- }
-
- if (this.mTimer % 500 == 10 || this.oSteam != this.mSteam) {
- var1.sendProgressBarUpdate(this, 17, this.mSteam & '');
- var1.sendProgressBarUpdate(this, 18, this.mSteam >>> 16);
- }
- } while (this.mTimer % 500 != 10 && this.oSteamStorage == this.mSteamStorage);
-
- var1.sendProgressBarUpdate(this, 19, this.mSteamStorage & '');
- var1.sendProgressBarUpdate(this, 20, this.mSteamStorage >>> 16);
- }
- }
+ public CONTAINER_Cyclotron(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
}
- @SideOnly(Side.CLIENT)
- public void updateProgressBar(int par1, int par2) {
- super.updateProgressBar(par1, par2);
- switch (par1) {
- case 0 :
- this.mEnergy = this.mEnergy & -65536 | par2;
- break;
- case 1 :
- this.mEnergy = this.mEnergy & '' | par2 << 16;
- break;
- case 2 :
- this.mStorage = this.mStorage & -65536 | par2;
- break;
- case 3 :
- this.mStorage = this.mStorage & '' | par2 << 16;
- break;
- case 4 :
- this.mOutput = par2;
- break;
- case 5 :
- this.mInput = par2;
- break;
- case 6 :
- this.mDisplayErrorCode = par2;
- case 7 :
- case 8 :
- case 9 :
- case 10 :
- default :
- break;
- case 11 :
- this.mProgressTime = this.mProgressTime & -65536 | par2;
- break;
- case 12 :
- this.mProgressTime = this.mProgressTime & '' | par2 << 16;
- break;
- case 13 :
- this.mMaxProgressTime = this.mMaxProgressTime & -65536 | par2;
- break;
- case 14 :
- this.mMaxProgressTime = this.mMaxProgressTime & '' | par2 << 16;
- break;
- case 15 :
- this.mID = par2;
- break;
- case 16 :
- this.mActive = par2;
- break;
- case 17 :
- this.mSteam = this.mSteam & -65536 | par2;
- break;
- case 18 :
- this.mSteam = this.mSteam & '' | par2 << 16;
- break;
- case 19 :
- this.mSteamStorage = this.mSteamStorage & -65536 | par2;
- break;
- case 20 :
- this.mSteamStorage = this.mSteamStorage & '' | par2 << 16;
- }
-
+ @Override
+ public void addSlots(final InventoryPlayer aInventoryPlayer) {
+ //this.addSlotToContainer(new Slot(this.mTileEntity, 1, 154, 42));
}
- public boolean canInteractWith(EntityPlayer player) {
- return this.mTileEntity.isUseableByPlayer(player);
+ @Override
+ public int getSlotCount() {
+ return 0;
}
- public String trans(String aKey, String aEnglish) {
- return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false);
+ @Override
+ public int getShiftClickSlotCount() {
+ return 0;
}
-}
\ No newline at end of file
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
index bdf19454ce..5fccb51e54 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
@@ -1,9 +1,15 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import net.minecraft.entity.player.InventoryPlayer;
+import java.lang.reflect.Field;
+import java.util.List;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.ICrafting;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -11,6 +17,11 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
* The Container I use for all my Basic Machines
*/
public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine {
+
+ public String[] mTileDescription;
+ private String[] oTileDescription;
+
+
public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
}
@@ -18,6 +29,42 @@ public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine {
public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
super(aInventoryPlayer, aTileEntity, bindInventory);
}
+
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (this.mTileEntity.isClientSide() || this.mTileEntity.getMetaTileEntity() == null) {
+ return;
+ }
+
+ try {
+ this.mTileDescription = this.mTileEntity.getInfoData();
+
+ Field bTimer = ReflectionUtils.getField(getClass(), "mTimer");
+ Field bCrafters = ReflectionUtils.getField(getClass(), "crafters");
+ int time = bTimer.getInt(this);
+ List crafters = (List) bCrafters.get(this);
+ AutoMap aCrafting = new AutoMap();
+ if (crafters != null && !crafters.isEmpty()) {
+ for (Object o : crafters) {
+ aCrafting.put((ICrafting) o);
+ }
+ }
+
+ for (final ICrafting var3 : aCrafting) {
+ if (time % 500 == 10 || this.oTileDescription != this.mTileDescription) {
+ var3.sendProgressBarUpdate((Container)this, 64, 0);
+ }
+ }
+
+ this.oTileDescription = this.mTileDescription;
+ }
+ catch (Throwable t) {
+
+ }
+ }
+
}
/*@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java
new file mode 100644
index 0000000000..2d63a13d60
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine_NoPlayerInventory.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+
+public class CONTAINER_MultiMachine_NoPlayerInventory extends CONTAINER_MultiMachine {
+
+ public CONTAINER_MultiMachine_NoPlayerInventory(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ public CONTAINER_MultiMachine_NoPlayerInventory(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
+ super(aInventoryPlayer, aTileEntity, bindInventory);
+ }
+
+ public boolean doesBindPlayerInventory() {
+ return false;
+ }
+
+ @Override
+ public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer) {
+ return null;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java
new file mode 100644
index 0000000000..0be44fa616
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_Cyclotron.java
@@ -0,0 +1,44 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_Container_MultiMachine;
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GUI_Cyclotron extends GT_GUIContainerMetaTile_Machine
+{
+ public final String mNEI;
+ public final String mName;
+
+ public GUI_Cyclotron(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aNEI) {
+ super(new GT_Container_MultiMachine(aInventoryPlayer, aTileEntity, false), "gregtech:textures/gui/multimachines/" + "FusionComputer.png");
+ this.mName = aName;
+ this.mNEI = aNEI;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ this.fontRendererObj.drawString(this.mName, 8, -10, 16448255);
+ if (this.mContainer != null) {
+ if ((((GT_Container_MultiMachine)this.mContainer).mDisplayErrorCode & 0x40) != 0x0) {
+ this.fontRendererObj.drawString("Incomplete Structure.", 10, 8, 16448255);
+ }
+ if (((GT_Container_MultiMachine)this.mContainer).mDisplayErrorCode == 0) {
+ if (((GT_Container_MultiMachine)this.mContainer).mActive == 0) {
+ this.fontRendererObj.drawString("Hit with Soft Hammer to (re-)start the Machine if it doesn't start.", -70, 170, 16448255);
+ }
+ else {
+ this.fontRendererObj.drawString("Running perfectly.", 10, 170, 16448255);
+ }
+ }
+ }
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ final int x = (this.width - this.xSize) / 2;
+ final int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
index 425fe6d01f..8293d5b9f3 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
@@ -1,12 +1,23 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import net.minecraft.entity.player.InventoryPlayer;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import gregtech.api.enums.Materials;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
+import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ResourceLocation;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -20,37 +31,113 @@ public class GUI_MultiMachine extends GT_GUIContainerMetaTile_Machine {
String mName = "";
public GUI_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aTextureFile) {
- super(new CONTAINER_MultiMachine(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
+ super(new CONTAINER_MultiMachine_NoPlayerInventory(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
this.mName = aName;
}
@Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- this.fontRendererObj.drawString(this.mName, 10, 8, 16448255);
-
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
+ fontRendererObj.drawString(this.mName+"!", 6, 7, 16448255);
if (this.mContainer != null) {
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0) {
- this.fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0) {
- this.fontRendererObj.drawString("Screws are missing.", 10, 24, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0) {
- this.fontRendererObj.drawString("Something is stuck.", 10, 32, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0) {
- this.fontRendererObj.drawString("Platings are dented.", 10, 40, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0) {
- this.fontRendererObj.drawString("Circuitry burned out.", 10, 48, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0) {
- this.fontRendererObj.drawString("That doesn't belong there.", 10, 56, 16448255);
- }
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) {
- this.fontRendererObj.drawString("Incomplete Structure.", 10, 64, 16448255);
+
+ boolean aWrench = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0;
+ boolean aScrewdriver = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0;
+ boolean aMallet = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0;
+ boolean aHammer = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0;
+ boolean aSoldering = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0;
+ boolean aCrowbar = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0;
+
+
+
+ //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String)
+ Method aDrawItemStack = ReflectionUtils.getMethod(GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class});
+ if (aDrawItemStack != null) {
+
+ try {
+
+ if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) {
+ this.fontRendererObj.drawString("Incomplete Structure.", 10, 16, 16448255); // Move down 8px
+ }
+ else {
+ Field aStringData = ReflectionUtils.getField(this.mContainer.getClass(), "oTileDescription");
+ if (aStringData != null) {
+ String[] aData = (String[]) aStringData.get(this.mContainer);
+ int aIndex = 0;
+ this.fontRendererObj.drawString(""+aStringData.getType().getSimpleName(), 6, 16+(aIndex++*8), 16448255); // Move down 8px
+ if (aData != null && aData.length > 0) {
+ for (String s : aData) {
+ this.fontRendererObj.drawString(s, 6, 16+(aIndex++*8), 16448255); // Move down 8px
+ }
+ }
+ else {
+ this.fontRendererObj.drawString("Unable to get Info Data from Tile Entity | "+(aData != null), 6, 16+(aIndex++*8), 16448255); // Move down 8px
+ }
+ }
+ else {
+ this.fontRendererObj.drawString("Unable to get Info Data from Tile Entity | Bad", 6, 16, 16448255); // Move down 8px
+
+
+ }
+
+ }
+
+
+
+
+
+
+
+ //Migrate to static block
+
+ Materials GOOD = Materials.Uranium;
+ Materials BAD = Materials.Plutonium;
+
+ ItemStack aWrenchStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, (aWrench ? BAD : GOOD), Materials.Tungsten, null);
+ ItemStack aCrowbarStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, (aCrowbar ? BAD : GOOD), Materials.Tungsten, null);
+ ItemStack aHammerStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, (aHammer ? BAD : GOOD), Materials.Tungsten, null);
+ ItemStack aMalletStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, (aMallet ? BAD : GOOD), Materials.Tungsten, null);
+ ItemStack aScrewdriverStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, (aScrewdriver ? BAD : GOOD), Materials.Tungsten, null);
+ ItemStack aSolderingStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, (aSoldering ? BAD : GOOD), Materials.Tungsten, null);
+
+ ItemStack[] aToolStacks2 = new ItemStack[] {
+ aWrenchStack,
+ aCrowbarStack,
+ aHammerStack,
+ aMalletStack,
+ aScrewdriverStack,
+ aSolderingStack
+ };
+
+ int aIndex = 0;
+ for (aIndex = 0; aIndex < 6; aIndex++) {
+
+ int x = 156;
+ int y = 112 - (18*3) + (aIndex * 18);
+ aDrawItemStack.invoke(this, new Object[] {
+ aToolStacks2[aIndex] != null ? aToolStacks2[aIndex] : ItemUtils.getErrorStack(1, "Bad Times"),
+ x,
+ y,
+ ""+(aIndex == 2 ? "H" : aIndex == 3 ? "M" : "") // Stacksize Overlay
+ });
+ this.fontRendererObj.drawString("", 10, 64, 16448255);
+ }
+
+ } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ e.printStackTrace();
+ }
}
+
+
+
+
+
+
+
+ //ItemStack aWrenchStack = ItemUtils.getSimpleStack(GregTech_API.sWrenchList., i)
+
+
+
if (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode == 0) {
if (((CONTAINER_MultiMachine) this.mContainer).mActive == 0) {
this.fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255);
--
cgit
From 5f455188ce11c975ced96d8364624af540dd276b Mon Sep 17 00:00:00 2001
From: Alkalus <3060479+draknyte1@users.noreply.github.com>
Date: Sat, 24 Aug 2019 16:34:38 +0100
Subject: + Added some more generic language strings. - Removed maintenance
requirement from Cyclotron. % More work on new Multiblock GUIs. $ Potentially
fixed #507.
---
src/Java/gtPlusPlus/core/util/math/MathUtils.java | 65 ++++
.../gregtech/api/gui/CONTAINER_MultiMachine.java | 269 +++++++++++++---
.../xmod/gregtech/api/gui/GUI_MultiMachine.java | 338 +++++++++++++++------
.../gregtech/api/gui/GUI_MultiMachine_Default.java | 68 +++++
.../base/GregtechMeta_MultiBlockBase.java | 106 +++++--
.../advanced/GregtechMetaTileEntity_Adv_EBF.java | 30 +-
.../GregtechMetaTileEntity_Cyclotron.java | 16 +-
src/resources/assets/gregtech/lang/en_US.lang | 6 +-
src/resources/assets/gregtech/lang/zh_CN.lang | 2 +-
9 files changed, 713 insertions(+), 187 deletions(-)
create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine_Default.java
(limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/gui')
diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java
index bda722b47e..a9f7b901ef 100644
--- a/src/Java/gtPlusPlus/core/util/math/MathUtils.java
+++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java
@@ -692,6 +692,39 @@ public class MathUtils {
public static int balance(int aInput, int aMin, int aMax) {
return Math.max(Math.min(aInput, aMax), aMin);
}
+
+ /**
+ * Balances a number within a range.
+ * @param aInput - The number to balance
+ * @param aMin - The minimum bounds
+ * @param aMax - The maximum bounds
+ * @return - A Number which will be between the bounds, or a boundary value.
+ */
+ public static Number balance(Number aInput, Number aMin, Number aMax) {
+ return max(min(aInput, aMax), aMin);
+ }
+
+ /**
+ * Balances a number within a range.
+ * @param aInput - The number to balance
+ * @param aMin - The minimum bounds
+ * @param aMax - The maximum bounds
+ * @return - An Integer which will be between the bounds, or a boundary value.
+ */
+ public static int balanceInt(Number aInput, Number aMin, Number aMax) {
+ return MathUtils.safeCast_LongToInt((long) balance(max(min(aInput, aMax), aMin), Integer.MIN_VALUE, Integer.MAX_VALUE));
+ }
+
+ /**
+ * Balances a number within a range.
+ * @param aInput - The number to balance
+ * @param aMin - The minimum bounds
+ * @param aMax - The maximum bounds
+ * @return - A Long which will be between the bounds, or a boundary value.
+ */
+ public static long balanceLong(Number aInput, Number aMin, Number aMax) {
+ return (long) balance(max(min(aInput, aMax), aMin), Long.MIN_VALUE, Long.MAX_VALUE);
+ }
public static int getValueWithinRange(int i, int aMin, int aMax) {
int aAmount = Math.max(Math.min(i, aMax), aMin);
@@ -703,5 +736,37 @@ public class MathUtils {
int aRemainder = (int) (aLong - (aIntMaxInLong * Integer.MAX_VALUE));
return new Pair(aIntMaxInLong, aRemainder);
}
+
+
+
+
+ /**
+ * Returns the smaller of two {@code Number}s. That is,
+ * the result the argument closer to the value of
+ * {@link Long#MIN_VALUE}. If the arguments have the same
+ * value, the result is that same value.
+ *
+ * @param a an argument.
+ * @param b another argument.
+ * @return the smaller of {@code a} and {@code b}.
+ */
+ public static Number min(Number a, Number b) {
+ return (a.longValue() <= b.longValue()) ? a : b;
+ }
+
+ /**
+ * Returns the greater of two {@code Number}s. That is, the
+ * result is the argument closer to the value of
+ * {@link Long#MAX_VALUE}. If the arguments have the same value,
+ * the result is that same value.
+ *
+ * @param a an argument.
+ * @param b another argument.
+ * @return the larger of {@code a} and {@code b}.
+ */
+ public static Number max(Number a, Number b) {
+ return (a.longValue() >= b.longValue()) ? a : b;
+ }
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
index 5fccb51e54..d3e22875ae 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
@@ -1,12 +1,19 @@
package gtPlusPlus.xmod.gregtech.api.gui;
import java.lang.reflect.Field;
+import java.util.ArrayList;
import java.util.List;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gtPlusPlus.api.objects.data.AutoMap;
+import gregtech.api.util.GT_Recipe;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
@@ -20,6 +27,9 @@ public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine {
public String[] mTileDescription;
private String[] oTileDescription;
+
+ private GregtechMeta_MultiBlockBase mMCTEI;
+ private boolean mControllerSet = false;
public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
@@ -29,56 +39,245 @@ public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine {
public CONTAINER_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
super(aInventoryPlayer, aTileEntity, bindInventory);
}
+
+ public static void setControllerInstance(CONTAINER_MultiMachine aContainer, IGregTechTileEntity aTile) {
+ if (aTile == null) {
+ return;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return;
+ }
+ if (aMetaTileEntity instanceof GregtechMeta_MultiBlockBase) {
+ aContainer.mMCTEI = (GregtechMeta_MultiBlockBase) aMetaTileEntity;
+ }
+ }
+
+ public int aTotalTickTime = 0;
+ public int aMaxParallel = 0;
+ public int aPollutionTick = 0;
+ public int aMaxInputVoltage = 0;
+ public int aInputTier = 0;
+ public int aOutputTier = 0;
+ public int aRecipeDuration = 0;
+ public int aRecipeEU = 0;
+ public int aRecipeSpecial = 0;
+ public int aPollutionReduction = 0;
+ public int aStoredEnergy = 0;
+ public int aMaxEnergy = 0;
+ public int aEfficiency = 0;
+ private int oTotalTickTime = 0;
+ private int oMaxParallel = 0;
+ private int oPollutionTick = 0;
+ private int oMaxInputVoltage = 0;
+ private int oInputTier = 0;
+ private int oOutputTier = 0;
+ private int oRecipeDuration = 0;
+ private int oRecipeEU = 0;
+ private int oRecipeSpecial = 0;
+ private int oPollutionReduction = 0;
+ private int oStoredEnergy = 0;
+ private int oMaxEnergy = 0;
+ private int oEfficiency = 0;
+
+ private static Field timer;
+ //private static Field crafters;
@Override
- public void detectAndSendChanges() {
+ public final void detectAndSendChanges() {
super.detectAndSendChanges();
if (this.mTileEntity.isClientSide() || this.mTileEntity.getMetaTileEntity() == null) {
return;
}
-
- try {
- this.mTileDescription = this.mTileEntity.getInfoData();
-
- Field bTimer = ReflectionUtils.getField(getClass(), "mTimer");
- Field bCrafters = ReflectionUtils.getField(getClass(), "crafters");
- int time = bTimer.getInt(this);
- List crafters = (List) bCrafters.get(this);
- AutoMap aCrafting = new AutoMap();
- if (crafters != null && !crafters.isEmpty()) {
+ if (!mControllerSet) {
+ setControllerInstance(this, this.mTileEntity);
+ }
+ mControllerSet = (mMCTEI != null);
+ if (timer == null) {
+ timer = ReflectionUtils.getField(getClass(), "mTimer");
+ }
+ if (crafters == null) {
+ //crafters = ReflectionUtils.getField(getClass(), "crafters");
+ }
+ if (timer != null && crafters != null && mControllerSet) {
+ Logger.INFO("Trying to update clientside GUI data");
+ try {
+ Logger.INFO("0");
+ int aTimer = (int) ReflectionUtils.getFieldValue(timer, this);
+
+ //List crafters1List = (List) crafters1;
+ List crafters2 = new ArrayList();
+ Logger.INFO("1");
for (Object o : crafters) {
- aCrafting.put((ICrafting) o);
+ if (o instanceof ICrafting) {
+ crafters2.add((ICrafting) o);
+ }
}
- }
+ Logger.INFO("2");
+ if (!crafters2.isEmpty()) {
+ Logger.INFO("3");
+ handleInitialFieldSetting();
- for (final ICrafting var3 : aCrafting) {
- if (time % 500 == 10 || this.oTileDescription != this.mTileDescription) {
- var3.sendProgressBarUpdate((Container)this, 64, 0);
+ try {
+ Logger.INFO("4");
+ for (final ICrafting var3 : crafters2) {
+ handleCraftingEvent(aTimer, var3);
+ }
+ Logger.INFO("5");
+ handleInternalFieldSetting();
+ Logger.INFO("6");
+ } catch (Throwable t) {
+
+ }
}
+ } catch (Throwable t) {
+ t.printStackTrace();
}
+ }
+ else {
+ Logger.INFO("Failed.");
+ }
+ }
+
+ public void handleInitialFieldSetting() {
+ this.aTotalTickTime = MathUtils.balance((int) mMCTEI.getTotalRuntimeInTicks(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aMaxParallel = mMCTEI.getMaxParallelRecipes();
+ this.aPollutionTick = mMCTEI.getPollutionPerTick(null);
+ this.aMaxInputVoltage = MathUtils.balance((int) mMCTEI.getMaxInputVoltage(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aInputTier = MathUtils.balance((int) mMCTEI.getInputTier(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aOutputTier = MathUtils.balance((int) mMCTEI.getOutputTier(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ if (mMCTEI.mLastRecipe != null) {
+ GT_Recipe aRecipe = mMCTEI.mLastRecipe;
+ this.aRecipeDuration = MathUtils.balance(aRecipe.mDuration, Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aRecipeEU = MathUtils.balance(aRecipe.mEUt, Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aRecipeSpecial = MathUtils.balance(aRecipe.mSpecialValue, Integer.MIN_VALUE, Integer.MAX_VALUE);
+ }
+ this.aPollutionReduction = mMCTEI.getPollutionReductionForAllMufflers();
+
+ this.aStoredEnergy = MathUtils.balance((int) mMCTEI.getStoredEnergyInAllEnergyHatches(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aMaxEnergy = MathUtils.balance((int) mMCTEI.getMaxEnergyStorageOfAllEnergyHatches(), Integer.MIN_VALUE, Integer.MAX_VALUE);
+ this.aEfficiency = MathUtils.balance(mMCTEI.mEfficiency, Integer.MIN_VALUE, Integer.MAX_VALUE);
+ }
- this.oTileDescription = this.mTileDescription;
+ public void handleCraftingEvent(int aTimer, ICrafting aCrafter) {
+ int aID = 750;
+ if (aTimer % 500 == 10 || this.oTotalTickTime != this.aTotalTickTime) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aTotalTickTime);
+ }
+ if (aTimer % 500 == 10 || this.oMaxParallel != this.aMaxParallel) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxParallel);
+ }
+ if (aTimer % 500 == 10 || this.oPollutionTick != this.aPollutionTick) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aPollutionTick);
+ }
+ if (aTimer % 500 == 10 || this.oMaxInputVoltage != this.aMaxInputVoltage) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxInputVoltage);
+ }
+ if (aTimer % 500 == 10 || this.oInputTier != this.aInputTier) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aInputTier);
+ }
+ if (aTimer % 500 == 10 || this.oOutputTier != this.aOutputTier) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aOutputTier);
+ }
+ if (aTimer % 500 == 10 || this.oRecipeDuration != this.aRecipeDuration) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeDuration);
}
- catch (Throwable t) {
+ if (aTimer % 500 == 10 || this.oRecipeEU != this.aRecipeEU) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeEU);
+ }
+ if (aTimer % 500 == 10 || this.oRecipeSpecial != this.aRecipeSpecial) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aRecipeSpecial);
+ }
+ if (aTimer % 500 == 10 || this.oPollutionReduction != this.aPollutionReduction) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aPollutionReduction);
+ }
+ if (aTimer % 500 == 10 || this.oStoredEnergy != this.aStoredEnergy) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aStoredEnergy);
+ }
+ if (aTimer % 500 == 10 || this.oMaxEnergy != this.aMaxEnergy) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aMaxEnergy);
+ }
+ if (aTimer % 500 == 10 || this.oEfficiency != this.aEfficiency) {
+ aCrafter.sendProgressBarUpdate((Container) this, aID++, this.aEfficiency);
+ }
+ }
+
+ public void handleInternalFieldSetting() {
+ this.oTotalTickTime = this.aTotalTickTime;
+ this.oMaxParallel = this.aMaxParallel;
+ this.oPollutionTick = this.aPollutionTick;
+ this.oMaxInputVoltage = this.aMaxInputVoltage;
+ this.oInputTier = this.aInputTier;
+ this.oOutputTier = this.aOutputTier;
+ this.oRecipeDuration = this.aRecipeDuration;
+ this.oRecipeEU = this.aRecipeEU;
+ this.oRecipeSpecial = this.aRecipeSpecial;
+ this.oPollutionReduction = this.aPollutionReduction;
+ this.oStoredEnergy = this.aStoredEnergy;
+ this.oMaxEnergy = this.aMaxEnergy;
+ this.oEfficiency = this.aEfficiency;
+ }
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void updateProgressBar(final int par1, final int par2) {
+ super.updateProgressBar(par1, par2);
+ int shiftedSwitch = par1 - 750;
+ switch (shiftedSwitch) {
+ case 0: {
+ this.aTotalTickTime = par2;
+ break;
+ }
+ case 1: {
+ this.aMaxParallel = par2;
+ break;
+ }
+ case 2: {
+ this.aPollutionTick = par2;
+ break;
+ }
+ case 3: {
+ this.aMaxInputVoltage = par2;
+ break;
+ }
+ case 4: {
+ this.aInputTier = par2;
+ break;
+ }
+ case 5: {
+ this.aOutputTier = par2;
+ break;
+ }
+ case 6: {
+ this.aRecipeDuration = par2;
+ break;
+ }
+ case 7: {
+ this.aRecipeEU = par2;
+ break;
+ }
+ case 8: {
+ this.aRecipeSpecial = par2;
+ break;
+ }
+ case 9: {
+ this.aPollutionReduction = par2;
+ break;
+ }
+ case 10: {
+ this.aStoredEnergy = par2;
+ break;
+ }
+ case 11: {
+ this.aMaxEnergy = par2;
+ break;
+ }
+ case 12: {
+ this.aEfficiency = par2;
+ break;
+ }
}
}
}
-
-/*@Override
- public void addSlots(InventoryPlayer aInventoryPlayer) {
- addSlotToContainer(new Slot(mTileEntity, 1, 152, 5));
- }
-
- @Override
- public int getSlotCount() {
- return 1;
- }
-
- @Override
- public int getShiftClickSlotCount() {
- return 0;
- }
-}*/
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
index 8293d5b9f3..c78e7789b8 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
@@ -1,23 +1,26 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.TimeUnit;
+import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Utility;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
-import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -28,128 +31,261 @@ import net.minecraft.util.ResourceLocation;
*/
public class GUI_MultiMachine extends GT_GUIContainerMetaTile_Machine {
- String mName = "";
+ private final static Materials GOOD;
+ private final static Materials BAD;
+ private final String mName;
+
+ private final static ConcurrentHashMap mToolStacks = new ConcurrentHashMap();
+
+ //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String)
+ private final static Method mDrawItemStack;
+
+ static {
+ GOOD = Materials.Uranium;
+ BAD = Materials.Plutonium;
+
+ //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String)
+ mDrawItemStack = ReflectionUtils.getMethod(GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class});
+ }
public GUI_MultiMachine(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aTextureFile) {
super(new CONTAINER_MultiMachine_NoPlayerInventory(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile));
- this.mName = aName;
+ this.mName = aName != null ? aName : "";
}
@Override
- protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
- fontRendererObj.drawString(this.mName+"!", 6, 7, 16448255);
+ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
if (this.mContainer != null) {
+ drawGuiInfoTextLayer(par1, par2);
+ drawGuiRepairStatusLayer(par1, par2);
+ }
+ }
- boolean aWrench = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 1) != 0;
- boolean aScrewdriver = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 2) != 0;
- boolean aMallet = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 4) != 0;
- boolean aHammer = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 8) != 0;
- boolean aSoldering = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 16) != 0;
- boolean aCrowbar = (((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 32) != 0;
-
-
-
- //net.minecraft.client.gui.inventory.GuiContainer.drawItemStack(ItemStack, int, int, String)
- Method aDrawItemStack = ReflectionUtils.getMethod(GuiContainer.class, "drawItemStack", new Class[] {ItemStack.class, int.class, int.class, String.class});
- if (aDrawItemStack != null) {
-
- try {
-
- if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) {
- this.fontRendererObj.drawString("Incomplete Structure.", 10, 16, 16448255); // Move down 8px
- }
- else {
- Field aStringData = ReflectionUtils.getField(this.mContainer.getClass(), "oTileDescription");
- if (aStringData != null) {
- String[] aData = (String[]) aStringData.get(this.mContainer);
- int aIndex = 0;
- this.fontRendererObj.drawString(""+aStringData.getType().getSimpleName(), 6, 16+(aIndex++*8), 16448255); // Move down 8px
- if (aData != null && aData.length > 0) {
- for (String s : aData) {
- this.fontRendererObj.drawString(s, 6, 16+(aIndex++*8), 16448255); // Move down 8px
- }
- }
- else {
- this.fontRendererObj.drawString("Unable to get Info Data from Tile Entity | "+(aData != null), 6, 16+(aIndex++*8), 16448255); // Move down 8px
- }
- }
- else {
- this.fontRendererObj.drawString("Unable to get Info Data from Tile Entity | Bad", 6, 16, 16448255); // Move down 8px
-
-
- }
-
- }
-
-
-
-
-
-
-
- //Migrate to static block
-
- Materials GOOD = Materials.Uranium;
- Materials BAD = Materials.Plutonium;
-
- ItemStack aWrenchStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, (aWrench ? BAD : GOOD), Materials.Tungsten, null);
- ItemStack aCrowbarStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, (aCrowbar ? BAD : GOOD), Materials.Tungsten, null);
- ItemStack aHammerStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, (aHammer ? BAD : GOOD), Materials.Tungsten, null);
- ItemStack aMalletStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, (aMallet ? BAD : GOOD), Materials.Tungsten, null);
- ItemStack aScrewdriverStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, (aScrewdriver ? BAD : GOOD), Materials.Tungsten, null);
- ItemStack aSolderingStack = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, (aSoldering ? BAD : GOOD), Materials.Tungsten, null);
-
- ItemStack[] aToolStacks2 = new ItemStack[] {
- aWrenchStack,
- aCrowbarStack,
- aHammerStack,
- aMalletStack,
- aScrewdriverStack,
- aSolderingStack
- };
-
- int aIndex = 0;
- for (aIndex = 0; aIndex < 6; aIndex++) {
-
- int x = 156;
- int y = 112 - (18*3) + (aIndex * 18);
- aDrawItemStack.invoke(this, new Object[] {
- aToolStacks2[aIndex] != null ? aToolStacks2[aIndex] : ItemUtils.getErrorStack(1, "Bad Times"),
- x,
- y,
- ""+(aIndex == 2 ? "H" : aIndex == 3 ? "M" : "") // Stacksize Overlay
- });
- this.fontRendererObj.drawString("", 10, 64, 16448255);
- }
-
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
- e.printStackTrace();
- }
+
+ protected void drawGuiInfoTextLayer(final float par1, final int par2) {
+
+ if ((((CONTAINER_MultiMachine) this.mContainer).mDisplayErrorCode & 64) != 0) {
+ this.fontRendererObj.drawString(mName, 6, 7, 16448255); // Move down 8px
+ this.fontRendererObj.drawString("Incomplete Structure.", 6, 15, 16448255); // Move down 8px
+ }
+ else {
+ int aTotalTickTime = ((CONTAINER_MultiMachine) this.mContainer).aTotalTickTime;
+ int aMaxParallel = ((CONTAINER_MultiMachine) this.mContainer).aMaxParallel;
+ int aPollutionTick = ((CONTAINER_MultiMachine) this.mContainer).aPollutionTick;
+ int aMaxInputVoltage = ((CONTAINER_MultiMachine) this.mContainer).aMaxInputVoltage;
+ int aInputTier = ((CONTAINER_MultiMachine) this.mContainer).aInputTier;
+ int aOutputTier = ((CONTAINER_MultiMachine) this.mContainer).aOutputTier;
+ int aRecipeDuration = ((CONTAINER_MultiMachine) this.mContainer).aRecipeDuration;
+ int aRecipeEU = ((CONTAINER_MultiMachine) this.mContainer).aRecipeEU;
+ int aRecipeSpecial = ((CONTAINER_MultiMachine) this.mContainer).aRecipeSpecial;
+ int aEfficiency = ((CONTAINER_MultiMachine) this.mContainer).aEfficiency;
+
+ int aPollutionReduction = ((CONTAINER_MultiMachine) this.mContainer).aPollutionReduction;
+
+
+ long aStoredEnergy = ((CONTAINER_MultiMachine) this.mContainer).aStoredEnergy;
+ long aMaxEnergy = ((CONTAINER_MultiMachine) this.mContainer).aMaxEnergy;
+
+ /*
+ * Logic Block
+ */
+
+ long seconds = (aTotalTickTime/20);
+ int weeks = (int) (TimeUnit.SECONDS.toDays(seconds) / 7);
+ int days = (int) (TimeUnit.SECONDS.toDays(seconds) - 7 * weeks);
+ long hours = TimeUnit.SECONDS.toHours(seconds) - TimeUnit.DAYS.toHours(days) - TimeUnit.DAYS.toHours(7*weeks);
+ long minutes = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60);
+ long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) *60);
+
+ ArrayList mInfo = new ArrayList();
+
+ String EU = StatCollector.translateToLocal("GTPP.info.eu");
+
+ //GTPP.machines.tier
+
+ mInfo.add(mName);
+
+ if (aInputTier > 0) {
+ mInfo.add(StatCollector.translateToLocal("GTPP.machines.input")+" "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ EnumChatFormatting.GREEN +GT_Values.VOLTAGE_NAMES[aInputTier]);
+ }
+ if (aOutputTier > 0) {
+ mInfo.add(StatCollector.translateToLocal("GTPP.machines.output")+" "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ EnumChatFormatting.GREEN +GT_Values.VOLTAGE_NAMES[aOutputTier]);
+ }
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.progress")+": "+
+ EnumChatFormatting.GREEN + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mProgressTime/20) + EnumChatFormatting.RESET +" s / "+
+ EnumChatFormatting.YELLOW + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mMaxProgressTime/20) + EnumChatFormatting.RESET +" s");
+
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy")+": "+
+ EnumChatFormatting.GREEN + Long.toString(aStoredEnergy) + EnumChatFormatting.RESET +" "+EU+" / "+
+ EnumChatFormatting.YELLOW + Long.toString(aMaxEnergy) + EnumChatFormatting.RESET +" "+EU+"");
+
+ if (aRecipeEU != 0 && aRecipeDuration > 0) {
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage")+": "+
+ EnumChatFormatting.RED + Integer.toString(-aRecipeEU) + EnumChatFormatting.RESET + " "+EU+"/t");
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.duration")+": "+
+ EnumChatFormatting.RED + Integer.toString(aRecipeDuration) + EnumChatFormatting.RESET + " ticks");
+ if (aRecipeSpecial > 0) {
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.specialvalue")+": "+
+ EnumChatFormatting.RED + Integer.toString(aRecipeEU) + EnumChatFormatting.RESET + "");
+ }
+ }
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei")+": "+
+ EnumChatFormatting.YELLOW+Long.toString(aMaxInputVoltage)+EnumChatFormatting.RESET+ " "+EU+"/t"+EnumChatFormatting.RESET);
+
+ mInfo.add(StatCollector.translateToLocal(StatCollector.translateToLocal("GTPP.machines.tier")+": "+
+ EnumChatFormatting.YELLOW+GT_Values.VN[GT_Utility.getTier(aMaxInputVoltage)]+ EnumChatFormatting.RESET));
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.efficiency")+": "+ EnumChatFormatting.YELLOW+Float.toString(aEfficiency / 100.0F)+EnumChatFormatting.RESET + " %");
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollution")+": "+ EnumChatFormatting.RED + (aPollutionTick*20)+ EnumChatFormatting.RESET+"/sec");
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced")+": "+ EnumChatFormatting.GREEN + aPollutionReduction + EnumChatFormatting.RESET+" %");
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel")+": "+EnumChatFormatting.GREEN+(aMaxParallel)+EnumChatFormatting.RESET);
+
+ mInfo.add("Total Time Since Built: ");
+ mInfo.add("" + EnumChatFormatting.DARK_GREEN + Integer.toString(weeks)+EnumChatFormatting.RESET+" Weeks,");
+ mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Integer.toString(days) +EnumChatFormatting.RESET+ " Days,");
+ mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(hours) +EnumChatFormatting.RESET+ " Hours,");
+ mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(minutes) +EnumChatFormatting.RESET+ " Minutes,");
+ mInfo.add("" + EnumChatFormatting.DARK_GREEN+ Long.toString(second) +EnumChatFormatting.RESET+ " Seconds");
+
+
+
+ // Machine Name
+ //fontRendererObj.drawString(this.mName, 6, 7, 16448255);
+
+ for (int i=0;i 10) {
+ mStartUpCheck = 10;
+ }
+ }
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
index d3f6fdb491..97ee87e4a2 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java
@@ -408,23 +408,25 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
}
- private volatile int mGraceTimer = 100;
+ private volatile int mGraceTimer = 2;
- @SuppressWarnings("unused")
@Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
- if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
- if (!this.depleteInput(FluidUtils.getFluidStack("pyrotheum", 5))) {
- this.causeMaintenanceIssue();
- this.stopMachine();
- }
- if (false) { // To be replaced with a config option or something
- this.explodeMultiblock();
- }
- }
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ //Try dry Pyrotheum after all other logic
+ if (this.mStartUpCheck < 0) {
+ if (this.mMaxProgresstime > 0 && this.mProgresstime != 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
+ if (aTick % 10 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) {
+ if (!this.depleteInput(FluidUtils.getFluidStack("pyrotheum", 5))) {
+ if (mGraceTimer-- == 0) {
+ this.causeMaintenanceIssue();
+ this.stopMachine();
+ }
+ }
+ }
+ }
}
- super.onPostTick(aBaseMetaTileEntity, aTick);
+
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
index 91620eece5..ed6c913e6b 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java
@@ -6,7 +6,6 @@ import gregtech.GT_Mod;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.TAE;
import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_Container_MultiMachine;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
@@ -22,14 +21,11 @@ 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.common.gui.GT_GUIContainer_FusionReactor;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.item.chemistry.IonParticles;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
-import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_Cyclotron;
-import gtPlusPlus.xmod.gregtech.api.gui.GUI_Cyclotron;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.block.Block;
@@ -173,12 +169,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
return false;
}
}
- mWrench = true;
- mScrewdriver = true;
- mSoftHammer = true;
- mHardHammer = true;
- mSolderingTool = true;
- mCrowbar = true;
+ this.fixAllMaintenanceIssue();
log("Built Cyclotron.");
turnCasingActive(true);
return true;
@@ -320,7 +311,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
/*if (CORE.DEVENV) {
return this.checkRecipeGeneric();
}*/
-
+ this.fixAllMaintenanceIssue();
//log("Recipe Check.");
ArrayList tItemList = getStoredInputs();
@@ -411,6 +402,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
//Time Counter
this.mTotalRunTime++;
+ this.fixAllMaintenanceIssue();
onRunningTick(null);
@@ -502,7 +494,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
stopMachine();
}
}
- doRandomMaintenanceDamage();
+ //doRandomMaintenanceDamage();
aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8)
| (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64));
aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
diff --git a/src/resources/assets/gregtech/lang/en_US.lang b/src/resources/assets/gregtech/lang/en_US.lang
index c388f9785e..9989bffcf0 100644
--- a/src/resources/assets/gregtech/lang/en_US.lang
+++ b/src/resources/assets/gregtech/lang/en_US.lang
@@ -4,15 +4,19 @@
GTPP.EBF.heat=Heat capacity
GTPP.machines.tier=Tier
+GTPP.machines.input=Input
+GTPP.machines.output=Output
GTPP.multiblock.pollutionreduced=Pollution reduced to
GTPP.multiblock.pollution=Pollution
GTPP.multiblock.energy=Stored Energy
-GTPP.multiblock.Progress=Progress
+GTPP.multiblock.progress=Progress
GTPP.multiblock.efficiency=Efficiency
GTPP.multiblock.problems=Problems
GTPP.multiblock.mei=Max Energy Income
GTPP.multiblock.usage=Probably uses
+GTPP.multiblock.specialvalue=Special Value
+GTPP.multiblock.duration=Duration
diff --git a/src/resources/assets/gregtech/lang/zh_CN.lang b/src/resources/assets/gregtech/lang/zh_CN.lang
index 750961610a..df43ca8590 100644
--- a/src/resources/assets/gregtech/lang/zh_CN.lang
+++ b/src/resources/assets/gregtech/lang/zh_CN.lang
@@ -8,7 +8,7 @@ GTPP.machines.tier=等级
GTPP.multiblock.pollutionreduced=减少污染至
GTPP.multiblock.pollution=污染
GTPP.multiblock.energy=能量存储
-GTPP.multiblock.Progress=进程
+GTPP.multiblock.progress=进程
GTPP.multiblock.efficiency=效率
GTPP.multiblock.problems=为每桶
GTPP.multiblock.mei=最大能量输入
--
cgit
From 68e266e0a227aaf90294d2a8ffd5081dc3bb640e Mon Sep 17 00:00:00 2001
From: Alkalus <3060479+draknyte1@users.noreply.github.com>
Date: Thu, 24 Oct 2019 00:58:51 +0100
Subject: + Added Chemical Plant. + Added more Bio Recipes. $ Fixed Strontium
Hydroxide generating before it's components. $ Fixed existing Bio Recipes not
working.
---
src/Java/gregtech/api/util/Recipe_GT.java | 18 +
.../gtPlusPlus/core/handler/COMPAT_HANDLER.java | 1 +
src/Java/gtPlusPlus/core/item/ModItems.java | 8 +-
.../core/item/chemistry/AgriculturalChem.java | 183 ++++-
.../gtPlusPlus/core/material/MISC_MATERIALS.java | 36 +-
.../gtPlusPlus/core/recipe/RECIPES_GREGTECH.java | 10 +-
.../core/slots/SlotChemicalPlantInput.java | 45 ++
.../gtPlusPlus/core/slots/SlotNoInputLogging.java | 25 +
.../gtPlusPlus/core/util/minecraft/FluidUtils.java | 6 +-
src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java | 456 ++++++++++++
src/Java/gtPlusPlus/nei/NEI_GT_Config.java | 7 +-
.../gtPlusPlus/plugin/agrichem/BioRecipes.java | 817 ++++++++++++++++++---
.../gtPlusPlus/plugin/agrichem/Core_Agrichem.java | 134 +---
.../plugin/agrichem/block/AgrichemFluids.java | 16 +
.../xmod/forestry/bees/custom/GTPP_Bees.java | 1 -
.../xmod/gregtech/api/enums/GregtechItemList.java | 6 +-
.../gui/fluidreactor/Container_FluidReactor.java | 182 +++++
.../api/gui/fluidreactor/GUI_FluidReactor.java | 122 +++
.../interfaces/internal/IGregtech_RecipeAdder.java | 7 +
.../common/blocks/textures/TexturesGtBlock.java | 9 +-
.../GregtechMetaTileEntity_ChemicalReactor.java | 706 ++++++++++++++++++
.../gregtech/loaders/RecipeGen_FluidCanning.java | 63 +-
.../xmod/gregtech/loaders/RecipeGen_Fluids.java | 20 +-
.../xmod/gregtech/loaders/RecipeGen_Recycling.java | 2 +-
.../xmod/gregtech/recipes/GregtechRecipeAdder.java | 48 ++
.../gregtech/GregtechFluidReactor.java | 24 +
.../xmod/growthcraft/fishtrap/FishTrapHandler.java | 4 +-
.../recipe/TF_Gregtech_Recipes.java | 6 +-
.../TileEntities/FluidReactor/OVERLAY_FRONT.png | Bin 0 -> 313 bytes
.../FluidReactor/OVERLAY_FRONT_ACTIVE.png | Bin 0 -> 704 bytes
.../FluidReactor/OVERLAY_FRONT_ACTIVE.png.mcmeta | 6 +
.../TileEntities/FluidReactor/OVERLAY_SIDE.png | Bin 0 -> 333 bytes
.../FluidReactor/OVERLAY_SIDE_ACTIVE.png | Bin 0 -> 1049 bytes
.../FluidReactor/OVERLAY_SIDE_ACTIVE.png.mcmeta | 6 +
.../TileEntities/FluidReactor/OVERLAY_TOP.png | Bin 0 -> 228 bytes
.../FluidReactor/OVERLAY_TOP_ACTIVE.png | Bin 0 -> 224 bytes
.../assets/miscutils/textures/gui/FluidReactor.png | Bin 0 -> 3587 bytes
.../textures/items/bioscience/BioCircuit.png | Bin 0 -> 432 bytes
.../textures/items/bioscience/MetaItem1/8.png | Bin 624 -> 654 bytes
39 files changed, 2640 insertions(+), 334 deletions(-)
create mode 100644 src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
create mode 100644 src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java
create mode 100644 src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java
create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java
create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java
create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java
create mode 100644 src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java
create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT.png
create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png
create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png.mcmeta
create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE.png
create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png
create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png.mcmeta
create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP.png
create mode 100644 src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE.png
create mode 100644 src/resources/assets/miscutils/textures/gui/FluidReactor.png
create mode 100644 src/resources/assets/miscutils/textures/items/bioscience/BioCircuit.png
(limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/gui')
diff --git a/src/Java/gregtech/api/util/Recipe_GT.java b/src/Java/gregtech/api/util/Recipe_GT.java
index 1e37c9be13..af7fe38f38 100644
--- a/src/Java/gregtech/api/util/Recipe_GT.java
+++ b/src/Java/gregtech/api/util/Recipe_GT.java
@@ -18,6 +18,7 @@ import gtPlusPlus.api.interfaces.IComparableRecipe;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import gtPlusPlus.api.objects.minecraft.NoConflictGTRecipeMap;
+import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
import gtPlusPlus.nei.GT_NEI_MultiBlockHandler;
@@ -260,6 +261,23 @@ public class Recipe_GT extends GT_Recipe implements IComparableRecipe{
//Basic Washer Map
public static final GT_Recipe_Map sSimpleWasherRecipes = new GT_Recipe_Map(new HashSet(3), "gt.recipe.simplewasher", "Simple Dust Washer", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, true);
+
+ public static final Gregtech_Recipe_Map sFluidChemicalReactorRecipes = new Gregtech_Recipe_Map(
+ new HashSet(100),
+ "gt.recipe.fluidchemicaleactor",
+ "Chemical Plant",
+ null,
+ CORE.MODID+":textures/gui/FluidReactor",
+ 0,
+ 0,
+ 0,
+ 2,
+ 1,
+ "Tier: ",
+ 1,
+ E,
+ true,
+ false);
//RTG Fuel Map
diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
index fd30457b46..0b1078366a 100644
--- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
+++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -135,6 +135,7 @@ public class COMPAT_HANDLER {
GregtechSolarTower.run();
GregtechLargeTurbinesAndHeatExchanger.run();
GregtechPowerBreakers.run();
+ GregtechFluidReactor.run();
//New Horizons Content
NewHorizonsAccelerator.run();
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java
index 96fe5694cc..8bfcfe2d70 100644
--- a/src/Java/gtPlusPlus/core/item/ModItems.java
+++ b/src/Java/gtPlusPlus/core/item/ModItems.java
@@ -1055,10 +1055,10 @@ public final class ModItems {
GT_OreDictUnificator.registerOre("platePhasedIron", ItemUtils.getSimpleStack(itemPlatePulsatingIron));
GT_OreDictUnificator.registerOre("blockVibrantAlloy", ItemUtils.getItemStackOfAmountFromOreDict("blockPhasedGold", 1));
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getPlate(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9);
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getIngot(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9);
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getNugget(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(16), 16, 4);
- CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getBlock(1), null, MaterialEIO.REDSTONE_ALLOY.getFluid(1294), 16, 4*9*9);
+ CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getPlate(1), MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9);
+ CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getIngot(1), MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9);
+ CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getNugget(1), MaterialEIO.REDSTONE_ALLOY.getFluid(16), 16, 4);
+ CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getBlock(1), MaterialEIO.REDSTONE_ALLOY.getFluid(1294), 16, 4*9*9);
}
else {
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
index fd0d044c05..324a3aa9ee 100644
--- a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
+++ b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
@@ -2,6 +2,7 @@ package gtPlusPlus.core.item.chemistry;
import java.lang.reflect.Field;
import java.util.ArrayList;
+import java.util.List;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
@@ -15,6 +16,11 @@ import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.plugin.agrichem.BioRecipes;
+import gtPlusPlus.plugin.agrichem.item.algae.ItemAgrichemBase;
+import gtPlusPlus.plugin.agrichem.item.algae.ItemAlgaeBase;
+import gtPlusPlus.plugin.agrichem.item.algae.ItemBioChip;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -71,6 +77,60 @@ public class AgriculturalChem extends ItemPackage {
// Fertilizer
+
+ public static Item mAlgae;
+ public static Item mBioCircuit;
+ public static Item mAgrichemItem1;
+
+ /*
+ * 0 - Algae Biomass
+ * 1 - Green Algae Biomass
+ * 2 - Brown Algae Biomass
+ * 3 - Golden-Brown Algae Biomass
+ * 4 - Red Algae Biomass
+ * 5 - Cellulose Fiber
+ * 6 - Golden-Brown Cellulose Fiber
+ * 7 - Red Cellulose Fiber
+ * 8 - Compost
+ * 9 - Wood Pellet
+ * 10 - Wood Brick
+ * 11 - Cellulose Pulp
+ * 12 - Raw Bio Resin
+ * 13 - Catalyst Carrier
+ * 14 - Green Metal Catalyst
+ * 15 - Alginic Acid
+ * 16 - Alumina
+ * 17 - Aluminium Pellet
+ * 18 - Sodium Aluminate
+ * 19 - Sodium Hydroxide // Exists in Newer GT
+ * 20 - Sodium Carbonate
+ * 21 - Lithium Chloride
+ */
+
+ public static ItemStack mAlgaeBiosmass;
+ public static ItemStack mGreenAlgaeBiosmass;
+ public static ItemStack mBrownAlgaeBiosmass;
+ public static ItemStack mGoldenBrownAlgaeBiosmass;
+ public static ItemStack mRedAlgaeBiosmass;
+ public static ItemStack mCelluloseFiber;
+ public static ItemStack mGoldenBrownCelluloseFiber;
+ public static ItemStack mRedCelluloseFiber;
+ public static ItemStack mCompost;
+ public static ItemStack mWoodPellet;
+ public static ItemStack mWoodBrick;
+ public static ItemStack mCellulosePulp;
+ public static ItemStack mRawBioResin;
+ public static ItemStack mCatalystCarrier;
+ public static ItemStack mGreenCatalyst;
+ public static ItemStack mAlginicAcid;
+ public static ItemStack mAlumina;
+ public static ItemStack mAluminiumPellet;
+ public static ItemStack mSodiumAluminate;
+ public static ItemStack mSodiumHydroxide;
+ public static ItemStack mSodiumCarbonate;
+ public static ItemStack mLithiumChloride;
+
+
@Override
public void items() {
// Nitrogen, Ammonium Nitrate, Phosphates, Calcium, Copper, Carbon
@@ -82,7 +142,91 @@ public class AgriculturalChem extends ItemPackage {
"Ca5(PO4)3(OH)", Utils.rgbtoHexValue(240, 240, 240))[0];
// Dirt Dust :)
- dustDirt = ItemUtils.generateSpecialUseDusts("Dirt", "Dried Earth", Utils.rgbtoHexValue(65, 50, 15))[0];
+ dustDirt = ItemUtils.generateSpecialUseDusts("Dirt", "Dried Earth", Utils.rgbtoHexValue(65, 50, 15))[0];
+
+ mAlgae = new ItemAlgaeBase();
+ mAgrichemItem1 = new ItemAgrichemBase();
+ mBioCircuit = new ItemBioChip();
+ GregtechItemList.Circuit_BioRecipeSelector.set(mBioCircuit);
+
+
+
+ mAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 0, 1);
+ mGreenAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 1, 1);
+ mBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 2, 1);
+ mGoldenBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 3, 1);
+ mRedAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 4, 1);
+ mCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 5, 1);
+ mGoldenBrownCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 6, 1);
+ mRedCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 7, 1);
+ mCompost = ItemUtils.simpleMetaStack(mAgrichemItem1, 8, 1);
+ mWoodPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 9, 1);
+ mWoodBrick = ItemUtils.simpleMetaStack(mAgrichemItem1, 10, 1);
+ mCellulosePulp = ItemUtils.simpleMetaStack(mAgrichemItem1, 11, 1);
+ mRawBioResin = ItemUtils.simpleMetaStack(mAgrichemItem1, 12, 1);
+ mCatalystCarrier = ItemUtils.simpleMetaStack(mAgrichemItem1, 13, 1);
+ mGreenCatalyst = ItemUtils.simpleMetaStack(mAgrichemItem1, 14, 1);
+ mAlginicAcid = ItemUtils.simpleMetaStack(mAgrichemItem1, 15, 1);
+ mAlumina = ItemUtils.simpleMetaStack(mAgrichemItem1, 16, 1);
+ mAluminiumPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 17, 1);
+ mSodiumAluminate = ItemUtils.simpleMetaStack(mAgrichemItem1, 18, 1);
+
+ /**
+ * If It exists, don't add a new one.
+ */
+ if (OreDictionary.doesOreNameExist("dustSodiumHydroxide_GT5U") || OreDictionary.doesOreNameExist("dustSodiumHydroxide")) {
+ List aTest = OreDictionary.getOres("dustSodiumHydroxide", false);
+ ItemStack aTestStack;
+ if (aTest.isEmpty()) {
+ aTest = OreDictionary.getOres("dustSodiumHydroxide_GT5U", false);
+ if (aTest.isEmpty()) {
+ aTestStack = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1);
+ }
+ else {
+ aTestStack = aTest.get(0);
+ }
+ }
+ else {
+ aTestStack = aTest.get(0);
+ }
+ mSodiumHydroxide = aTestStack;
+ }
+ else {
+ mSodiumHydroxide = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1);
+ }
+ mSodiumCarbonate = ItemUtils.simpleMetaStack(mAgrichemItem1, 20, 1);
+ mLithiumChloride = ItemUtils.simpleMetaStack(mAgrichemItem1, 21, 1);
+
+ ItemUtils.addItemToOreDictionary(mGreenAlgaeBiosmass, "biomassGreenAlgae");
+ ItemUtils.addItemToOreDictionary(mBrownAlgaeBiosmass, "biomassBrownAlgae");
+ ItemUtils.addItemToOreDictionary(mGoldenBrownAlgaeBiosmass, "biomassGoldenBrownAlgae");
+ ItemUtils.addItemToOreDictionary(mRedAlgaeBiosmass, "biomassRedAlgae");
+
+ ItemUtils.addItemToOreDictionary(mCelluloseFiber, "fiberCellulose");
+ ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberCellulose");
+ ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberGoldenBrownCellulose");
+ ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberCellulose");
+ ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberRedCellulose");
+
+ ItemUtils.addItemToOreDictionary(mWoodPellet, "pelletWood");
+ ItemUtils.addItemToOreDictionary(mWoodBrick, "brickWood");
+ ItemUtils.addItemToOreDictionary(mCellulosePulp, "pulpCellulose");
+
+ ItemUtils.addItemToOreDictionary(mCatalystCarrier, "catalystEmpty");
+ ItemUtils.addItemToOreDictionary(mGreenCatalyst, "catalystAluminiumSilver");
+ ItemUtils.addItemToOreDictionary(mAlginicAcid, "dustAlginicAcid");
+ ItemUtils.addItemToOreDictionary(mAlumina, "dustAlumina");
+ ItemUtils.addItemToOreDictionary(mAluminiumPellet, "pelletAluminium");
+
+ ItemUtils.addItemToOreDictionary(mSodiumAluminate, "dustSodiumAluminate");
+ if (mSodiumHydroxide.getItem() instanceof ItemAgrichemBase) {
+ ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide");
+ }
+ ItemUtils.addItemToOreDictionary(mSodiumCarbonate, "dustSodiumCarbonate");
+ ItemUtils.addItemToOreDictionary(mLithiumChloride, "dustLithiumChloride");
+
+
+
}
@Override
@@ -156,20 +300,20 @@ public class AgriculturalChem extends ItemPackage {
}
- private static AutoMap mMeats = new AutoMap();
- private static AutoMap mFish = new AutoMap();
- private static AutoMap mFruits = new AutoMap();
- private static AutoMap mVege = new AutoMap();
- private static AutoMap mNuts = new AutoMap();
- private static AutoMap mSeeds = new AutoMap();
- private static AutoMap mPeat = new AutoMap();
- private static AutoMap mBones = new AutoMap();
- private static AutoMap mBoneMeal = new AutoMap();
-
- private static AutoMap mList_Master_Meats = new AutoMap();
- private static AutoMap mList_Master_FruitVege = new AutoMap();
- private static AutoMap mList_Master_Bones = new AutoMap();
- private static AutoMap mList_Master_Seeds = new AutoMap();
+ public final static AutoMap mMeats = new AutoMap();
+ public final static AutoMap mFish = new AutoMap();
+ public final static AutoMap mFruits = new AutoMap();
+ public final static AutoMap mVege = new AutoMap();
+ public final static AutoMap mNuts = new AutoMap();
+ public final static AutoMap mSeeds = new AutoMap();
+ private final static AutoMap mPeat = new AutoMap();
+ private final static AutoMap mBones = new AutoMap();
+ private final static AutoMap mBoneMeal = new AutoMap();
+
+ public final static AutoMap mList_Master_Meats = new AutoMap();
+ public final static AutoMap mList_Master_FruitVege = new AutoMap();
+ public final static AutoMap mList_Master_Seeds = new AutoMap();
+ private final static AutoMap mList_Master_Bones = new AutoMap();
private static void processAllOreDict() {
processOreDict("listAllmeatraw", mMeats);
@@ -323,6 +467,10 @@ public class AgriculturalChem extends ItemPackage {
}
}
}
+
+ public static ItemStack aFertForestry;
+ public static ItemStack aFertIC2;
+
private static void addMiscRecipes() {
@@ -342,6 +490,7 @@ public class AgriculturalChem extends ItemPackage {
Field aFertField = ReflectionUtils.getField(aItemRegInstance.getClass(), "fertilizerCompound");
Object aItemInstance = aFertField.get(aItemRegInstance);
if (aItemInstance instanceof Item) {
+ aFertForestry = ItemUtils.getSimpleStack((Item) aItemInstance);
Item aForestryFert = (Item) aItemInstance;
CORE.RA.addDehydratorRecipe(
new ItemStack[] { CI.getNumberedCircuit(11), ItemUtils.getSimpleStack(aDustOrganicFert, 4) }, null,
@@ -359,6 +508,7 @@ public class AgriculturalChem extends ItemPackage {
* IC2 Support
*/
if (LoadedMods.IndustrialCraft2) {
+ aFertIC2 = ItemUtils.getItemStackFromFQRN("IC2:itemFertilizer", 1);
CORE.RA.addDehydratorRecipe(
new ItemStack[] { CI.getNumberedCircuit(12), ItemUtils.getSimpleStack(aDustOrganicFert, 4) }, null,
null, new ItemStack[] { ItemUtils.getItemStackFromFQRN("IC2:itemFertilizer", 3), aManureByprod,
@@ -414,6 +564,9 @@ public class AgriculturalChem extends ItemPackage {
addAdvancedOrganiseFertRecipes();
addMiscRecipes();
+
+ BioRecipes.init();
+
return true;
}
}
diff --git a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java
index b38451bba3..8dad69f70a 100644
--- a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java
+++ b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java
@@ -38,24 +38,6 @@ public final class MISC_MATERIALS {
new MaterialStack(ELEMENT.getInstance().OXYGEN, 1)
});
- public static final Material STRONTIUM_HYDROXIDE = new Material(
- "Strontium Hydroxide",
- MaterialState.SOLID,
- TextureSet.SET_METALLIC,
- null,
- -1,
- -1,
- -1,
- -1,
- false,
- "Sr(OH)2",
- 0,
- false,
- new MaterialStack[]{
- new MaterialStack(ELEMENT.getInstance().STRONTIUM, 1),
- new MaterialStack(MISC_MATERIALS.HYDROXIDE, 2)
- });
-
public static final Material SELENIUM_DIOXIDE = new Material(
"Selenium Dioxide",
MaterialState.PURE_LIQUID, //State
@@ -303,6 +285,24 @@ public final class MISC_MATERIALS {
new MaterialStack(SODIUM_CHLORIDE, 2),
});
+ public static final Material STRONTIUM_HYDROXIDE = new Material(
+ "Strontium Hydroxide",
+ MaterialState.SOLID,
+ TextureSet.SET_METALLIC,
+ null,
+ -1,
+ -1,
+ -1,
+ -1,
+ false,
+ "Sr(OH)2",
+ 0,
+ false,
+ new MaterialStack[]{
+ new MaterialStack(ELEMENT.getInstance().STRONTIUM, 1),
+ new MaterialStack(MISC_MATERIALS.HYDROXIDE, 2)
+ });
+
}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
index f237eb9f37..3f631e0bca 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
@@ -1588,18 +1588,18 @@ public class RECIPES_GREGTECH {
private static void fluidExtractorRecipes() {
//FLiBe fuel
- CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 1), null,
+ CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 1),
FluidUtils.getFluidStack("li2bef4", 144), 100, 500);
//LFTR Fuel 1
- CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4U235.getDust(1), null,
+ CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4U235.getDust(1),
NUCLIDE.LiFBeF2ZrF4U235.getFluid(144), 250, 1000);
- CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4UF4.getDust(1), null,
+ CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4UF4.getDust(1),
NUCLIDE.LiFBeF2ZrF4UF4.getFluid(144), 150, 2000);
- CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ThF4UF4.getDust(1), null,
+ CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ThF4UF4.getDust(1),
NUCLIDE.LiFBeF2ThF4UF4.getFluid(144), 200, 1500);
//ZIRCONIUM_TETRAFLUORIDE
- CORE.RA.addFluidExtractionRecipe(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(1), null,
+ CORE.RA.addFluidExtractionRecipe(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(1),
FluidUtils.getFluidStack(ModItems.fluidZrF4, 144), 200, 512+256);
diff --git a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
new file mode 100644
index 0000000000..6cd13dc209
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
@@ -0,0 +1,45 @@
+package gtPlusPlus.core.slots;
+
+import gregtech.api.util.Recipe_GT;
+import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
+public class SlotChemicalPlantInput extends Slot {
+
+ public SlotChemicalPlantInput(final IInventory inventory, final int index, final int x, final int y) {
+ super(inventory, index, x, y);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return isItemValidForChemicalPlantSlot(itemstack);
+ }
+
+ public static boolean isItemValidForChemicalPlantSlot(ItemStack aStack) {
+ boolean validItem = Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.containsInput(aStack);
+ if (!validItem) {
+ for (Recipe_GT f : Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList) {
+ if (f.mFluidInputs.length > 0) {
+ for (FluidStack g : f.mFluidInputs) {
+ if (g != null) {
+ if (FluidContainerRegistry.containsFluid(aStack, g)) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ return validItem;
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 64;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java b/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java
new file mode 100644
index 0000000000..42bc7ce346
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java
@@ -0,0 +1,25 @@
+package gtPlusPlus.core.slots;
+
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+
+public class SlotNoInputLogging extends SlotNoInput {
+
+ private final int aSlotIndex;
+
+ public SlotNoInputLogging(final IInventory inventory, final int index, final int x, final int y) {
+ super(inventory, index, x, y);
+ aSlotIndex = index;
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ if (ItemUtils.checkForInvalidItems(itemstack)) {
+ Logger.INFO("Tried Inserting "+ItemUtils.getItemName(itemstack)+" into slot "+aSlotIndex);
+ }
+ return false;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
index 8902947c0d..d7b6bc0a30 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java
@@ -463,8 +463,7 @@ public class FluidUtils {
if (dustStack != null){
CORE.RA.addFluidExtractionRecipe(
- dustStack, //Input
- null, //Input 2
+ dustStack, //Input 2
FluidUtils.getFluidStack(gtFluid, amountPerItem), //Fluid Output
1*20, //Duration
16 //Eu Tick
@@ -472,8 +471,7 @@ public class FluidUtils {
}
if (dustStack2 != null){
CORE.RA.addFluidExtractionRecipe(
- dustStack2, //Input
- null, //Input 2
+ dustStack2, //Input 2
FluidUtils.getFluidStack(gtFluid, amountPerItem), //Fluid Output
1*20, //Duration
16 //Eu Tick
diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java b/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java
new file mode 100644
index 0000000000..5c5d1169aa
--- /dev/null
+++ b/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java
@@ -0,0 +1,456 @@
+package gtPlusPlus.nei;
+
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.lwjgl.opengl.GL11;
+
+import cpw.mods.fml.common.event.FMLInterModComms;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.objects.ItemData;
+import gregtech.api.util.*;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map;
+import gtPlusPlus.core.lib.CORE;
+import codechicken.lib.gui.GuiDraw;
+import codechicken.nei.PositionedStack;
+import codechicken.nei.guihook.GuiContainerManager;
+import codechicken.nei.guihook.IContainerInputHandler;
+import codechicken.nei.guihook.IContainerTooltipHandler;
+import codechicken.nei.recipe.*;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GT_NEI_FluidReactor
+extends TemplateRecipeHandler {
+ public static final int sOffsetX = 5;
+ public static final int sOffsetY = 11;
+
+ static {
+ GuiContainerManager.addInputHandler(new GT_RectHandler());
+ GuiContainerManager.addTooltipHandler(new GT_RectHandler());
+ }
+
+ protected final Gregtech_Recipe_Map mRecipeMap;
+
+ public GT_NEI_FluidReactor(final Gregtech_Recipe_Map sfluidchemicalreactorrecipes) {
+ this.mRecipeMap = sfluidchemicalreactorrecipes;
+ this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier(), new Object[0]));
+ if (!NEI_GT_Config.sIsAdded) {
+ FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getOverlayIdentifier());
+ GuiCraftingRecipe.craftinghandlers.add(this);
+ GuiUsageRecipe.usagehandlers.add(this);
+ }
+ }
+
+ public static void drawText(final int aX, final int aY, final String aString, final int aColor) {
+ Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor);
+ }
+
+ @Override
+ public TemplateRecipeHandler newInstance() {
+ return new GT_NEI_FluidReactor(this.mRecipeMap);
+ }
+
+ @Override
+ public void loadCraftingRecipes(final String outputId, final Object... results) {
+ if (outputId.equals(this.getOverlayIdentifier())) {
+ for (final GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) {
+ if (!tRecipe.mHidden) {
+ this.arecipes.add(new CachedDefaultRecipe(tRecipe));
+ }
+ }
+ } else {
+ super.loadCraftingRecipes(outputId, results);
+ }
+ }
+
+ @Override
+ public void loadCraftingRecipes(final ItemStack aResult) {
+ final ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult);
+
+ final ArrayList tResults = new ArrayList();
+ tResults.add(aResult);
+ tResults.add(GT_OreDictUnificator.get(true, aResult));
+ if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) {
+ for (final OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) {
+ tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L));
+ }
+ }
+ final FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true);
+ if (tFluid != null) {
+ tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false));
+ for (final FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
+ if (tData.fluid.isFluidEqual(tFluid)) {
+ tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer}));
+ }
+ }
+ }
+ for (final GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) {
+ if (!tRecipe.mHidden) {
+ final CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe);
+ for (final ItemStack tStack : tResults) {
+ if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) {
+ this.arecipes.add(tNEIRecipe);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void loadUsageRecipes(final ItemStack aInput) {
+ final ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput);
+
+ final ArrayList tInputs = new ArrayList();
+ tInputs.add(aInput);
+ tInputs.add(GT_OreDictUnificator.get(false, aInput));
+ if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) {
+ for (final OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) {
+ tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L));
+ }
+ }
+ final FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true);
+ if (tFluid != null) {
+ tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false));
+ for (final FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
+ if (tData.fluid.isFluidEqual(tFluid)) {
+ tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer}));
+ }
+ }
+ }
+ for (final GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) {
+ if (!tRecipe.mHidden) {
+ final CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe);
+ for (final ItemStack tStack : tInputs) {
+ if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) {
+ this.arecipes.add(tNEIRecipe);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public String getOverlayIdentifier() {
+ return this.mRecipeMap.mNEIName;
+ }
+
+ @Override
+ public void drawBackground(final int recipe) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GuiDraw.changeTexture(this.getGuiTexture());
+ GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78);
+ }
+
+ @Override
+ public int recipiesPerPage() {
+ return 1;
+ }
+
+ @Override
+ public String getRecipeName() {
+ return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName);
+ }
+
+ @Override
+ public String getGuiTexture() {
+ return CORE.MODID+":textures/gui/FluidReactor.png";
+ }
+
+ @Override
+ public List handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List currenttip, final int aRecipeIndex) {
+ final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex);
+ if ((tObject instanceof CachedDefaultRecipe)) {
+ final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject;
+ for (final PositionedStack tStack : tRecipe.mOutputs) {
+ if (aStack == tStack.item) {
+ if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) {
+ break;
+ }
+ currenttip.add("Chance: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%");
+ break;
+ }
+ }
+ for (final PositionedStack tStack : tRecipe.mInputs) {
+ if (aStack == tStack.item) {
+ if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) ||
+ (tStack.item.stackSize != 0)) {
+ break;
+ }
+ currenttip.add("Does not get consumed in the process");
+ break;
+ }
+ }
+ }
+ return currenttip;
+ }
+
+ @Override
+ public void drawExtras(final int aRecipeIndex) {
+ final int tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt;
+ final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration;
+ if (tEUt != 0) {
+ drawText(10, 73, "Total: " + (tDuration * tEUt) + " EU", -16777216);
+ drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216);
+ if (this.mRecipeMap.mShowVoltageAmperageInNEI) {
+ drawText(10, 93, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216);
+ drawText(10, 103, "Amperage: " + this.mRecipeMap.mAmperage, -16777216);
+ } else {
+ drawText(10, 93, "Voltage: unspecified", -16777216);
+ drawText(10, 103, "Amperage: unspecified", -16777216);
+ }
+ }
+ if (tDuration > 0) {
+ drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216);
+ }
+ if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) {
+ drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216);
+ }
+ }
+
+ public static class GT_RectHandler
+ implements IContainerInputHandler, IContainerTooltipHandler {
+ @Override
+ public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) {
+ if (this.canHandle(gui)) {
+ if (button == 0) {
+ return this.transferRect(gui, false);
+ }
+ if (button == 1) {
+ return this.transferRect(gui, true);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) {
+ return false;
+ }
+
+ public boolean canHandle(final GuiContainer gui) {
+ return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/);
+ }
+
+ @Override
+ public List handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List currenttip) {
+ if ((this.canHandle(gui)) && (currenttip.isEmpty())) {
+ if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) {
+ currenttip.add("Recipes");
+ } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) {
+ currenttip.add("Recipes");
+ }*/
+
+ }
+ return currenttip;
+ }
+
+ private boolean transferRect(final GuiContainer gui, final boolean usage) {
+ if (gui instanceof GT_GUIContainer_BasicMachine) {
+ return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]));
+ } /*else if (gui instanceof GT_GUIContainer_FusionReactor) {
+ return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]));
+ }*/
+ return false;
+ }
+
+ @Override
+ public List handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List currenttip) {
+ return currenttip;
+ }
+
+ @Override
+ public List handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List currenttip) {
+ return currenttip;
+ }
+
+ @Override
+ public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) {
+ return false;
+ }
+
+ @Override
+ public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) {
+ }
+
+ @Override
+ public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) {
+ }
+
+ @Override
+ public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) {
+ }
+
+ @Override
+ public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) {
+ return false;
+ }
+
+ @Override
+ public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) {
+ }
+
+ @Override
+ public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) {
+ }
+ }
+
+ public class FixedPositionedStack
+ extends PositionedStack {
+ public final int mChance;
+ public boolean permutated = false;
+
+ public FixedPositionedStack(final Object object, final int x, final int y) {
+ this(object, x, y, 0);
+ }
+
+ public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) {
+ super(object, x, y, true);
+ this.mChance = aChance;
+ }
+
+ @Override
+ public void generatePermutations() {
+ if (this.permutated) {
+ return;
+ }
+ final ArrayList tDisplayStacks = new ArrayList();
+ for (final ItemStack tStack : this.items) {
+ if (GT_Utility.isStackValid(tStack)) {
+ if (tStack.getItemDamage() == 32767) {
+ final List permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem());
+ if (!permutations.isEmpty()) {
+ ItemStack stack;
+ for (final Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) {
+ stack = i$.next();
+ }
+ } else {
+ final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize);
+ base.stackTagCompound = tStack.stackTagCompound;
+ tDisplayStacks.add(base);
+ }
+ } else {
+ tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack}));
+ }
+ }
+ }
+ this.items = (tDisplayStacks.toArray(new ItemStack[0]));
+ if (this.items.length == 0) {
+ this.items = new ItemStack[]{new ItemStack(Blocks.fire)};
+ }
+ this.permutated = true;
+ this.setPermutationToRender(0);
+ }
+ }
+
+ public class CachedDefaultRecipe
+ extends TemplateRecipeHandler.CachedRecipe {
+ public final GT_Recipe mRecipe;
+ public final List mOutputs = new ArrayList();
+ public final List mInputs = new ArrayList();
+
+ public CachedDefaultRecipe(final GT_Recipe aRecipe) {
+ super();
+ this.mRecipe = aRecipe;
+
+ int tStartIndex = 0;
+
+ // Four Input Slots
+ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 3, -4));
+ }
+ tStartIndex++;
+ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 21, -4));
+ }
+ tStartIndex++;
+ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 39, -4));
+ }
+ tStartIndex++;
+ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 57, -4));
+ }
+ tStartIndex++;
+
+
+ if (aRecipe.mSpecialItems != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52));
+ }
+ tStartIndex = 0;
+
+ //Four Output Slots
+ if (aRecipe.getOutput(tStartIndex) != null) {
+ this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex)));
+ }
+ tStartIndex++;
+ if (aRecipe.getOutput(tStartIndex) != null) {
+ this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex)));
+ }
+ tStartIndex++;
+ if (aRecipe.getOutput(tStartIndex) != null) {
+ this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex)));
+ }
+ tStartIndex++;
+ if (aRecipe.getOutput(tStartIndex) != null) {
+ this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex)));
+ }
+ tStartIndex++;
+
+
+ //New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for outputs an the code above for 9 input slots.)
+ if (aRecipe.mFluidInputs.length >= 1) {
+ if ((aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 3, 31));
+ }
+ if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 21, 31));
+ }
+ if ((aRecipe.mFluidInputs.length > 2) && (aRecipe.mFluidInputs[2] != null) && (aRecipe.mFluidInputs[2].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[2], true), 39, 31));
+ }
+ if ((aRecipe.mFluidInputs.length > 3) && (aRecipe.mFluidInputs[3] != null) && (aRecipe.mFluidInputs[3].getFluid() != null)) {
+ this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[3], true), 57, 31));
+ }
+ }
+
+ if (aRecipe.mFluidOutputs.length > 0) {
+ if ((aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) {
+ this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 138, 5));
+ }
+ if ((aRecipe.mFluidOutputs.length > 1) && (aRecipe.mFluidOutputs[1] != null) && (aRecipe.mFluidOutputs[1].getFluid() != null)) {
+ this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 23));
+ }
+ }
+ }
+
+ @Override
+ public List getIngredients() {
+ return this.getCycledIngredients(GT_NEI_FluidReactor.this.cycleticks / 10, this.mInputs);
+ }
+
+ @Override
+ public PositionedStack getResult() {
+ return null;
+ }
+
+ @Override
+ public List getOtherStacks() {
+ return this.mOutputs;
+ }
+ }
+}
diff --git a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java
index ab949bd517..ad03040059 100644
--- a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java
+++ b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java
@@ -18,10 +18,13 @@ implements IConfigureNEI {
}
}
for (final Gregtech_Recipe_Map tMap : gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map.sMappings) {
- if (tMap.mNEIAllowed) {
- new GT_NEI_MultiBlockHandler(tMap);
+ if (tMap.mNEIAllowed) {
+ if (!tMap.mUnlocalizedName.equals(Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mUnlocalizedName)) {
+ new GT_NEI_MultiBlockHandler(tMap);
+ }
}
}
+ new GT_NEI_FluidReactor(Gregtech_Recipe_Map.sFluidChemicalReactorRecipes);
sIsAdded = true;
API.registerRecipeHandler(new DecayableRecipeHandler());
API.registerUsageHandler(new DecayableRecipeHandler());
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java
index b6e4ce8881..a80ae58b65 100644
--- a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java
+++ b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java
@@ -1,24 +1,39 @@
package gtPlusPlus.plugin.agrichem;
+import static gtPlusPlus.core.lib.CORE.GTNH;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.util.GT_ModHandler;
-import gregtech.api.util.GT_ModHandler.RecipeBits;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.item.chemistry.AgriculturalChem;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.MISC_MATERIALS;
+import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.RecipeUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.plugin.agrichem.block.AgrichemFluids;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.railcraft.utils.RailcraftUtils;
+import ic2.core.Ic2Items;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.OreDictionary;
public class BioRecipes {
@@ -51,6 +66,8 @@ public class BioRecipes {
private static Fluid mBenzene;
private static Fluid mEthylbenzene;
private static Fluid mStyrene;
+ private static Fluid mButanol;
+ private static Fluid mAcetone;
private static final ItemStack getGreenAlgaeRecipeChip() {
@@ -67,17 +84,17 @@ public class BioRecipes {
}
private static final ItemStack getBioChip(int aID) {
- return ItemUtils.simpleMetaStack(Core_Agrichem.mBioCircuit, aID, 0);
+ return ItemUtils.simpleMetaStack(AgriculturalChem.mBioCircuit, aID, 0);
}
public static void init() {
- Core_Agrichem.mInstance.log("Setting Variables");
+ Logger.INFO("[Bio] Setting Variables");
initRecipeVars();
- Core_Agrichem.mInstance.log("Generating Biochip Recipes");
+ Logger.INFO("[Bio] Generating Biochip Recipes");
recipeBioChip();
- Core_Agrichem.mInstance.log("Generating Recipes");
+ Logger.INFO("[Bio] Generating Recipes");
recipeAlgaeBiomass();
- Core_Agrichem.mInstance.log("Finished with recipes");
+ Logger.INFO("[Bio] Finished with recipes");
}
private static final void initRecipeVars() {
@@ -101,7 +118,7 @@ public class BioRecipes {
mEthylbenzene = FluidUtils.getFluidStack("fluid.ethylbenzene", 1).getFluid();
mStyrene = FluidUtils.getFluidStack("styrene", 1).getFluid();
mMethanol = FluidUtils.getFluidStack("methanol", 1).getFluid();
- mLiquidPlastic = FluidUtils.getFluidStack("plastic", 1).getFluid();
+ mLiquidPlastic = FluidUtils.getWildcardFluidStack("plastic", 1).getFluid();
mCarbonDioxide = MISC_MATERIALS.CARBON_DIOXIDE.getFluid(1).getFluid();
mCarbonMonoxide = MISC_MATERIALS.CARBON_MONOXIDE.getFluid(1).getFluid();
mChlorine = FluidUtils.getFluidStack("chlorine", 1).getFluid();
@@ -110,10 +127,9 @@ public class BioRecipes {
mPropionicAcid = AgrichemFluids.mPropionicAcid;
mUrea = AgrichemFluids.mUrea;
mLiquidResin = AgrichemFluids.mLiquidResin;
- mFermentationBase = AgrichemFluids.mFermentationBase;
-
-
-
+ mFermentationBase = AgrichemFluids.mFermentationBase;
+ mButanol = AgrichemFluids.mButanol;
+ mAcetone = AgrichemFluids.mAcetone;
}
private static void recipeAlgaeBiomass() {
@@ -153,22 +169,32 @@ public class BioRecipes {
recipeMethane();
recipeBenzene();
recipeStyrene();
+
+ registerFuels();
}
+ private static void registerFuels() {
+ // Gas Fuels
+ //GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellCoalGas", 1), null, 96, 1);
+
+ //Combustion Fuels
+ GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 1), null, 250, 0);
+
+ }
private static void recipeGreenAlgae() {
// Compost
GT_ModHandler.addPulverisationRecipe(
- ItemUtils.getSimpleStack(Core_Agrichem.mGreenAlgaeBiosmass, 10),
- ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1));
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
// Turn into Cellulose
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
getGreenAlgaeRecipeChip(),
- ItemUtils.getSimpleStack(Core_Agrichem.mGreenAlgaeBiosmass, 30)
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 30)
},
GT_Values.NF,
- ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 5),
- 20 * 30,
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 5),
+ 30 * 30,
16);
@@ -177,23 +203,23 @@ public class BioRecipes {
private static void recipeBrownAlgae() {
// Compost
GT_ModHandler.addPulverisationRecipe(
- ItemUtils.getSimpleStack(Core_Agrichem.mBrownAlgaeBiosmass, 10),
- ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1));
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
// Alginic acid
GT_Values.RA.addExtractorRecipe(
- ItemUtils.getSimpleStack(Core_Agrichem.mBrownAlgaeBiosmass, 10),
- ItemUtils.getSimpleStack(Core_Agrichem.mAlginicAcid, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 1),
20 * 15,
30);
// Lithium Chloride
GT_Values.RA.addBlastRecipe(
getBrownAlgaeRecipeChip(),
- ItemUtils.getSimpleStack(Core_Agrichem.mBrownAlgaeBiosmass, 20),
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 20),
GT_Values.NF,
GT_Values.NF,
- ItemUtils.getSimpleStack(Core_Agrichem.mLithiumChloride, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mLithiumChloride, 1),
GT_Values.NI,
120,
120,
@@ -202,10 +228,10 @@ public class BioRecipes {
// Sodium Carbonate
CORE.RA.addChemicalRecipe(
getBrownAlgaeRecipeChip(),
- ItemUtils.getSimpleStack(Core_Agrichem.mBrownAlgaeBiosmass, 20),
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 20),
FluidUtils.getDistilledWater(2000),
GT_Values.NF,
- ItemUtils.getSimpleStack(Core_Agrichem.mSodiumCarbonate, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 1),
20 * 30,
30);
@@ -214,63 +240,63 @@ public class BioRecipes {
private static void recipeGoldenBrownAlgae() {
// Compost
GT_ModHandler.addPulverisationRecipe(
- ItemUtils.getSimpleStack(Core_Agrichem.mGoldenBrownAlgaeBiosmass, 10),
- ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1));
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
// Turn into Cellulose
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
getGoldenBrownAlgaeRecipeChip(),
- ItemUtils.getSimpleStack(Core_Agrichem.mGoldenBrownAlgaeBiosmass, 30)
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 30)
},
GT_Values.NF,
- ItemUtils.getSimpleStack(Core_Agrichem.mGoldenBrownCelluloseFiber, 5),
- 20 * 30,
- 64);
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 5),
+ 30 * 30,
+ 120);
}
private static void recipeRedAlgae() {
// Compost
GT_ModHandler.addPulverisationRecipe(
- ItemUtils.getSimpleStack(Core_Agrichem.mRedAlgaeBiosmass, 10),
- ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1));
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
// Turn into Cellulose
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
getRedAlgaeRecipeChip(),
- ItemUtils.getSimpleStack(Core_Agrichem.mRedAlgaeBiosmass, 30)
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 30)
},
GT_Values.NF,
- ItemUtils.getSimpleStack(Core_Agrichem.mRedCelluloseFiber, 5),
- 20 * 30,
- 256);
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 5),
+ 30 * 30,
+ 240);
}
private static void recipeCelluloseFibre() {
CORE.RA.addChemicalRecipe(
- ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 20),
- ItemUtils.getSimpleStack(Core_Agrichem.mAlginicAcid, 2),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 20),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 2),
GT_Values.NF,
GT_Values.NF,
- ItemUtils.getSimpleStack(Core_Agrichem.mCellulosePulp, 10),
- 30 * 20,
+ ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 10),
+ 45 * 20,
16);
// Craft into Wood Pellets
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
getBioChip(2),
- ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 12)
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 12)
},
GT_Values.NF,
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 2),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 2),
20 * 30,
30);
// Methanol Extraction
GT_Values.RA.addFluidExtractionRecipe(
- ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 12),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 12),
GT_Values.NI,
FluidUtils.getFluidStack(mMethanol, 50),
10000,
@@ -279,8 +305,8 @@ public class BioRecipes {
// Compost
GT_ModHandler.addPulverisationRecipe(
- ItemUtils.getSimpleStack(Core_Agrichem.mCelluloseFiber, 5),
- ItemUtils.getSimpleStack(Core_Agrichem.mCompost, 1));
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 5),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
}
@@ -288,30 +314,29 @@ public class BioRecipes {
private static void recipeWoodPellets() {
// Shapeless Recipe
RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1),
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1),
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1),
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1),
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1),
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1),
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1),
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1)
- }, ItemUtils.getSimpleStack(Core_Agrichem.mWoodBrick, 2));
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1)
+ }, ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 2));
// Assembly Recipe
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
getBioChip(2),
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 8)
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 8)
},
GT_Values.NF,
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodBrick, 2),
- 20,
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 2),
+ 20 * 5,
8);
// CO2
CORE.RA.addFluidExtractionRecipe(
- GT_Values.NI,
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 1),
FluidUtils.getFluidStack(mCarbonDioxide, 70),
10*20,
30);
@@ -320,7 +345,7 @@ public class BioRecipes {
// Add Charcoal Recipe
if (LoadedMods.Railcraft) {
RailcraftUtils.addCokeOvenRecipe(
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 2),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 2),
true,
true,
ItemUtils.getItemStackOfAmountFromOreDict("gemCharcoal", 3),
@@ -328,7 +353,7 @@ public class BioRecipes {
1200);
}
CORE.RA.addCokeOvenRecipe(
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodPellet, 1),
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodPellet, 2),
getBioChip(3),
null,
GT_Values.NF,
@@ -347,8 +372,8 @@ public class BioRecipes {
ItemUtils.getOrePrefixStack(OrePrefixes.dust, Materials.Wood, 50)
},
GT_Values.NF,
- ItemUtils.getSimpleStack(Core_Agrichem.mWoodBrick, 1),
- 100,
+ ItemUtils.getSimpleStack(AgriculturalChem.mWoodBrick, 1),
+ 100 * 20,
16);
}
@@ -357,64 +382,352 @@ public class BioRecipes {
// Assembly Recipe
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
getBioChip(2),
- ItemUtils.getSimpleStack(Core_Agrichem.mCellulosePulp, 4)
+ ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 4)
},
GT_Values.NF,
ItemUtils.getSimpleStack(Items.paper, 1),
- 50,
+ 60 * 20,
16);
}
private static void recipeCatalystCarrier() {
-
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getBioChip(20),
+ ItemUtils.getItemStackOfAmountFromOreDict("plateSteel", GTNH ? 8 : 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("wireFineCopper", GTNH ? 4 : 2),
+ ItemUtils.getItemStackOfAmountFromOreDict("screwTin", GTNH ? 6 : 3)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1),
+ 300 * 20,
+ 16);
}
private static void recipeAluminiumSilverCatalyst() {
-
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getBioChip(20),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 4)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 10),
+ 600 * 20,
+ 30);
}
private static void recipeAceticAcid() {
+ /* GT_Values.RA.addMixerRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 10),
+ var2,
+ var3, var4,
+ var5, // Fluid in
+ var6, // Fluid out
+ var7, // Item Out
+ var8, // Time
+ var9); // Eu
+ */
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mMethanol, 700),
+ FluidUtils.getFluidStack(BioRecipes.mCarbonMonoxide, 300),
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mAceticAcid, 250),
+ },
+ 120 * 20,
+ 60,
+ 1);
+
+ CORE.RA.addDehydratorRecipe(
+ CI.emptyCells(1),
+ FluidUtils.getFluidStack(mFermentationBase, 4000),
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellAceticAcid", 1)
+ },
+ 60 * 20,
+ 16);
+
+
}
private static void recipeFermentationBase() {
+ AutoMap aFruitVege = AgriculturalChem.mList_Master_FruitVege;
+ AutoMap aSeeds = AgriculturalChem.mList_Master_Seeds;
+ ArrayList aMap = OreDictionary.getOres("cropSugarbeet");
+ for (ItemStack a : aFruitVege) {
+ if (aMap.contains(a)) {
+ continue;
+ }
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(2),
+ ItemUtils.getSimpleStack(a, 10)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 200),
+ },
+ 60 * 20,
+ 30,
+ 1);
+ }
+ for (ItemStack a : aSeeds) {
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(3),
+ ItemUtils.getSimpleStack(a, 20)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 50),
+ },
+ 60 * 20,
+ 30,
+ 1);
+ }
+
+ // Sugar Cane
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(4),
+ ItemUtils.getSimpleStack(Items.reeds, 16)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 75),
+ },
+ 60 * 20,
+ 30,
+ 1);
+
+ // Sugar Beet
+ if (OreDictionary.doesOreNameExist("cropSugarbeet")) {
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(4),
+ ItemUtils.getItemStackOfAmountFromOreDict("cropSugarbeet", 8)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 75),
+ },
+ 60 * 20,
+ 30,
+ 1);
+ }
+
+ // Produce Acetone, Butanol and Ethanol
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(5),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellFermentationBase", 48),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 16),
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 16),
+ },
+ new FluidStack[] {
+
+ },
+ new ItemStack[] {
+ ItemUtils.getItemStackOfAmountFromOreDict("cellButanol", 6),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellAcetone", 3),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellEthanol", 1),
+ CI.emptyCells(38)
+ },
+ new FluidStack[] {
+
+ },
+ 900 * 20,
+ 240,
+ 2);
+
}
private static void recipePropionicAcid() {
-
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mEthylene, 500),
+ FluidUtils.getFluidStack(BioRecipes.mCarbonMonoxide, 500),
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mPropionicAcid, 250),
+ },
+ 20 * 20,
+ 60,
+ 1);
}
private static void recipeEthanol() {
+ GT_Values.RA.addDistilleryRecipe(
+ BioRecipes.getBioChip(2),
+ FluidUtils.getFluidStack(BioRecipes.mFermentationBase, 1000),
+ FluidUtils.getFluidStack(BioRecipes.mEthanol, 100),
+ null,
+ 20 * 20,
+ 60,
+ false);
+
}
private static void recipeGoldenBrownCelluloseFiber() {
-
+ CORE.RA.addFluidExtractionRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 20),
+ FluidUtils.getFluidStack(BioRecipes.mAmmonia, 50),
+ 20 * 30,
+ 120);
}
private static void recipeRedCelluloseFiber() {
-
+ GT_Values.RA.addExtractorRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 20),
+ ItemUtils.getSimpleStack(ModItems.dustCalciumCarbonate, 5),
+ 20 * 30,
+ 240);
}
private static void recipeSodiumHydroxide() {
-
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(4)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mSalineWater, 1000),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mChlorine, 400),
+ FluidUtils.getFluidStack(BioRecipes.mHydrogen, 600),
+ },
+ 300 * 20,
+ 120,
+ 2);
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(5),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustSodium", 5)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 5000),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 5)
+ },
+ new FluidStack[] {
+
+ },
+ 60 * 20,
+ 60,
+ 2);
}
private static void recipeSodiumCarbonate() {
+ if (OreDictionary.doesOreNameExist("fuelCoke")) {
+
+ GT_Values.RA.addBlastRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 4),
+ ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 4),
+ GT_Values.NF,
+ GT_Values.NF,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 24),
+ null,
+ 20 * 120,
+ 120,
+ 1600);
+
+ }
+
+ GT_Values.RA.addBlastRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlumina, 24),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCoal", 4),
+ GT_Values.NF,
+ GT_Values.NF,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 24),
+ null,
+ 20 * 120,
+ 120,
+ 1600);
+
}
private static void recipeAluminiumPellet() {
-
+ GT_Values.RA.addAutoclaveRecipe(
+ ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 3),
+ null,
+ ItemUtils.getSimpleStack(AgriculturalChem.mAluminiumPellet, 4),
+ 10000,
+ 120 * 20,
+ 16);
}
private static void recipeAlumina() {
-
+ GT_Values.RA.addBlastRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumAluminate, 24),
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumHydroxide, 3),
+ FluidUtils.getFluidStack(mCarbonDioxide, 6000),
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlumina, 24),
+ ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 2),
+ 20 * 120,
+ 120,
+ 1200);
}
private static void recipeAluminium() {
-
+ GT_Values.RA.addBlastRecipe(
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlumina, 24),
+ ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 4),
+ GT_Values.NF,
+ GT_Values.NF,
+ ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 24),
+ null,
+ 20 * 120,
+ 120,
+ 1600);
}
private static void recipeCalciumCarbonate() {
@@ -427,97 +740,389 @@ public class BioRecipes {
private static void recipeAlginicAcid() {
+ // Turn into Cellulose Pulp
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getBioChip(7),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 20),
+ ItemUtils.getSimpleStack(AgriculturalChem.mAlginicAcid, 5)
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 20),
+ 90 * 20,
+ 16);
}
private static void recipeSulfuricAcid() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(7),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 10),
+ ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 30)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mSulfuricAcid, 5),
+ },
+ 60 * 20,
+ 60,
+ 2);
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(7),
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 5),
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 30)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mSulfuricAcid, 15),
+ },
+ 60 * 20,
+ 60,
+ 2);
+
}
private static void recipeUrea() {
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(9),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mAmmonia, 600),
+ FluidUtils.getFluidStack(BioRecipes.mCarbonDioxide, 400),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mUrea, 400),
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 600),
+ },
+ 120 * 20,
+ 30,
+ 1);
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(9),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mUrea, 200),
+ FluidUtils.getFluidStack(BioRecipes.mFormaldehyde, 200),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 200)
+ },
+ 120 * 20,
+ 30,
+ 1);
}
private static void recipeRawBioResin() {
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(3),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 10),
+ ItemUtils.getSimpleStack(Blocks.dirt, 20)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 1000),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mRawBioResin, 1),
+ },
+ new FluidStack[] {
+
+ },
+ 60 * 20,
+ 30,
+ 1);
}
private static void recipeLiquidResin() {
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(3),
+ ItemUtils.getSimpleStack(AgriculturalChem.mRawBioResin, 1)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mEthanol, 200),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 50),
+ },
+ 60 * 20,
+ 30,
+ 1);
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(3),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 8)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mLiquidResin, 144),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(Ic2Items.resin, 1)
+ },
+ new FluidStack[] {
+
+ },
+ 120 * 20,
+ 30,
+ 1);
+
+
}
private static void recipeCompost() {
+ ItemStack aFert;
+ if (LoadedMods.Forestry) {
+ aFert = ItemUtils.getSimpleStack(AgriculturalChem.aFertForestry, 2);
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(11),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 16)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mUrea, 500),
+ },
+ new ItemStack[] {
+ aFert
+ },
+ new FluidStack[] {
+
+ },
+ 120 * 20,
+ 60,
+ 2);
+ }
+ aFert = ItemUtils.getSimpleStack(AgriculturalChem.aFertIC2, 2);
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(12),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 16)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mUrea, 500),
+ },
+ new ItemStack[] {
+ aFert
+ },
+ new FluidStack[] {
+
+ },
+ 120 * 20,
+ 60,
+ 2);
+
}
private static void recipeMethane() {
-
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(12),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 20)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mDistilledWater, 2000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mMethane, 10),
+ },
+ 20 * 20,
+ 30,
+ 1);
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(13),
+ ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 64),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 48),
+ ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 32)
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mMethane, 2000),
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mLiquidPlastic, (144/4)),
+ },
+ 120 * 20,
+ 240,
+ 2);
}
private static void recipeBenzene() {
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(19),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mMethane, 1000),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mBenzene, 500),
+ },
+ 8 * 20,
+ 120,
+ 2);
}
private static void recipeStyrene() {
-
+
+ CORE.RA.addFluidReactorRecipe(
+ new ItemStack[] {
+ getBioChip(20),
+ ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mEthylbenzene, 100),
+ },
+ new ItemStack[] {
+ ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1),
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack(BioRecipes.mStyrene, 25),
+ },
+ 16 * 20,
+ 480,
+ 3);
}
private static void recipeBioChip() {
- GT_ModHandler.addShapelessCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 0L, new Object[0]),
- RecipeBits.NOT_REMOVABLE, new Object[]{OrePrefixes.circuit.get(Materials.Primitive)});
-
-
- long bits = RecipeBits.BUFFERED | RecipeBits.NOT_REMOVABLE;
-
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 1L, new Object[0]), bits,
+ GT_ModHandler.addShapelessCraftingRecipe(
+ GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 0L), 0, new Object[]{OrePrefixes.circuit.get(Materials.Primitive)});
+
+ long bits = 0;
+
+
+
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 1L, new Object[0]), bits,
new Object[]{"d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 2L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 2L, new Object[0]), bits,
new Object[]{" d ", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 3L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 3L, new Object[0]), bits,
new Object[]{" d", " P ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 4L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 4L, new Object[0]), bits,
new Object[]{" ", " Pd", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 5L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 5L, new Object[0]), bits,
new Object[]{" ", " P ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 6L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 6L, new Object[0]), bits,
new Object[]{" ", " P ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 7L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 7L, new Object[0]), bits,
new Object[]{" ", " P ", "d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 8L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 8L, new Object[0]), bits,
new Object[]{" ", "dP ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 9L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 9L, new Object[0]), bits,
new Object[]{"P d", " ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 10L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 10L, new Object[0]), bits,
new Object[]{"P ", " d", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 11L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 11L, new Object[0]), bits,
new Object[]{"P ", " ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 12L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 12L, new Object[0]), bits,
new Object[]{"P ", " ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 13L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 13L, new Object[0]), bits,
new Object[]{" P", " ", " d", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 14L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 14L, new Object[0]), bits,
new Object[]{" P", " ", " d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 15L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 15L, new Object[0]), bits,
new Object[]{" P", " ", "d ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 16L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 16L, new Object[0]), bits,
new Object[]{" P", "d ", " ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 17L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 17L, new Object[0]), bits,
new Object[]{" ", " ", "d P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 18L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 18L, new Object[0]), bits,
new Object[]{" ", "d ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 19L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 19L, new Object[0]), bits,
new Object[]{"d ", " ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 20L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 20L, new Object[0]), bits,
new Object[]{" d ", " ", " P", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 21L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 21L, new Object[0]), bits,
new Object[]{"d ", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 22L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 22L, new Object[0]), bits,
new Object[]{" d ", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 23L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 23L, new Object[0]), bits,
new Object[]{" d", " ", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
- GT_ModHandler.addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 24L, new Object[0]), bits,
+ addCraftingRecipe(GregtechItemList.Circuit_BioRecipeSelector.getWithDamage(1L, 24L, new Object[0]), bits,
new Object[]{" ", " d", "P ", 'P', GregtechItemList.Circuit_BioRecipeSelector.getWildcard(1L, new Object[0])});
}
+ public static boolean addCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) {
+ Method mAddRecipe = ReflectionUtils.getMethod(GT_ModHandler.class, "addCraftingRecipe", new Class[] {
+ ItemStack.class, Enchantment[].class, int[].class,
+ boolean.class, boolean.class, boolean.class, boolean.class,
+ boolean.class, boolean.class, boolean.class, boolean.class,
+ boolean.class, boolean.class, boolean.class, boolean.class,
+ boolean.class, Object[].class});
+ boolean didInvoke = false;
+ if (mAddRecipe != null) {
+ try {
+ didInvoke = (boolean) mAddRecipe.invoke(null, aResult,
+ new Enchantment[] {},
+ new int[] {},
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ aRecipe);
+ }
+ catch (IllegalAccessException | IllegalArgumentException
+ | InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return didInvoke;
+
+
+ }
+
}
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java b/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java
index bb467699a7..4cf31e9335 100644
--- a/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java
+++ b/src/Java/gtPlusPlus/plugin/agrichem/Core_Agrichem.java
@@ -19,58 +19,6 @@ public class Core_Agrichem implements IPlugin {
final static Core_Agrichem mInstance;
- public static Item mAlgae;
- public static Item mBioCircuit;
- public static Item mAgrichemItem1;
-
- /*
- * 0 - Algae Biomass
- * 1 - Green Algae Biomass
- * 2 - Brown Algae Biomass
- * 3 - Golden-Brown Algae Biomass
- * 4 - Red Algae Biomass
- * 5 - Cellulose Fiber
- * 6 - Golden-Brown Cellulose Fiber
- * 7 - Red Cellulose Fiber
- * 8 - Compost
- * 9 - Wood Pellet
- * 10 - Wood Brick
- * 11 - Cellulose Pulp
- * 12 - Raw Bio Resin
- * 13 - Catalyst Carrier
- * 14 - Green Metal Catalyst
- * 15 - Alginic Acid
- * 16 - Alumina
- * 17 - Aluminium Pellet
- * 18 - Sodium Aluminate
- * 19 - Sodium Hydroxide // Exists in Newer GT
- * 20 - Sodium Carbonate
- * 21 - Lithium Chloride
- */
-
- public static ItemStack mAlgaeBiosmass;
- public static ItemStack mGreenAlgaeBiosmass;
- public static ItemStack mBrownAlgaeBiosmass;
- public static ItemStack mGoldenBrownAlgaeBiosmass;
- public static ItemStack mRedAlgaeBiosmass;
- public static ItemStack mCelluloseFiber;
- public static ItemStack mGoldenBrownCelluloseFiber;
- public static ItemStack mRedCelluloseFiber;
- public static ItemStack mCompost;
- public static ItemStack mWoodPellet;
- public static ItemStack mWoodBrick;
- public static ItemStack mCellulosePulp;
- public static ItemStack mRawBioResin;
- public static ItemStack mCatalystCarrier;
- public static ItemStack mGreenCatalyst;
- public static ItemStack mAlginicAcid;
- public static ItemStack mAlumina;
- public static ItemStack mAluminiumPellet;
- public static ItemStack mSodiumAluminate;
- public static ItemStack mSodiumHydroxide;
- public static ItemStack mSodiumCarbonate;
- public static ItemStack mLithiumChloride;
-
static {
mInstance = new Core_Agrichem();
@@ -84,98 +32,18 @@ public class Core_Agrichem implements IPlugin {
FluidLoader.generate();
AgrichemFluids.init();
mInstance.log("Generating Items");
- mAlgae = new ItemAlgaeBase();
- mAgrichemItem1 = new ItemAgrichemBase();
- mBioCircuit = new ItemBioChip();
- mInstance.log("Setting Bio Circuit");
- GregtechItemList.Circuit_BioRecipeSelector.set(mBioCircuit);
return true;
}
@Override
public boolean init() {
- mInstance.log("Setting Items");
- mAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 0, 1);
- mGreenAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 1, 1);
- mBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 2, 1);
- mGoldenBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 3, 1);
- mRedAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 4, 1);
- mCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 5, 1);
- mGoldenBrownCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 6, 1);
- mRedCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 7, 1);
- mCompost = ItemUtils.simpleMetaStack(mAgrichemItem1, 8, 1);
- mWoodPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 9, 1);
- mWoodBrick = ItemUtils.simpleMetaStack(mAgrichemItem1, 10, 1);
- mCellulosePulp = ItemUtils.simpleMetaStack(mAgrichemItem1, 11, 1);
- mRawBioResin = ItemUtils.simpleMetaStack(mAgrichemItem1, 12, 1);
- mCatalystCarrier = ItemUtils.simpleMetaStack(mAgrichemItem1, 13, 1);
- mGreenCatalyst = ItemUtils.simpleMetaStack(mAgrichemItem1, 14, 1);
- mAlginicAcid = ItemUtils.simpleMetaStack(mAgrichemItem1, 15, 1);
- mAlumina = ItemUtils.simpleMetaStack(mAgrichemItem1, 16, 1);
- mAluminiumPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 17, 1);
- mSodiumAluminate = ItemUtils.simpleMetaStack(mAgrichemItem1, 18, 1);
-
- /**
- * If It exists, don't add a new one.
- */
- if (OreDictionary.doesOreNameExist("dustSodiumHydroxide_GT5U") || OreDictionary.doesOreNameExist("dustSodiumHydroxide")) {
- List aTest = OreDictionary.getOres("dustSodiumHydroxide", false);
- ItemStack aTestStack;
- if (aTest.isEmpty()) {
- aTest = OreDictionary.getOres("dustSodiumHydroxide_GT5U", false);
- if (aTest.isEmpty()) {
- aTestStack = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1);
- }
- else {
- aTestStack = aTest.get(0);
- }
- }
- else {
- aTestStack = aTest.get(0);
- }
- mSodiumHydroxide = aTestStack;
- }
- else {
- mSodiumHydroxide = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1);
- }
- mSodiumCarbonate = ItemUtils.simpleMetaStack(mAgrichemItem1, 20, 1);
- mLithiumChloride = ItemUtils.simpleMetaStack(mAgrichemItem1, 21, 1);
-
- mInstance.log("OreDicting Items");
- ItemUtils.addItemToOreDictionary(mGreenAlgaeBiosmass, "biomassGreenAlgae");
- ItemUtils.addItemToOreDictionary(mBrownAlgaeBiosmass, "biomassBrownAlgae");
- ItemUtils.addItemToOreDictionary(mGoldenBrownAlgaeBiosmass, "biomassGoldenBrownAlgae");
- ItemUtils.addItemToOreDictionary(mRedAlgaeBiosmass, "biomassRedAlgae");
-
- ItemUtils.addItemToOreDictionary(mCelluloseFiber, "fiberCellulose");
- ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberCellulose");
- ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberGoldenBrownCellulose");
- ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberCellulose");
- ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberRedCellulose");
-
- ItemUtils.addItemToOreDictionary(mWoodPellet, "pelletWood");
- ItemUtils.addItemToOreDictionary(mWoodBrick, "brickWood");
- ItemUtils.addItemToOreDictionary(mCellulosePulp, "pulpCellulose");
-
- ItemUtils.addItemToOreDictionary(mCatalystCarrier, "catalystEmpty");
- ItemUtils.addItemToOreDictionary(mGreenCatalyst, "catalystAluminiumSilver");
- ItemUtils.addItemToOreDictionary(mAlginicAcid, "dustAlginicAcid");
- ItemUtils.addItemToOreDictionary(mAlumina, "dustAlumina");
- ItemUtils.addItemToOreDictionary(mAluminiumPellet, "pelletAluminium");
-
- ItemUtils.addItemToOreDictionary(mSodiumAluminate, "dustSodiumAluminate");
- if (mSodiumHydroxide.getItem() instanceof ItemAgrichemBase) {
- ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide");
- }
- ItemUtils.addItemToOreDictionary(mSodiumCarbonate, "dustSodiumCarbonate");
- ItemUtils.addItemToOreDictionary(mLithiumChloride, "dustLithiumChloride");
+ mInstance.log("Setting Items");
return true;
}
@Override
public boolean postInit() {
mInstance.log("Generating Recipes");
- BioRecipes.init();
return true;
}
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java b/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java
index 1f686cf810..099645131a 100644
--- a/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java
+++ b/src/Java/gtPlusPlus/plugin/agrichem/block/AgrichemFluids.java
@@ -32,6 +32,9 @@ public class AgrichemFluids {
public static Fluid mFermentationBase;
public static Fluid mUrea;
public static Fluid mLiquidResin;
+ public static Fluid mAcetone;
+ public static Fluid mButanol;
+
public static void init() {
@@ -65,6 +68,19 @@ public class AgrichemFluids {
else {
mLiquidResin = FluidRegistry.getFluid("liquidresin");
}
+
+ if (!FluidRegistry.isFluidRegistered("acetone")) {
+ mAcetone = FluidUtils.generateFluidNoPrefix("acetone", "Acetone", 200, new short[] { 59, 58, 56, 100 }, true);
+ }
+ else {
+ mAcetone = FluidRegistry.getFluid("acetone");
+ }
+ if (!FluidRegistry.isFluidRegistered("butanol")) {
+ mButanol = FluidUtils.generateFluidNoPrefix("butanol", "Butanol", 200, new short[] { 159, 58, 56, 100 }, true);
+ }
+ else {
+ mButanol = FluidRegistry.getFluid("butanol");
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
index 7d45899911..49b8da0d1b 100644
--- a/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/custom/GTPP_Bees.java
@@ -109,7 +109,6 @@ public class GTPP_Bees {
private void addExtractorRecipe(ItemStack input, FluidStack output){
CORE.RA.addFluidExtractionRecipe(
input,
- null,
output,
30,
8);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
index 7a83392c07..588c04d7e5 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -478,6 +478,10 @@ public enum GregtechItemList implements GregtechItemContainer {
Machine_ZPM_Component_Maker,
Machine_UV_Component_Maker,
+ // Fluid Reactor
+ FluidReactor_LV, FluidReactor_HV,
+ FluidReactor_IV, FluidReactor_ZPM,
+
//Breakers
BreakerBox_ULV, BreakerBox_LV, BreakerBox_MV,
BreakerBox_HV, BreakerBox_EV, BreakerBox_IV,
@@ -601,7 +605,7 @@ public enum GregtechItemList implements GregtechItemContainer {
FakeMachineCasingPlate_MV, FakeMachineCasingPlate_HV,
FakeMachineCasingPlate_EV, FakeMachineCasingPlate_IV,
FakeMachineCasingPlate_LuV, FakeMachineCasingPlate_ZPM,
- FakeMachineCasingPlate_UV, FakeMachineCasingPlate_MAX,
+ FakeMachineCasingPlate_UV, FakeMachineCasingPlate_MAX,
//----------------------------------------------------------------------------
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java
new file mode 100644
index 0000000000..0c64644166
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java
@@ -0,0 +1,182 @@
+package gtPlusPlus.xmod.gregtech.api.gui.fluidreactor;
+
+import java.util.Iterator;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.gui.GT_Container_BasicMachine;
+import gregtech.api.gui.GT_Slot_Render;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.slots.SlotChemicalPlantInput;
+import gtPlusPlus.core.slots.SlotNoInput;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_ChemicalReactor;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+import net.minecraft.item.ItemStack;
+
+public class Container_FluidReactor extends GT_Container_BasicMachine {
+
+ public boolean mFluidTransfer_1 = false;
+ public boolean mFluidTransfer_2 = false;
+ public boolean oFluidTransfer_1 = false;
+ public boolean oFluidTransfer_2 = false;
+
+ public Container_FluidReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+
+ // Gui Buttons
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 0, 8, 63)); // Fluid 1
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 1, 44, 63));
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, 2, 26, 63)); // Fluid 2
+
+ int tStartIndex = 3;
+ // Input Slots
+ this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 8, 7));
+ this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 26, 7));
+ this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 44, 7));
+ this.addSlotToContainer(new SlotChemicalPlantInput(this.mTileEntity, tStartIndex++, 62, 7));
+
+ // Output Slots
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 107, 16));
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 125, 16));
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 107, 34));
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 125, 34));
+
+ // Cell Collector Slot
+ this.addSlotToContainer(new SlotNoInput(this.mTileEntity, tStartIndex++, 116, 63));
+
+
+ // Inputs Fluids
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 8, 42));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 26, 42));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 44, 42));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 62, 42));
+
+ // Output Fluids
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 143, 16));
+ this.addSlotToContainer(new GT_Slot_Render(this.mTileEntity, tStartIndex++, 143, 34));
+
+
+
+
+ }
+
+ public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
+ if (aSlotIndex == 0 || aSlotIndex == 2) {
+ if (this.mTileEntity != null && this.mTileEntity.isServerSide()) {
+ try {
+ final IMetaTileEntity aMetaTileEntity = this.mTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return null;
+ }
+ if (aMetaTileEntity instanceof GregtechMetaTileEntity_ChemicalReactor) {
+ //Set Tile
+ if (aSlotIndex == 0) {
+ ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_1 = !((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_1;
+ }
+ else if (aSlotIndex == 2) {
+ ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_2 = !((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_2;
+ }
+ return null;
+ }
+ }
+ catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+ if (this.mTileEntity != null && this.mTileEntity.isServerSide()) {
+ try {
+ Iterator var2 = this.crafters.iterator();
+ final IMetaTileEntity aMetaTileEntity = this.mTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ Logger.INFO("bad");
+ return;
+ }
+ if (aMetaTileEntity instanceof GregtechMetaTileEntity_ChemicalReactor) {
+ //Read from Tile
+ this.mFluidTransfer_1 = ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_1;
+ this.mFluidTransfer_2 = ((GregtechMetaTileEntity_ChemicalReactor)aMetaTileEntity).mFluidTransfer_2;
+ int mTimer;
+ mTimer = (int) ReflectionUtils.getField(this.getClass(), "mTimer").get(this);
+ while (true) {
+ ICrafting var1;
+ do {
+ if (!var2.hasNext()) {
+ this.oFluidTransfer_1 = this.mFluidTransfer_1;
+ this.oFluidTransfer_2 = this.mFluidTransfer_2;
+ return;
+ }
+ var1 = (ICrafting) var2.next();
+ if (mTimer % 500 == 10 || this.oFluidTransfer_1 != this.mFluidTransfer_1) {
+ var1.sendProgressBarUpdate(this, -50, this.mFluidTransfer_1 ? 1 : 0);
+ }
+ if (mTimer % 500 == 10 || this.oFluidTransfer_2 != this.mFluidTransfer_2) {
+ var1.sendProgressBarUpdate(this, -51, this.mFluidTransfer_2 ? 1 : 0);
+ }
+ } while (mTimer % 500 != 10);
+ }
+ }
+ else {
+ Logger.INFO("bad cast");
+ }
+ }
+ catch (IllegalArgumentException | IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
+
+ }
+
+ public void addCraftingToCrafters(ICrafting par1ICrafting) {
+ super.addCraftingToCrafters(par1ICrafting);
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void updateProgressBar(int par1, int par2) {
+ if (par1 > 0) {
+ super.updateProgressBar(par1, par2);
+ }
+ else {
+ switch (par1) {
+ case -50 :
+ this.mFluidTransfer_1 = par2 != 0;
+ break;
+ case -51 :
+ this.mFluidTransfer_2 = par2 != 0;
+ break;
+ default :
+ break;
+ }
+ }
+ }
+
+ public int getSlotStartIndex() {
+ return 3;
+ }
+
+ public int getShiftClickStartIndex() {
+ return 3;
+ }
+
+ public int getSlotCount() {
+ return this.getShiftClickSlotCount() + 5 + 2;
+ }
+
+ public int getShiftClickSlotCount() {
+ return 4;
+ }
+}
\ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java
new file mode 100644
index 0000000000..1be79b40cc
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java
@@ -0,0 +1,122 @@
+package gtPlusPlus.xmod.gregtech.api.gui.fluidreactor;
+
+import gregtech.api.gui.GT_Container_BasicMachine;
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.core.lib.CORE;
+
+import java.util.ArrayList;
+import java.util.List;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GUI_FluidReactor extends GT_GUIContainerMetaTile_Machine {
+ public final String mName;
+ public final String mNEI;
+ public final byte mProgressBarDirection;
+ public final byte mProgressBarAmount;
+
+ public GUI_FluidReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName,
+ String aTextureFile, String aNEI) {
+ this(aInventoryPlayer, aTileEntity, aName, aTextureFile, aNEI, (byte) 0, (byte) 1);
+ }
+
+ public GUI_FluidReactor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName,
+ String aTextureFile, String aNEI, byte aProgressBarDirection, byte aProgressBarAmount) {
+ super(new Container_FluidReactor(aInventoryPlayer, aTileEntity), CORE.MODID+":textures/gui/FluidReactor.png");
+ this.mProgressBarDirection = aProgressBarDirection;
+ this.mProgressBarAmount = (byte) Math.max(1, aProgressBarAmount);
+ this.mName = aName;
+ this.mNEI = aNEI;
+ }
+
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ this.fontRendererObj.drawString(this.mName, 82, 5, 4210752);
+ this.drawTooltip(par1, par2);
+ }
+
+ private void drawTooltip(int x2, int y2) {
+ int xStart = (this.width - this.xSize) / 2;
+ int yStart = (this.height - this.ySize) / 2;
+ int x = x2 - xStart;
+ int y = y2 - yStart + 5;
+ List list = new ArrayList();
+ if (y >= 67 && y <= 84) {
+ if (x >= 7 && x <= 24) {
+ list.add("Fluid 1 Auto-Output");
+ }
+ if (x >= 25 && x <= 42) {
+ list.add("Fluid 2 Auto-Output");
+ }
+ if (x >= 43 && x <= 61) {
+ list.add("Item Auto-Output");
+ }
+ }
+
+ if (!list.isEmpty()) {
+ this.drawHoveringText(list, x, y, this.fontRendererObj);
+ }
+
+ }
+
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (this.width - this.xSize) / 2;
+ int y = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
+ if (this.mContainer != null) {
+ if (((Container_FluidReactor) this.mContainer).mFluidTransfer_1) {
+ this.drawTexturedModalRect(x + 7, y + 62, 176, 18, 18, 18);
+ }
+ if (((Container_FluidReactor) this.mContainer).mFluidTransfer_2) {
+ this.drawTexturedModalRect(x + 25, y + 62, 194, 18, 18, 18);
+ }
+ if (((GT_Container_BasicMachine) this.mContainer).mItemTransfer) {
+ this.drawTexturedModalRect(x + 43, y + 62, 176, 36, 18, 18);
+ }
+
+ if (((GT_Container_BasicMachine) this.mContainer).mStuttering) {
+ this.drawTexturedModalRect(x + 79, y + 44, 176, 54, 18, 18);
+ }
+
+ if (this.mContainer.mMaxProgressTime > 0) {
+ int tSize = this.mProgressBarDirection < 2 ? 20 : 18;
+ int tProgress = Math
+ .max(1, Math
+ .min(tSize * this.mProgressBarAmount,
+ (this.mContainer.mProgressTime > 0 ? 1 : 0) + this.mContainer.mProgressTime
+ * tSize * this.mProgressBarAmount / this.mContainer.mMaxProgressTime))
+ % (tSize + 1);
+ switch (this.mProgressBarDirection) {
+ case 0 :
+ this.drawTexturedModalRect(x + 82, y + 24, 176, 0, tProgress, 18);
+ break;
+ case 1 :
+ this.drawTexturedModalRect(x + 82 + 20 - tProgress, y + 24, 196 - tProgress, 0, tProgress, 18);
+ break;
+ case 2 :
+ this.drawTexturedModalRect(x + 82, y + 24, 176, 0, 20, tProgress);
+ break;
+ case 3 :
+ this.drawTexturedModalRect(x + 82, y + 24 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress);
+ break;
+ case 4 :
+ tProgress = 20 - tProgress;
+ this.drawTexturedModalRect(x + 82, y + 24, 176, 0, tProgress, 18);
+ break;
+ case 5 :
+ tProgress = 20 - tProgress;
+ this.drawTexturedModalRect(x + 82 + 20 - tProgress, y + 24, 196 - tProgress, 0, tProgress, 18);
+ break;
+ case 6 :
+ tProgress = 18 - tProgress;
+ this.drawTexturedModalRect(x + 82, y + 24, 176, 0, 20, tProgress);
+ break;
+ case 7 :
+ tProgress = 18 - tProgress;
+ this.drawTexturedModalRect(x + 82, y + 24 + 18 - tProgress, 176, 18 - tProgress, 20, tProgress);
+ }
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
index 2726b140ca..ceb2685b7f 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
@@ -216,6 +216,8 @@ public interface IGregtech_RecipeAdder {
public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aDust, ItemStack aOutput);
+ public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu);
+
public boolean addFluidExtractionRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidOut, int aTime, int aEu);
public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn);
@@ -269,4 +271,9 @@ public interface IGregtech_RecipeAdder {
public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu);
public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu);
+ public boolean addFluidReactorRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aTier);
+
+ public boolean addBlastRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aHeat);
+
+
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
index 09f3f2d1f5..6cac1fddea 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java
@@ -350,8 +350,13 @@ public class TexturesGtBlock {
private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced_Active = new CustomIcon("iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED_ACTIVE");
public static final CustomIcon Overlay_Machine_Controller_Advanced_Active = Internal_Overlay_Machine_Controller_Advanced_Active;
-
-
+ //Fluid Reactor Overlays
+ public static final CustomIcon Overlay_FluidReactor_Front = new CustomIcon("TileEntities/FluidReactor/OVERLAY_FRONT");
+ public static final CustomIcon Overlay_FluidReactor_Side = new CustomIcon("TileEntities/FluidReactor/OVERLAY_SIDE");
+ public static final CustomIcon Overlay_FluidReactor_Top = new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP");
+ public static final CustomIcon Overlay_FluidReactor_Front_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE");
+ public static final CustomIcon Overlay_FluidReactor_Side_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE");
+ public static final CustomIcon Overlay_FluidReactor_Top_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE");
//Crafting Overlays
private static final CustomIcon Internal_Overlay_Crafting_Bronze = new CustomIcon("TileEntities/bronze_top_crafting");
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java
new file mode 100644
index 0000000000..288b48ebb5
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java
@@ -0,0 +1,706 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
+
+import static gregtech.api.enums.GT_Values.E;
+
+import java.util.HashSet;
+import java.util.List;
+
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.objects.XSTR;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+import gregtech.api.util.Recipe_GT;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.slots.SlotChemicalPlantInput;
+import gtPlusPlus.xmod.gregtech.api.gui.fluidreactor.Container_FluidReactor;
+import gtPlusPlus.xmod.gregtech.api.gui.fluidreactor.GUI_FluidReactor;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+import net.minecraftforge.fluids.IFluidHandler;
+
+public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_BasicMachine {
+
+ public boolean mFluidTransfer_1 = false;
+ public boolean mFluidTransfer_2 = false;
+
+ public FluidStack[] mInputFluids = new FluidStack[4];
+ public FluidStack[] mOutputFluids = new FluidStack[2];
+
+ private static final GT_Recipe_Map mFluidChemicalReactorRecipes = new GT_Recipe_Map(
+ new HashSet(100),
+ "gt.recipe.fluidchemicaleactor",
+ "Chemical Plant",
+ null,
+ CORE.MODID+":textures/gui/FluidReactor",
+ 0,
+ 0,
+ 0,
+ 2,
+ 1,
+ "Tier: ",
+ 1,
+ E,
+ true,
+ false);
+
+ public GregtechMetaTileEntity_ChemicalReactor(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 1,
+ "For mixing fluids", 4, 4, "ChemicalReactor.png", "",
+ new ITexture[]{
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Side_Active),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Side),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Front_Active),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Front),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top_Active),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top_Active),
+ new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top)
+ }
+ );
+ }
+
+ public GregtechMetaTileEntity_ChemicalReactor(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }
+
+ /*public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName);
+ }*/
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{this.mDescription, "Because why not?", };
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ try {
+ GregtechMetaTileEntity_ChemicalReactor y = new GregtechMetaTileEntity_ChemicalReactor(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName);
+ return y;
+ }
+ catch(Throwable t) {
+ t.printStackTrace();
+ }
+ return null;
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ try {
+ Container_FluidReactor y = new Container_FluidReactor(aPlayerInventory, aBaseMetaTileEntity);
+ return y;
+ }
+ catch(Throwable t) {
+ t.printStackTrace();
+ }
+ return null;
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_FluidReactor(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(),
+ this.mGUIName,
+ GT_Utility.isStringValid(this.mNEIName)
+ ? this.mNEIName
+ : (this.getRecipeList() != null ? this.getRecipeList().mUnlocalizedName : ""));
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeList() {
+ if (mFluidChemicalReactorRecipes.mRecipeList.isEmpty()) {
+ for (Recipe_GT i :Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList) {
+ mFluidChemicalReactorRecipes.add(i);
+ }
+ }
+ return mFluidChemicalReactorRecipes;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack));
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return (super.isFluidInputAllowed(aFluid));
+ }
+
+ @Override
+ public int getCapacity() {
+ return 8000 * Math.max(1, this.mTier);
+ }
+
+ @Override
+ public int getInputSlot() {
+ return 3;
+ }
+
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ return aSide > 1;
+ }
+
+ @Override
+ public boolean isLiquidOutput(byte aSide) {
+ return aSide < 2;
+ }
+
+ @Override
+ public int getOutputSlot() {
+ return super.getOutputSlot();
+ }
+
+ @Override
+ public int getStackDisplaySlot() {
+ return super.getStackDisplaySlot();
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return true;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return super.canTankBeFilled();
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return super.canTankBeEmptied();
+ }
+
+ @Override
+ public FluidStack getDisplayedFluid() {
+ return super.getDisplayedFluid();
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("mFluidTransfer_1", mFluidTransfer_1);
+ aNBT.setBoolean("mFluidTransfer_2", mFluidTransfer_2);
+ for (int i=0;i<4;i++) {
+ if (this.mInputFluids[i] != null) {
+ aNBT.setTag("mInputFluid"+i, this.mInputFluids[i].writeToNBT(new NBTTagCompound()));
+ }
+ }
+ for (int i=0;i<2;i++) {
+ if (this.mOutputFluids[i] != null) {
+ aNBT.setTag("mOutputFluid"+i, this.mOutputFluids[i].writeToNBT(new NBTTagCompound()));
+ }
+ }
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mFluidTransfer_1 = aNBT.getBoolean("mFluidTransfer_1");
+ mFluidTransfer_2 = aNBT.getBoolean("mFluidTransfer_2");
+ for (int i=0;i<4;i++) {
+ if (this.mInputFluids[i] == null) {
+ this.mInputFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mInputFluid"+i));
+ }
+ }
+ for (int i=0;i<2;i++) {
+ if (this.mOutputFluids[i] == null) {
+ this.mOutputFluids[i] = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mOutputFluid"+i));
+ }
+ }
+ }
+
+ /*
+ * Custom Fluid Handling - TODO
+ */
+
+ public FluidStack getFillableStack() {
+ return this.mFluid;
+ }
+
+ public FluidStack setFillableStack(FluidStack aFluid) {
+ this.mFluid = aFluid;
+ return this.mFluid;
+ }
+
+ public FluidStack getDrainableStack() {
+ return this.mFluid;
+ }
+
+ public FluidStack setDrainableStack(FluidStack aFluid) {
+ this.mFluid = aFluid;
+ return this.mFluid;
+ }
+
+
+
+
+
+
+
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+
+ // Re-implement basic machine logic from the ground up.
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L;
+ this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L;
+ this.doDisplayThings();
+ boolean tSucceeded = false;
+ int i;
+ if (this.mMaxProgresstime > 0 && (this.mProgresstime >= 0 || aBaseMetaTileEntity.isAllowedToWork())) {
+ aBaseMetaTileEntity.setActive(true);
+ if (this.mProgresstime >= 0 && !this.drainEnergyForProcess((long) this.mEUt)) {
+ if (!this.mStuttering) {
+ this.stutterProcess();
+ if (this.canHaveInsufficientEnergy()) {
+ this.mProgresstime = -100;
+ }
+
+ this.mStuttering = true;
+ }
+ } else {
+ if (++this.mProgresstime >= this.mMaxProgresstime) {
+ for (i = 0; i < this.mOutputItems.length; ++i) {
+ for (i = 0; i < this.mOutputItems.length && !aBaseMetaTileEntity.addStackToSlot(
+ this.getOutputSlot() + (i + i) % this.mOutputItems.length,
+ this.mOutputItems[i]); ++i) {
+ ;
+ }
+ }
+
+ if (this.mOutputFluid != null) {
+ if (this.getDrainableStack() == null) {
+ this.setDrainableStack(this.mOutputFluid.copy());
+ } else if (this.mOutputFluid.isFluidEqual(this.getDrainableStack())) {
+ FluidStack var10000 = this.getDrainableStack();
+ var10000.amount += this.mOutputFluid.amount;
+ }
+ }
+
+ for (i = 0; i < this.mOutputItems.length; ++i) {
+ this.mOutputItems[i] = null;
+ }
+
+ this.mOutputFluid = null;
+ this.mEUt = 0;
+ this.mProgresstime = 0;
+ this.mMaxProgresstime = 0;
+ this.mStuttering = false;
+ tSucceeded = true;
+ this.endProcess();
+ }
+
+ if (this.mProgresstime > 5) {
+ this.mStuttering = false;
+ }
+
+ XSTR aXSTR = new XSTR();
+ if (GT_Mod.gregtechproxy.mAprilFool && aXSTR.nextInt(5000) == 0) {
+ GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(),
+ (String) GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(),
+ aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord());
+ }
+ }
+ } else {
+ aBaseMetaTileEntity.setActive(false);
+ }
+
+ boolean tRemovedOutputFluid = false;
+ if (this.doesAutoOutputFluids() && this.getDrainableStack() != null
+ && aBaseMetaTileEntity.getFrontFacing() != this.mMainFacing && (tSucceeded || aTick % 20L == 0L)) {
+ IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing());
+ if (tTank != null) {
+ FluidStack tDrained = this.drain(1000, false);
+ if (tDrained != null) {
+ int tFilledAmount = tTank.fill(
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false);
+ if (tFilledAmount > 0) {
+ tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
+ this.drain(tFilledAmount, true), true);
+ }
+ }
+ }
+
+ if (this.getDrainableStack() == null) {
+ tRemovedOutputFluid = true;
+ }
+ }
+
+ int j;
+ if (this.doesAutoOutput() && !this.isOutputEmpty()
+ && aBaseMetaTileEntity.getFrontFacing() != this.mMainFacing
+ && (tSucceeded || this.mOutputBlocked % 300 == 1 || aBaseMetaTileEntity.hasInventoryBeenModified()
+ || aTick % 600L == 0L)) {
+ TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing());
+ j = 0;
+
+ for (byte tCosts = 1; j < this.mOutputItems.length && tCosts > 0
+ && aBaseMetaTileEntity.isUniversalEnergyStored(128L); ++j) {
+ tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2,
+ aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), (List) null,
+ false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
+ if (tCosts > 0) {
+ aBaseMetaTileEntity.decreaseStoredEnergyUnits((long) tCosts, true);
+ }
+ }
+ }
+
+ if (this.mOutputBlocked != 0) {
+ if (this.isOutputEmpty()) {
+ this.mOutputBlocked = 0;
+ } else {
+ ++this.mOutputBlocked;
+ }
+ }
+
+ if (this.allowToCheckRecipe()) {
+ if (this.mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork()
+ && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified()
+ || aTick % 600L == 0L || aBaseMetaTileEntity.hasWorkJustBeenEnabled())
+ && this.hasEnoughEnergyToCheckRecipe()) {
+ if (this.checkRecipe() == 2) {
+ if (this.mInventory[3] != null && this.mInventory[3].stackSize <= 0) {
+ this.mInventory[3] = null;
+ }
+
+ i = this.getInputSlot();
+
+ for (j = i + this.mInputSlotCount; i < j; ++i) {
+ if (this.mInventory[i] != null && this.mInventory[i].stackSize <= 0) {
+ this.mInventory[i] = null;
+ }
+ }
+
+ for (i = 0; i < this.mOutputItems.length; ++i) {
+ this.mOutputItems[i] = GT_Utility.copy(new Object[]{this.mOutputItems[i]});
+ if (this.mOutputItems[i] != null && this.mOutputItems[i].stackSize > 64) {
+ this.mOutputItems[i].stackSize = 64;
+ }
+
+ this.mOutputItems[i] = GT_OreDictUnificator.get(true, this.mOutputItems[i]);
+ }
+
+ if (this.mFluid != null && this.mFluid.amount <= 0) {
+ this.mFluid = null;
+ }
+
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ if (GT_Utility.isDebugItem(this.mInventory[this.dechargerSlotStartIndex()])) {
+ this.mEUt = this.mMaxProgresstime = 1;
+ }
+
+ this.startProcess();
+ } else {
+ this.mMaxProgresstime = 0;
+
+ for (i = 0; i < this.mOutputItems.length; ++i) {
+ this.mOutputItems[i] = null;
+ }
+
+ this.mOutputFluid = null;
+ }
+ }
+ } else if (!this.mStuttering) {
+ this.stutterProcess();
+ this.mStuttering = true;
+ }
+ }
+
+
+
+ }
+
+ @Override
+ protected void doDisplayThings() {
+ // TODO Auto-generated method stub
+ super.doDisplayThings();
+ }
+
+ @Override
+ protected ItemStack getSpecialSlot() {
+ // TODO Auto-generated method stub
+ return super.getSpecialSlot();
+ }
+
+ @Override
+ protected ItemStack getOutputAt(int aIndex) {
+ // TODO Auto-generated method stub
+ return super.getOutputAt(aIndex);
+ }
+
+ @Override
+ protected ItemStack[] getAllOutputs() {
+ // TODO Auto-generated method stub
+ return super.getAllOutputs();
+ }
+
+ @Override
+ protected ItemStack getInputAt(int aIndex) {
+ // TODO Auto-generated method stub
+ return super.getInputAt(aIndex);
+ }
+
+ @Override
+ protected ItemStack[] getAllInputs() {
+ // TODO Auto-generated method stub
+ return super.getAllInputs();
+ }
+
+ @Override
+ protected boolean displaysInputFluid() {
+ return true;
+ }
+
+ @Override
+ protected boolean displaysOutputFluid() {
+ return true;
+ }
+
+ @Override
+ public boolean doesAutoOutput() {
+ return super.doesAutoOutput();
+ }
+
+ @Override
+ public boolean doesAutoOutputFluids() {
+ return this.mFluidTransfer_1 && this.mFluidTransfer_2;
+ }
+
+ @Override
+ public void startProcess() {
+ super.startProcess();
+ }
+
+ @Override
+ public void endProcess() {
+ super.endProcess();
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return super.getInfoData();
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return super.allowPullStack(aBaseMetaTileEntity, aIndex, aSide, aStack);
+ }
+
+ @Override
+ public int checkRecipe() {
+ return super.checkRecipe();
+ }
+
+ @Override
+ public int checkRecipe(boolean skipOC) {
+ return super.checkRecipe(skipOC);
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+
+ /* if (aBaseMetaTileEntity != null) {
+ if (!aBaseMetaTileEntity.getWorld().isRemote) {
+ itemslots : for (int i=3;i<7;i++) {
+ ItemStack aStack = aBaseMetaTileEntity.getStackInSlot(i);
+ if (aStack != null) {
+ if (FluidContainerRegistry.isContainer(aStack)) {
+ if (this.isItemValidForSlot(i, aStack)) {
+ // Add Fluid
+ FluidStack aContainerFluid = FluidContainerRegistry.getFluidForFilledItem(aStack);
+ if (aContainerFluid != null) {
+ fluidslots : for (FluidStack u : mInputFluids) {
+ if (u != null && u.isFluidEqual(aContainerFluid)) {
+ if (u.amount <= (this.getCapacity() - aContainerFluid.amount)) {
+
+ // Matching, not full, let's fill, then continue
+ u.amount += aContainerFluid.amount;
+
+ // Update stack size
+ if (aStack.stackSize > 1) {
+ aStack.stackSize--;
+ }
+ else {
+ aStack = null;
+ }
+
+ // Add Output container
+ // TODO
+
+ continue itemslots;
+ }
+ else {
+ // Too full
+ break fluidslots;
+ }
+ }
+ else {
+ if (u == null ) {
+
+ // Empty, let's fill, then continue
+ u = aContainerFluid.copy();
+
+ // Update stack size
+ if (aStack.stackSize > 1) {
+ aStack.stackSize--;
+ }
+ else {
+ aStack = null;
+ }
+
+ // Add Output container
+ // TODO
+
+ continue itemslots;
+
+ }
+ else {
+ // Not empty, doesn't match, check next slot.
+ continue fluidslots;
+ }
+ }
+ }
+
+
+
+ }
+ // Eat Input
+
+ // Add Container to Output
+ }
+ }
+ }
+ }
+ }
+ }*/
+
+ }
+
+ @Override
+ public FluidStack getFluid() {
+ return super.getFluid();
+ }
+
+ @Override
+ public int getFluidAmount() {
+ return super.getFluidAmount();
+ }
+
+ @Override
+ public int fill(FluidStack aFluid, boolean doFill) {
+ return super.fill(aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ return super.drain(maxDrain, doDrain);
+ }
+
+ @Override
+ protected void onEmptyingContainerWhenEmpty() {
+ super.onEmptyingContainerWhenEmpty();
+ }
+
+ @Override
+ public void setItemNBT(NBTTagCompound aNBT) {
+ super.setItemNBT(aNBT);
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack) {
+ if (aIndex >= 3 && aIndex <= 6) {
+ return SlotChemicalPlantInput.isItemValidForChemicalPlantSlot(aStack);
+ }
+ return false;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(int aSide) {
+ return super.getAccessibleSlotsFromSide(aSide);
+ }
+
+ @Override
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) {
+ if (aIndex >= 3 && aIndex <= 6) {
+ return super.canInsertItem(aIndex, aStack, aSide);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) {
+ if (aIndex >= 7 && aIndex <= 11) {
+ return super.canExtractItem(aIndex, aStack, aSide);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
+ // TODO Auto-generated method stub
+ return super.canFill(aSide, aFluid);
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
+ // TODO Auto-generated method stub
+ return super.canDrain(aSide, aFluid);
+ }
+
+ @Override
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide) {
+ // TODO Auto-generated method stub
+ return super.getTankInfo(aSide);
+ }
+
+ @Override
+ public int fill_default(
+ ForgeDirection aSide, FluidStack aFluid, boolean doFill
+ ) {
+ // TODO Auto-generated method stub
+ return super.fill_default(aSide, aFluid, doFill);
+ }
+
+ @Override
+ public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ // TODO Auto-generated method stub
+ return super.fill(aSide, aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(
+ ForgeDirection aSide, FluidStack aFluid, boolean doDrain
+ ) {
+ // TODO Auto-generated method stub
+ return super.drain(aSide, aFluid, doDrain);
+ }
+
+ @Override
+ public FluidStack drain(
+ ForgeDirection aSide, int maxDrain, boolean doDrain
+ ) {
+ // TODO Auto-generated method stub
+ return super.drain(aSide, maxDrain, doDrain);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java
index ce4a6c629a..fbf61598d3 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java
@@ -31,7 +31,7 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base {
return isValid;
}
public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluid) {
- this(aExtracting, aEmpty, aFull, aFluid, null, null, null);
+ this(aExtracting, aEmpty, aFull, aFluid, GT_Values.NF, null, null);
}
public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluidIn, FluidStack aFluidOut) {
@@ -39,7 +39,7 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base {
}
public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluid, Integer aDuration, Integer aEUt) {
- this(aExtracting, aEmpty, aFull, aFluid, null, aDuration, aEUt);
+ this(aExtracting, aEmpty, aFull, aFluid, GT_Values.NF, aDuration, aEUt);
}
// Alternative Constructor
@@ -68,7 +68,7 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base {
if (aExtracting) {
aInput = aFull;
aOutput = aEmpty;
- aFluidInput = null;
+ aFluidInput = GT_Values.NF;
aFluidOutput = aFluidIn;
}
else {
@@ -93,23 +93,34 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base {
0);
- // Not Valid
- if ((aExtracting && (aInput == null || aOutput == null ||(aFluidInput == null && aFluidOutput == null))) || (!aExtracting && (aInput == null || aOutput == null || (aFluidInput == null && aFluidOutput == null)))) {
- isValid = false;
- disableOptional = aExtracting;
- recipe = null;
+ // Check Valid
+ boolean aTempValidityCheck = false;
+ if (aExtracting) {
+ if (aInput != null && aFluidOutput != null) {
+ aTempValidityCheck = true;
+ }
}
else {
+ if (aInput != null && aOutput != null && (aFluidInput != null || aFluidOutput != null)) {
+ aTempValidityCheck = true;
+ }
+ }
+
+
+ if (aTempValidityCheck) {
// Valid Recipe
recipe = aRecipe;
mRecipeGenMap.add(this);
disableOptional = aExtracting;
- isValid = true;
+ isValid = true;
+ }
+ else {
+ isValid = false;
+ disableOptional = aExtracting;
+ aRecipe.mEnabled = false;
+ aRecipe.mHidden = true;
+ recipe = null;
}
-
-
-
-
}
@Override
@@ -129,25 +140,23 @@ public class RecipeGen_FluidCanning extends RecipeGen_Base {
}
private final boolean addFluidExtractionRecipe(GT_Recipe aRecipe) {
- if (aRecipe != null) {
- if ((aRecipe.mDuration = GregTech_API.sRecipeFile.get("fluidextractor", aRecipe.mInputs[0], aRecipe.mDuration)) <= 0) {
- return false;
- } else {
- GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(aRecipe);
- return true;
- }
+ if (aRecipe != null) {
+ int aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size();
+ int aCount2 = aCount1;
+ GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(aRecipe);
+ aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size();
+ return aCount1 > aCount2;
}
return false;
}
private final boolean addFluidCannerRecipe(GT_Recipe recipe2) {
- if (recipe2 != null) {
- if ((recipe2.mDuration = GregTech_API.sRecipeFile.get("fluidcanner", recipe2.mOutputs[0], recipe2.mDuration)) <= 0) {
- return false;
- } else {
- GT_Recipe_Map.sFluidCannerRecipes.addRecipe(recipe2);
- return true;
- }
+ if (recipe2 != null) {
+ int aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size();
+ int aCount2 = aCount1;
+ GT_Recipe_Map.sFluidCannerRecipes.addRecipe(recipe2);
+ aCount1 = GT_Recipe_Map.sFluidCannerRecipes.mRecipeList.size();
+ return aCount1 > aCount2;
}
return false;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java
index 799c6cd63b..2b4e52abb9 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java
@@ -48,8 +48,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base {
// Ingot
if (ItemUtils.checkForInvalidItems(material.getIngot(1)))
- if (CORE.RA.addFluidExtractionRecipe(material.getIngot(1), // Input
- null, // Input 2
+ if (CORE.RA.addFluidExtractionRecipe(
+ material.getIngot(1), // Input
material.getFluid(144), // Fluid Output
1 * 20, // Duration
material.vVoltageMultiplier // Eu Tick
@@ -63,8 +63,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base {
// Plate
if (ItemUtils.checkForInvalidItems(material.getPlate(1)))
- if (CORE.RA.addFluidExtractionRecipe(material.getPlate(1), // Input
- null, // Input 2
+ if (CORE.RA.addFluidExtractionRecipe(
+ material.getPlate(1), // Input
material.getFluid(144), // Fluid Output
1 * 20, // Duration
material.vVoltageMultiplier // Eu Tick
@@ -78,8 +78,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base {
// Double Plate
if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1)))
- if (CORE.RA.addFluidExtractionRecipe(material.getPlateDouble(1), // Input
- null, // Input 2
+ if (CORE.RA.addFluidExtractionRecipe(
+ material.getPlateDouble(1), // Input
material.getFluid(288), // Fluid Output
1 * 20, // Duration
material.vVoltageMultiplier // Eu Tick
@@ -93,8 +93,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base {
// Nugget
if (ItemUtils.checkForInvalidItems(material.getNugget(1)))
- if (CORE.RA.addFluidExtractionRecipe(material.getNugget(1), // Input
- null, // Input 2
+ if (CORE.RA.addFluidExtractionRecipe(
+ material.getNugget(1), // Input
material.getFluid(16), // Fluid Output
16, // Duration
material.vVoltageMultiplier // Eu Tick
@@ -108,8 +108,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base {
// Block
if (ItemUtils.checkForInvalidItems(material.getBlock(1)))
- if (CORE.RA.addFluidExtractionRecipe(material.getBlock(1), // Input
- null, // Input 2
+ if (CORE.RA.addFluidExtractionRecipe(
+ material.getBlock(1), // Input
material.getFluid(144 * 9), // Fluid Output
288, // Duration
material.vVoltageMultiplier // Eu Tick
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
index 58db8a473f..84188a44aa 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java
@@ -137,7 +137,7 @@ public class RecipeGen_Recycling implements Runnable {
//Fluid Extractor
if (ItemUtils.checkForInvalidItems(tempStack)) {
// mValidItems[mSlotIndex++] = tempStack;
- if ((mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, null, material.getFluid(mFluidAmount), 30, material.vVoltageMultiplier)) {
+ if ((mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, material.getFluid(mFluidAmount), 30, material.vVoltageMultiplier)) {
Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle "
+ tempStack.getDisplayName() + " and obtain " + mFluidAmount+"mb of "+material.getFluid(1).getLocalizedName()+".");
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
index fa6f2ad790..d43adb2be3 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
@@ -989,6 +989,11 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
}
}
+ @Override
+ public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu) {
+ return MaterialGenerator.addFluidExtractionRecipe(GT_Values.NI, input, output, aTime, aEu);
+ }
+
@Override
public boolean addFluidExtractionRecipe(ItemStack input, ItemStack input2, FluidStack output, int aTime, int aEu) {
return MaterialGenerator.addFluidExtractionRecipe(input, input2, output, aTime, aEu);
@@ -1157,6 +1162,49 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
}
+ @Override
+ public boolean addFluidReactorRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aTier) {
+
+ Recipe_GT aSpecialRecipe = new Recipe_GT(
+ false,
+ aInputs,
+ aOutputs,
+ null,
+ new int[] {},
+ aInputFluids,
+ aFluidOutputs,
+ time,
+ (int) eu,
+ aTier);
+
+ int aSize = Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList.size();
+ int aSize2 = aSize;
+ Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.add(aSpecialRecipe);
+ aSize = Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList.size();
+ return aSize > aSize2;
+ }
+
+ @Override
+ public boolean addBlastRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aHeat) {
+ Recipe_GT aSpecialRecipe = new Recipe_GT(
+ false,
+ aInputs,
+ aOutputs,
+ null,
+ new int[] {},
+ aInputFluids,
+ aFluidOutputs,
+ time,
+ (int) eu,
+ aHeat);
+
+ int aSize = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size();
+ int aSize2 = aSize;
+ GT_Recipe.GT_Recipe_Map.sBlastRecipes.add(aSpecialRecipe);
+ aSize = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size();
+ return aSize > aSize2;
+
+ }
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java
new file mode 100644
index 0000000000..bd0edd9002
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java
@@ -0,0 +1,24 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_ChemicalReactor;
+
+public class GregtechFluidReactor {
+
+ public static void run() {
+
+ GregtechItemList.FluidReactor_LV
+ .set(new GregtechMetaTileEntity_ChemicalReactor(31021, "chemicalplant.01.tier.01", "Chemical Plant I", 1)
+ .getStackForm(1L));
+ GregtechItemList.FluidReactor_HV
+ .set(new GregtechMetaTileEntity_ChemicalReactor(31022, "chemicalplant.01.tier.02", "Chemical Plant II", 3)
+ .getStackForm(1L));
+ GregtechItemList.FluidReactor_IV
+ .set(new GregtechMetaTileEntity_ChemicalReactor(31023, "chemicalplant.01.tier.03", "Chemical Plant III", 5)
+ .getStackForm(1L));
+ GregtechItemList.FluidReactor_ZPM
+ .set(new GregtechMetaTileEntity_ChemicalReactor(31024, "chemicalplant.01.tier.04", "Chemical Plant IV", 7)
+ .getStackForm(1L));
+
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
index 6933987593..686910b9aa 100644
--- a/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
+++ b/src/Java/gtPlusPlus/xmod/growthcraft/fishtrap/FishTrapHandler.java
@@ -221,10 +221,10 @@ public class FishTrapHandler {
private static void addGregtechFluidRecipe(final ItemStack input){
if (LoadedMods.Gregtech){
if (CORE.GTNH) {
- CORE.RA.addFluidExtractionRecipe(input, null, FluidUtils.getFluidStack("fishoil", 50), 16, 4);
+ CORE.RA.addFluidExtractionRecipe(input, FluidUtils.getFluidStack("fishoil", 50), 16, 4);
}
else {
- CORE.RA.addFluidExtractionRecipe(input, null, FluidUtils.getFluidStack("fishoil", 4), 16, 4); //4eu/t total eu used = 64 so time = 64/4
+ CORE.RA.addFluidExtractionRecipe(input, FluidUtils.getFluidStack("fishoil", 4), 16, 4); //4eu/t total eu used = 64 so time = 64/4
}
}
}
diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
index 56e577fb7d..3de15ce6be 100644
--- a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
@@ -34,7 +34,7 @@ public class TF_Gregtech_Recipes {
//Gelid Cryotheum
Logger.INFO("Adding Recipes for Gelid Cryotheum");
- CORE.RA.addFluidExtractionRecipe(dust_Cryotheum, GT_Values.NI, getFluidStack("cryotheum", 250), 200, 240);
+ CORE.RA.addFluidExtractionRecipe(dust_Cryotheum, getFluidStack("cryotheum", 250), 200, 240);
GT_Values.RA.addChemicalBathRecipe((GT_OreDictUnificator.get(OrePrefixes.ore, Materials.Cinnabar, 1L)), getFluidStack("cryotheum", 144), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Cinnabar, 3L), GT_Values.NI, GT_Values.NI, null, 400, 30);
//Blizz Powder
@@ -48,10 +48,10 @@ public class TF_Gregtech_Recipes {
//Blazing Pyrotheum
Logger.INFO("Adding Recipes for Blazing Pyrotheum");
- CORE.RA.addFluidExtractionRecipe(dust_Pyrotheum, GT_Values.NI, getFluidStack("pyrotheum", 250), 200, 240);
+ CORE.RA.addFluidExtractionRecipe(dust_Pyrotheum, getFluidStack("pyrotheum", 250), 200, 240);
//Ender Fluid
- CORE.RA.addFluidExtractionRecipe(ItemUtils.getSimpleStack(Items.ender_pearl), GT_Values.NI, getFluidStack("ender", 250), 100, 30);
+ CORE.RA.addFluidExtractionRecipe(ItemUtils.getSimpleStack(Items.ender_pearl), getFluidStack("ender", 250), 100, 30);
ItemStack dustCoal = ItemUtils.getItemStackOfAmountFromOreDict("dustCoal", 1);
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT.png
new file mode 100644
index 0000000000..e92b9c9ff8
Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT.png differ
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png
new file mode 100644
index 0000000000..8a47157d2b
Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png differ
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png.mcmeta
new file mode 100644
index 0000000000..1367b80758
--- /dev/null
+++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE.png.mcmeta
@@ -0,0 +1,6 @@
+{
+ "animation":{
+ "frametime":2,
+ "frames": [0, 0, 1, 1, 2, 2, 3, 3, 3, 2, 2, 1, 1, 0]
+ }
+}
\ No newline at end of file
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE.png
new file mode 100644
index 0000000000..b926eb1ef2
Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE.png differ
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png
new file mode 100644
index 0000000000..ae63da7746
Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png differ
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png.mcmeta b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png.mcmeta
new file mode 100644
index 0000000000..8447c98f9a
--- /dev/null
+++ b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE.png.mcmeta
@@ -0,0 +1,6 @@
+{
+ "animation":{
+ "frametime":2,
+ "frames": [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0]
+ }
+}
\ No newline at end of file
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP.png
new file mode 100644
index 0000000000..e9b20bd486
Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP.png differ
diff --git a/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE.png b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE.png
new file mode 100644
index 0000000000..25ea33ce3a
Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE.png differ
diff --git a/src/resources/assets/miscutils/textures/gui/FluidReactor.png b/src/resources/assets/miscutils/textures/gui/FluidReactor.png
new file mode 100644
index 0000000000..b8e88bd461
Binary files /dev/null and b/src/resources/assets/miscutils/textures/gui/FluidReactor.png differ
diff --git a/src/resources/assets/miscutils/textures/items/bioscience/BioCircuit.png b/src/resources/assets/miscutils/textures/items/bioscience/BioCircuit.png
new file mode 100644
index 0000000000..c2736be76c
Binary files /dev/null and b/src/resources/assets/miscutils/textures/items/bioscience/BioCircuit.png differ
diff --git a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/8.png b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/8.png
index c16e0a1278..c8c6299d7b 100644
Binary files a/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/8.png and b/src/resources/assets/miscutils/textures/items/bioscience/MetaItem1/8.png differ
--
cgit
From 9ba6d563d1b69bc8aa88d48754c273dae77aa713 Mon Sep 17 00:00:00 2001
From: Alkalus <3060479+draknyte1@users.noreply.github.com>
Date: Thu, 24 Oct 2019 05:07:27 +0100
Subject: % Tried to adjust the name of IC2 Hot Water. $ Fixed OreDicting ore
Sodium Hydroxide if GT dusts are detected. $ Fixed bad oredict look-up for
RP1 cell. $ Rewrote how GT++ Materials look for existing fluids and cells
during generation, hopefully this didn't break any existing cells or fluids.
(Please investigate log after loading a world)
---
.../core/item/base/BaseItemComponent.java | 2 +-
.../core/item/chemistry/AgriculturalChem.java | 31 +-
.../core/item/chemistry/RocketFuels.java | 6 +-
src/Java/gtPlusPlus/core/material/Material.java | 129 +++----
.../gtPlusPlus/core/slots/SlotNoInputLogging.java | 13 +-
.../util/minecraft/gregtech/PollutionUtils.java | 13 +-
.../gtPlusPlus/plugin/agrichem/BioRecipes.java | 68 +++-
src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java | 2 +
.../gui/fluidreactor/Container_FluidReactor.java | 2 +
.../xmod/gregtech/common/Meta_GT_Proxy.java | 379 ++++++++++++---------
.../GregtechMetaTileEntity_ChemicalReactor.java | 3 -
src/resources/assets/miscutils/lang/en_US.lang | 11 +-
12 files changed, 382 insertions(+), 277 deletions(-)
(limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/gui')
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
index c8b6253753..9b732e38e1 100644
--- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java
@@ -169,7 +169,7 @@ public class BaseItemComponent extends Item{
if (this.componentMaterial == null){
if (this.materialName != null){
- list.add(Utils.sanitizeStringKeepBrackets(materialName));
+ //list.add(Utils.sanitizeStringKeepBrackets(materialName));
}
}
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
index 324a3aa9ee..55f4dfa0be 100644
--- a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
+++ b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java
@@ -219,12 +219,19 @@ public class AgriculturalChem extends ItemPackage {
ItemUtils.addItemToOreDictionary(mAluminiumPellet, "pelletAluminium");
ItemUtils.addItemToOreDictionary(mSodiumAluminate, "dustSodiumAluminate");
- if (mSodiumHydroxide.getItem() instanceof ItemAgrichemBase) {
- ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide");
- }
+ ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide");
ItemUtils.addItemToOreDictionary(mSodiumCarbonate, "dustSodiumCarbonate");
ItemUtils.addItemToOreDictionary(mLithiumChloride, "dustLithiumChloride");
+ //Handle GT NaOH dusts
+ List NaOHSmall = OreDictionary.getOres("dustSmallSodiumHydroxide_GT5U", false);
+ if (!NaOHSmall.isEmpty()) {
+ ItemUtils.addItemToOreDictionary(NaOHSmall.get(0), "dustSmallSodiumHydroxide");
+ }
+ List NaOHTiny = OreDictionary.getOres("dustTinySodiumHydroxide_GT5U", false);
+ if (!NaOHTiny.isEmpty()) {
+ ItemUtils.addItemToOreDictionary(NaOHTiny.get(0), "dustTinySodiumHydroxide");
+ }
}
@@ -300,19 +307,19 @@ public class AgriculturalChem extends ItemPackage {
}
- public final static AutoMap mMeats = new AutoMap();
- public final static AutoMap mFish = new AutoMap();
- public final static AutoMap mFruits = new AutoMap();
- public final static AutoMap mVege = new AutoMap();
- public final static AutoMap mNuts = new AutoMap();
- public final static AutoMap mSeeds = new AutoMap();
+ private final static AutoMap mMeats = new AutoMap();
+ private final static AutoMap mFish = new AutoMap();
+ private final static AutoMap mFruits = new AutoMap();
+ private final static AutoMap mVege = new AutoMap();
+ private final static AutoMap mNuts = new AutoMap();
+ private final static AutoMap mSeeds = new AutoMap();
private final static AutoMap mPeat = new AutoMap();
private final static AutoMap mBones = new AutoMap();
private final static AutoMap mBoneMeal = new AutoMap();
- public final static AutoMap mList_Master_Meats = new AutoMap();
- public final static AutoMap mList_Master_FruitVege = new AutoMap();
- public final static AutoMap mList_Master_Seeds = new AutoMap();
+ private final static AutoMap mList_Master_Meats = new AutoMap();
+ private final static AutoMap mList_Master_FruitVege = new AutoMap();
+ private final static AutoMap mList_Master_Seeds = new AutoMap();
private final static AutoMap mList_Master_Bones = new AutoMap();
private static void processAllOreDict() {
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java
index c02e767dcd..0bea7dfc31 100644
--- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java
+++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java
@@ -292,7 +292,7 @@ public class RocketFuels extends ItemPackage {
GT_Values.RA.addCentrifugeRecipe(
CI.getNumberedCircuit(23),
- ItemUtils.getItemStackOfAmountFromOreDict("cellRP1Fuel", 1),
+ ItemUtils.getItemStackOfAmountFromOreDict("cellRP1", 1),
FluidUtils.getFluidStack(Liquid_Oxygen, 4000),
FluidUtils.getFluidStack(RP1_Plus_Liquid_Oxygen, 200),
CI.emptyCells(1),
@@ -679,7 +679,7 @@ public class RocketFuels extends ItemPackage {
CoalTar.Coal_Oil = Kerosene;
//RP! Focket Fuel
- RP1 = FluidUtils.generateFluidNonMolten("RP1Fuel", "RP-1 Rocket Fuel", 500, new short[]{210, 50, 50, 100}, null, null);
+ RP1 = FluidUtils.generateFluidNonMolten("RP1Fuel", "RP-1", 500, new short[]{210, 50, 50, 100}, null, null);
//Create Nitrogen Tetroxide
Nitrogen_Tetroxide = FluidUtils.generateFluidNonMolten("NitrogenTetroxide", "Nitrogen Tetroxide", -11, new short[]{170, 170, 0, 100}, null, null);
@@ -753,7 +753,7 @@ public class RocketFuels extends ItemPackage {
Formaldehyde = FluidUtils.generateFluidNonMolten("Formaldehyde", "Formaldehyde", -92, new short[]{150, 75, 150, 100}, null, null);
Unsymmetrical_Dimethylhydrazine_Plus_Nitrogen_Tetroxide = FluidUtils.generateFluidNonMolten("RocketFuelMixA", "H8N4C2O4 Rocket Fuel", -185, new short[]{50, 220, 50, 100}, null, null);
- RP1_Plus_Liquid_Oxygen = FluidUtils.generateFluidNonMolten("RocketFuelMixB", "Rp-1 Fuel Mixture", -250, new short[]{250, 50, 50, 100}, null, null);
+ RP1_Plus_Liquid_Oxygen = FluidUtils.generateFluidNonMolten("RocketFuelMixB", "Rp-1 Rocket Fuel", -250, new short[]{250, 50, 50, 100}, null, null);
Monomethylhydrazine_Plus_Nitric_Acid = FluidUtils.generateFluidNonMolten("RocketFuelMixC", "CN3H7O3 Rocket Fuel", -300, new short[]{125, 75, 180, 100}, null, null);
Dense_Hydrazine_Mix = FluidUtils.generateFluidNonMolten("RocketFuelMixD", "Dense Hydrazine Fuel Mixture", -250, new short[]{175, 80, 120, 100}, null, null);
diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java
index d95b17e75c..b5922dde53 100644
--- a/src/Java/gtPlusPlus/core/material/Material.java
+++ b/src/Java/gtPlusPlus/core/material/Material.java
@@ -1094,96 +1094,41 @@ public class Material {
if (this.materialState == MaterialState.ORE){
return null;
}
+
+ Fluid aGTBaseFluid = null;
- final Materials isValid = Materials.get(this.getLocalizedName());
- //Logger.MATERIALS("Is "+this.getLocalizedName()+" a Gregtech material? "+(isValid != null && isValid != Materials._NULL)+" | Found "+isValid.mDefaultLocalName);
- if (isValid != Materials._NULL){
- for (Materials m : invalidMaterials.values()){
- if (isValid == m){
- Logger.MATERIALS("Trying to generate a fluid for blacklisted material: "+m.mDefaultLocalName);
- FluidStack a1 = m.getFluid(1);
- FluidStack a2 = m.getGas(1);
- FluidStack a3 = m.getMolten(1);
- FluidStack a4 = m.getSolid(1);
- FluidStack a5 = m.getPlasma(1);
- if (a1 != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. Fluid.");
- return a1.getFluid();
- }
- if (a2 != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. Gas.");
- return a2.getFluid();
- }
- if (a3 != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. Molten.");
- return a3.getFluid();
- }
- if (a4 != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. Solid.");
- return a4.getFluid();
- }
- if (a5 != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. Plasma.");
- return a5.getFluid();
- }
- Logger.MATERIALS("Using null.");
- return null;
- }
- }
- }
+ // Clean up Internal Fluid Generation
+ final Materials n1 = MaterialUtils.getMaterial(this.getLocalizedName(), Utils.sanitizeString(this.getLocalizedName()));
+ final Materials n2 = MaterialUtils.getMaterial(this.getUnlocalizedName(), Utils.sanitizeString(this.getUnlocalizedName()));
- if (this.materialState == MaterialState.SOLID){
- if (isValid.mFluid != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. mFluid.");
- return isValid.mFluid;
- }
- else if (isValid.mStandardMoltenFluid != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. mStandardMoltenFluid.");
- return isValid.mStandardMoltenFluid;
- }
- }
- else if (this.materialState == MaterialState.GAS){
- if (isValid.mGas != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. mGas.");
- return isValid.mGas;
- }
- }
- else if (this.materialState == MaterialState.LIQUID || this.materialState == MaterialState.PURE_LIQUID){
- if (isValid.mFluid != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. mFluid.");
- return isValid.mFluid;
- }
- else if (isValid.mGas != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. mGas.");
- return isValid.mGas;
- }
- else if (isValid.mStandardMoltenFluid != null){
- Logger.MATERIALS("Using a pre-defined Fluid from GT. mStandardMoltenFluid.");
- return isValid.mStandardMoltenFluid;
- }
- }
-
- FluidStack aTest1 = FluidUtils.getFluidStack("molten."+Utils.sanitizeString(this.getLocalizedName()), 1);
- FluidStack aTest2 = FluidUtils.getFluidStack("fluid."+Utils.sanitizeString(this.getLocalizedName()), 1);
- FluidStack aTest3 = FluidUtils.getFluidStack(Utils.sanitizeString(this.getLocalizedName()), 1);
+ FluidStack f1 = FluidUtils.getWildcardFluidStack(n1, 1);
+ FluidStack f2 = FluidUtils.getWildcardFluidStack(n2, 1);
+ FluidStack f3 = FluidUtils.getWildcardFluidStack(Utils.sanitizeString(this.getUnlocalizedName(), new char[] {'-', '_'}), 1);
+ FluidStack f4 = FluidUtils.getWildcardFluidStack(Utils.sanitizeString(this.getLocalizedName(), new char[] {'-', '_'}), 1);
- if (aTest1 != null) {
- Logger.MATERIALS("Found FluidRegistry entry for "+"molten."+Utils.sanitizeString(this.getLocalizedName()));
- return aTest1.getFluid();
+ if (f1 != null) {
+ aGTBaseFluid = f1.getFluid();
}
- if (aTest2 != null) {
- Logger.MATERIALS("Found FluidRegistry entry for "+"fluid."+Utils.sanitizeString(this.getLocalizedName()));
- return aTest2.getFluid();
+ else if (f2 != null) {
+ aGTBaseFluid = f2.getFluid();
}
- if (aTest3 != null) {
- Logger.MATERIALS("Found FluidRegistry entry for "+Utils.sanitizeString(this.getLocalizedName()));
- return aTest3.getFluid();
+ else if (f3 != null) {
+ aGTBaseFluid = f3.getFluid();
}
+ else if (f4 != null) {
+ aGTBaseFluid = f4.getFluid();
+ }
+
ItemStack aFullCell = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getUnlocalizedName(), 1);
+ ItemStack aFullCell2 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+this.getLocalizedName(), 1);
+ ItemStack aFullCell3 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+Utils.sanitizeString(this.getUnlocalizedName(), new char[] {'-', '_'}), 1);
+ ItemStack aFullCell4 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+Utils.sanitizeString(this.getLocalizedName(), new char[] {'-', '_'}), 1);
+
Logger.MATERIALS("Generating our own fluid.");
- //Generate a Cell if we need to
- if (aFullCell == null){
+ //Generate a Cell if we need to, but first validate all four searches are invalid
+
+ if (!ItemUtils.checkForInvalidItems(new ItemStack[] {aFullCell, aFullCell2, aFullCell3, aFullCell4})){
if (this.vGenerateCells){
Item g = new BaseItemCell(this);
aFullCell = ItemUtils.getSimpleStack(g);
@@ -1193,7 +1138,29 @@ public class Material {
Logger.MATERIALS("Did not generate a cell for "+this.getUnlocalizedName());
}
}
+ else {
+ // One cell we searched for was valid, let's register it.
+ if (aFullCell != null) {
+ this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell);
+ }
+ else if (aFullCell2 != null) {
+ this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell2);
+ }
+ else if (aFullCell3 != null) {
+ this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell3);
+ }
+ else if (aFullCell4 != null) {
+ this.registerComponentForMaterial(ComponentTypes.CELL, aFullCell4);
+ }
+ }
+ // We found a GT fluid, let's use it.
+ // Good chance we registered the cell from this material too.
+ if (aGTBaseFluid != null) {
+ return aGTBaseFluid;
+ }
+
+ // This fluid does not exist at all, time to generate it.
if (this.materialState == MaterialState.SOLID){
return FluidUtils.addGTFluid(
this.getUnlocalizedName(),
diff --git a/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java b/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java
index 42bc7ce346..762714ac94 100644
--- a/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java
+++ b/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java
@@ -2,6 +2,7 @@ package gtPlusPlus.core.slots;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.block.Block;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@@ -12,13 +13,23 @@ public class SlotNoInputLogging extends SlotNoInput {
public SlotNoInputLogging(final IInventory inventory, final int index, final int x, final int y) {
super(inventory, index, x, y);
aSlotIndex = index;
+ Logger.INFO("Slot "+index+" is doing logging");
}
@Override
public boolean isItemValid(final ItemStack itemstack) {
if (ItemUtils.checkForInvalidItems(itemstack)) {
Logger.INFO("Tried Inserting "+ItemUtils.getItemName(itemstack)+" into slot "+aSlotIndex);
- }
+ Block b = Block.getBlockFromItem(itemstack.getItem());
+ Logger.INFO(""+itemstack.getUnlocalizedName());
+ if (b != null) {
+ Logger.INFO(""+b.getLocalizedName());
+ Logger.INFO(""+b.getUnlocalizedName());
+ }
+ }
+ else {
+ Logger.INFO("Bad Itemstack");
+ }
return false;
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
index a0a684d3c6..b3372e8bde 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java
@@ -15,6 +15,7 @@ import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
import gregtech.common.GT_Proxy;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.item.base.cell.BaseItemCell;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.MISC_MATERIALS;
import gtPlusPlus.core.material.MaterialGenerator;
@@ -239,11 +240,16 @@ public class PollutionUtils {
if (CD != null) {
Logger.INFO("[PollutionCompat] Found carbon dioxide fluid, registering it.");
PollutionUtils.mPollutionFluidStacks.put(CD);
+ MISC_MATERIALS.CARBON_DIOXIDE.registerComponentForMaterial(CD);
ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonDioxide", 1);
if (ItemUtils.checkForInvalidItems(cellCD)) {
Logger.INFO("[PollutionCompat] Found carbon dioxide cell, registering component.");
MISC_MATERIALS.CARBON_DIOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD);
}
+ else {
+ Logger.INFO("[PollutionCompat] Did not find carbon dioxide cell, registering new component.");
+ new BaseItemCell(MISC_MATERIALS.CARBON_DIOXIDE);
+ }
}
else {
MaterialGenerator.generate(MISC_MATERIALS.CARBON_DIOXIDE, false, false);
@@ -252,11 +258,16 @@ public class PollutionUtils {
if (CM != null) {
Logger.INFO("[PollutionCompat] Found carbon monoxide fluid, registering it.");
PollutionUtils.mPollutionFluidStacks.put(CM);
+ MISC_MATERIALS.CARBON_MONOXIDE.registerComponentForMaterial(CM);
ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonMonoxide", 1);
if (ItemUtils.checkForInvalidItems(cellCD)) {
- Logger.INFO("[PollutionCompat] Found carbon dioxide cell, registering component.");
+ Logger.INFO("[PollutionCompat] Found carbon monoxide cell, registering component.");
MISC_MATERIALS.CARBON_MONOXIDE.registerComponentForMaterial(OrePrefixes.cell, cellCD);
}
+ else {
+ Logger.INFO("[PollutionCompat] Did not find carbon monoxide cell, registering new component.");
+ new BaseItemCell(MISC_MATERIALS.CARBON_MONOXIDE);
+ }
}
else {
MaterialGenerator.generate(MISC_MATERIALS.CARBON_MONOXIDE, false, false);
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java
index 9512651417..477bdb2ff5 100644
--- a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java
+++ b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java
@@ -5,10 +5,12 @@ import static gtPlusPlus.core.lib.CORE.GTNH;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.HashSet;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
+import gregtech.api.objects.GT_ItemStack;
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
@@ -487,10 +489,64 @@ public class BioRecipes {
}
-
+
+
+
+ public final static HashSet mFruits = new HashSet();
+ public final static HashSet mVege = new HashSet();
+ public final static HashSet mNuts = new HashSet();
+ public final static HashSet mSeeds = new HashSet();
+
+ public final static AutoMap mList_Master_FruitVege = new AutoMap();
+ public final static AutoMap mList_Master_Seeds = new AutoMap();
+
+ private static void processFermentationOreDict() {
+ processOreDictEntry("listAllfruit", mFruits);
+ processOreDictEntry("listAllFruit", mFruits);
+ processOreDictEntry("listAllveggie", mVege);
+ processOreDictEntry("listAllVeggie", mVege);
+ processOreDictEntry("listAllnut", mNuts);
+ processOreDictEntry("listAllNut", mNuts);
+ processOreDictEntry("listAllseed", mSeeds);
+ processOreDictEntry("listAllSeed", mSeeds);
+
+ if (!mFruits.isEmpty()) {
+ for (GT_ItemStack g : mFruits) {
+ mList_Master_FruitVege.put(g.toStack());
+ }
+ }
+ if (!mVege.isEmpty()) {
+ for (GT_ItemStack g : mVege) {
+ mList_Master_FruitVege.put(g.toStack());
+ }
+ }
+ if (!mNuts.isEmpty()) {
+ for (GT_ItemStack g : mNuts) {
+ mList_Master_FruitVege.put(g.toStack());
+ }
+ }
+ if (!mSeeds.isEmpty()) {
+ for (GT_ItemStack g : mSeeds) {
+ mList_Master_Seeds.put(g.toStack());
+ }
+ }
+ }
+
+ // Make Fermentation
+ private static void processOreDictEntry(String aOreName, HashSet mfruits2) {
+ ArrayList aTemp = OreDictionary.getOres(aOreName);
+ if (!aTemp.isEmpty()) {
+ for (ItemStack stack : aTemp) {
+ mfruits2.add(new GT_ItemStack(stack));
+ }
+ }
+ }
+
+
private static void recipeFermentationBase() {
- AutoMap aFruitVege = AgriculturalChem.mList_Master_FruitVege;
- AutoMap aSeeds = AgriculturalChem.mList_Master_Seeds;
+ processFermentationOreDict();
+ AutoMap aFruitVege = mList_Master_FruitVege;
+ AutoMap aSeeds = mList_Master_Seeds;
ArrayList aMap = OreDictionary.getOres("cropSugarbeet");
for (ItemStack a : aFruitVege) {
if (aMap.contains(a)) {
@@ -780,7 +836,7 @@ public class BioRecipes {
private static void recipeAluminiumPellet() {
GT_Values.RA.addAutoclaveRecipe(
ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 3),
- null,
+ FluidUtils.getFluidStack(BioRecipes.mAir, 1000),
ItemUtils.getSimpleStack(AgriculturalChem.mAluminiumPellet, 4),
10000,
120 * 20,
@@ -856,7 +912,7 @@ public class BioRecipes {
private static void recipeAlginicAcid() {
- // Turn into Cellulose Pulp
+ /*// Turn into Cellulose Pulp
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
getBioChip(7),
ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 20),
@@ -865,7 +921,7 @@ public class BioRecipes {
GT_Values.NF,
ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 20),
90 * 20,
- 16);
+ 16);*/
}
private static void recipeSulfuricAcid() {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
index f85d432b0c..42354e49e1 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
@@ -36,6 +36,7 @@ import gtPlusPlus.everglades.gen.gt.WorldGen_GT;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.api.util.GTPP_Config;
import gtPlusPlus.xmod.gregtech.api.world.GTPP_Worldgen;
+import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.StaticFields59;
import gtPlusPlus.xmod.gregtech.common.blocks.fluid.GregtechFluidHandler;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools;
@@ -134,6 +135,7 @@ public class HANDLER_GT {
}
RecipesToRemove.go();
convertPyroToCokeOven();
+ Meta_GT_Proxy.fixIC2FluidNames();
}
private static void convertPyroToCokeOven() {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java
index 0c64644166..cdca065e60 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/Container_FluidReactor.java
@@ -11,6 +11,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.slots.SlotChemicalPlantInput;
import gtPlusPlus.core.slots.SlotNoInput;
+import gtPlusPlus.core.slots.SlotNoInputLogging;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_ChemicalReactor;
import net.minecraft.entity.player.EntityPlayer;
@@ -93,6 +94,7 @@ public class Container_FluidReactor extends GT_Container_BasicMachine {
}
}
}
+ //Logger.INFO("Clicked slot "+aSlotIndex);
return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
index 2d7151bf45..d507b3c814 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
@@ -13,10 +13,12 @@ import java.util.Timer;
import java.util.TimerTask;
import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseMetaTileEntity;
@@ -33,11 +35,15 @@ import gtPlusPlus.core.handler.AchievementHandler;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.ELEMENT;
import gtPlusPlus.core.util.minecraft.FluidUtils;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
+import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.BaseCustomTileEntity;
import gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power.BaseCustomPower_MTE;
import gtPlusPlus.xmod.gregtech.common.covers.CoverManager;
+import ic2.core.init.BlocksItems;
+import ic2.core.init.InternalName;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
@@ -45,6 +51,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
public class Meta_GT_Proxy {
@@ -52,74 +60,111 @@ public class Meta_GT_Proxy {
static {
Logger.INFO("GT_PROXY - initialized.");
}
-
+
public static List GT_BlockIconload = new ArrayList<>();
public static List GT_ItemIconload = new ArrayList<>();
-
+
public static AutoMap GT_ValidHeatingCoilMetas = new AutoMap();
private static Class sBaseMetaTileEntityClass;
private static Class sBaseMetaTileEntityClass2;
-
+
public static AchievementHandler mAssemblyAchievements;
-
+
public static final Map mCustomGregtechMetaTooltips = new LinkedHashMap();
-
+
@SideOnly(Side.CLIENT)
public static IIconRegister sBlockIcons, sItemIcons;
public Meta_GT_Proxy() {
-
+
}
-
+
public static Block sBlockMachines;
-
+
public static void preInit() {
-
+
//New GT++ Block, yay! (Progress)
//sBlockMachines = new GTPP_Block_Machines();
-
- GT_Log.out.println("GT++ Mod: Register TileEntities.");
- BaseMetaTileEntity tBaseMetaTileEntity = constructBaseMetaTileEntity();
- BaseMetaTileEntity tBaseMetaTileEntity2 = constructBaseMetaTileEntityCustomPower();
-
- GT_Log.out.println("GT++ Mod: Testing BaseMetaTileEntity.");
- if (tBaseMetaTileEntity == null || tBaseMetaTileEntity2 == null) {
- GT_Log.out.println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
- throw new RuntimeException("");
- }
-
- //Gotta set it here so that we don't try call gregtech too early.
- //Must set on the correct side
-
- if (ReflectionUtils.doesFieldExist(GT_Proxy.class, "gt6Pipe")) {
- StaticFields59.mGT6StylePipes = (boolean) StaticFields59.getFieldFromGregtechProxy("gt6Pipe");
- }
- else {
- StaticFields59.mGT6StylePipes = false;
- }
-
- GT_Log.out.println("GT++ Mod: Registering the BaseMetaTileEntity.");
- GameRegistry.registerTileEntity(tBaseMetaTileEntity.getClass(), "BaseMetaTileEntity_GTPP");
- GameRegistry.registerTileEntity(tBaseMetaTileEntity2.getClass(), "BaseMetaTileEntity_GTPP2");
- CoverManager.generateCustomCovers();
+ fixIC2FluidNames();
+
+ GT_Log.out.println("GT++ Mod: Register TileEntities.");
+ BaseMetaTileEntity tBaseMetaTileEntity = constructBaseMetaTileEntity();
+ BaseMetaTileEntity tBaseMetaTileEntity2 = constructBaseMetaTileEntityCustomPower();
+
+ GT_Log.out.println("GT++ Mod: Testing BaseMetaTileEntity.");
+ if (tBaseMetaTileEntity == null || tBaseMetaTileEntity2 == null) {
+ GT_Log.out.println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
+ throw new RuntimeException("");
+ }
+
+ //Gotta set it here so that we don't try call gregtech too early.
+ //Must set on the correct side
+
+ if (ReflectionUtils.doesFieldExist(GT_Proxy.class, "gt6Pipe")) {
+ StaticFields59.mGT6StylePipes = (boolean) StaticFields59.getFieldFromGregtechProxy("gt6Pipe");
+ }
+ else {
+ StaticFields59.mGT6StylePipes = false;
+ }
+
+ GT_Log.out.println("GT++ Mod: Registering the BaseMetaTileEntity.");
+ GameRegistry.registerTileEntity(tBaseMetaTileEntity.getClass(), "BaseMetaTileEntity_GTPP");
+ GameRegistry.registerTileEntity(tBaseMetaTileEntity2.getClass(), "BaseMetaTileEntity_GTPP2");
+ CoverManager.generateCustomCovers();
}
-
+
public static void init() {
scheduleCoverMapCleaner();
setValidHeatingCoilMetas();
+ PollutionUtils.setPollutionFluids();
+ fixIC2FluidNames();
}
-
+
public static void postInit() {
- mAssemblyAchievements = new AchievementHandler();
+ mAssemblyAchievements = new AchievementHandler();
+ fixIC2FluidNames();
}
-
+
+ @SuppressWarnings("deprecation")
+ public static void fixIC2FluidNames() {
+ //Fix IC2 Hot Water name
+ try {
+ String aNewHeatedWaterName = "Heated Water";
+ Logger.INFO("Renaming [IC2 Hotspring Water] --> ["+aNewHeatedWaterName+"].");LanguageRegistry.instance().addStringLocalization("fluidHotWater", "Heated Water");
+ LanguageRegistry.instance().addStringLocalization("fluidHotWater", aNewHeatedWaterName);
+ LanguageRegistry.instance().addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName);
+ GT_LanguageManager.addStringLocalization("fluidHotWater", aNewHeatedWaterName);
+ GT_LanguageManager.addStringLocalization("ic2.fluidHotWater", aNewHeatedWaterName);
+
+ Block b = BlocksItems.getFluidBlock(InternalName.fluidHotWater);
+ if (b != null) {
+ LanguageRegistry.addName(ItemUtils.getSimpleStack(b), aNewHeatedWaterName);
+ LanguageRegistry.instance().addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName);
+ GT_LanguageManager.addStringLocalization(b.getUnlocalizedName(), aNewHeatedWaterName);
+ }
+ Fluid f = BlocksItems.getFluid(InternalName.fluidHotWater);
+ if (f != null) {
+ LanguageRegistry.instance().addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName);
+ GT_LanguageManager.addStringLocalization(f.getUnlocalizedName(), aNewHeatedWaterName);
+ int aDam = FluidRegistry.getFluidID(f);
+ ItemStack s = ItemList.Display_Fluid.getWithDamage(1, aDam);
+ if (s != null) {
+ LanguageRegistry.addName(s, aNewHeatedWaterName);
+ }
+ }
+ }
+ catch (Throwable t) {
+
+ }
+ }
+
public static boolean generatePlasmaRecipesForAdvVacFreezer() {
-
+
AutoMap aFreezerMapRebaked = new AutoMap();
AutoMap aRemovedRecipes = new AutoMap();
-
+
//Find recipes containing Plasma and map them
for (Recipe_GT y : Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList) {
if (y.mFluidInputs.length > 0) {
@@ -132,20 +177,20 @@ public class Meta_GT_Proxy {
aFreezerMapRebaked.put(y);
}
}
-
+
AutoMap aNewRecipes = new AutoMap();
int aAtomicMass = 0;
int aAtomicTier = 0;
-
+
final FluidStack NULL_PLASMA = Materials._NULL.getPlasma(1);
-
+
for (String s : ELEMENT.NAMES) {
-
+
aAtomicMass++;
aAtomicTier = (aAtomicMass/30)+1;
FluidStack aMoltenFluid = null;
FluidStack aPlasma = null;
-
+
//Try Get Material via Gregtech
Materials aGregMaterial = MaterialUtils.getMaterial(s);
if (aGregMaterial != null) {
@@ -161,7 +206,7 @@ public class Meta_GT_Proxy {
}
aPlasma = aGregMaterial.getPlasma(100);
}
-
+
//Just wildcard values
if (aMoltenFluid == null || aPlasma == null) {
if (aMoltenFluid == null) {
@@ -171,7 +216,7 @@ public class Meta_GT_Proxy {
aPlasma = FluidUtils.getFluidStack("plasma."+s.toLowerCase(), 1);
}
}
-
+
//Skip this material
if (aMoltenFluid == null || aPlasma == null || aPlasma.isFluidEqual(NULL_PLASMA)) {
Logger.INFO("Could not generate Advanced Vacuum Freezer recipe. Cooling "+s+" plasma. Molten Form Exists? "+(aMoltenFluid != null)+" | Plasma Exists? "+(aPlasma != null));
@@ -186,49 +231,49 @@ public class Meta_GT_Proxy {
null,
new int[] {10000},
new FluidStack[] {
- aPlasma,
- FluidUtils.getFluidStack("cryotheum", aTotalTickTime)
- },
+ aPlasma,
+ FluidUtils.getFluidStack("cryotheum", aTotalTickTime)
+ },
new FluidStack[] {
- aMoltenFluid
- },
+ aMoltenFluid
+ },
aTotalTickTime,
(int) GT_Values.V[4+aAtomicTier],
aAtomicMass);
-
+
//Add it to the map if it's valid
if (aTempRecipe != null) {
aNewRecipes.put(aTempRecipe);
}
}
-
+
}
-
+
//Add the new recipes to the map we will rebake over the original
for (Recipe_GT w : aNewRecipes) {
aFreezerMapRebaked.put(w);
}
-
+
//Best not touch the original map if we don't have a valid map to override it with.
if (aFreezerMapRebaked.size() > 0) {
-
+
int aOriginalCount = Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.size();
-
+
//Empty the original map
Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.clear();
-
+
//Rebake the real map
for (Recipe_GT w : aFreezerMapRebaked) {
Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.add(w);
}
-
+
return Recipe_GT.Gregtech_Recipe_Map.sAdvFreezerRecipes.mRecipeList.size() >= aOriginalCount;
}
-
+
return false;
}
-
+
public static TileEntity constructCustomGregtechMetaTileEntityByMeta(int aMeta) {
if (aMeta == 12) {
return Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower();
@@ -237,7 +282,7 @@ public class Meta_GT_Proxy {
return Meta_GT_Proxy.constructBaseMetaTileEntity();
}
}
-
+
public static BaseCustomTileEntity constructBaseMetaTileEntity() {
if (sBaseMetaTileEntityClass == null) {
try {
@@ -264,7 +309,7 @@ public class Meta_GT_Proxy {
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | SecurityException e) {
GT_Log.err
- .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
+ .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
e.printStackTrace(GT_Log.err);
throw new RuntimeException(e);
}
@@ -299,20 +344,20 @@ public class Meta_GT_Proxy {
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException
| InvocationTargetException | SecurityException e) {
GT_Log.err
- .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
+ .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft.");
e.printStackTrace(GT_Log.err);
throw new RuntimeException(e);
}
}
}
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
public static void setValidHeatingCoilMetas() {
for (int i = 0; i <= 6; i++ ) {
GT_ValidHeatingCoilMetas.put(i);
@@ -336,20 +381,20 @@ public class Meta_GT_Proxy {
return false;
}
}
-
+
public static void scheduleCoverMapCleaner(){
- TimerTask repeatedTask = new TimerTask() {
- public void run() {
- cleanupOverFlowCoverCache();
- }
- };
- Timer timer = new Timer("CoverCleanupManager");
- long delay = 120000L;
- long period = 300000L;
- timer.scheduleAtFixedRate(repeatedTask, delay, period);
+ TimerTask repeatedTask = new TimerTask() {
+ public void run() {
+ cleanupOverFlowCoverCache();
+ }
+ };
+ Timer timer = new Timer("CoverCleanupManager");
+ long delay = 120000L;
+ long period = 300000L;
+ timer.scheduleAtFixedRate(repeatedTask, delay, period);
}
-
+
public static int cleanupOverFlowCoverCache() {
ObjMap cache = mOverflowCache;
int aRemoved = 0;
@@ -376,8 +421,8 @@ public class Meta_GT_Proxy {
}
return aRemoved;
}
-
-
+
+
static GT_Proxy[] mProxies = new GT_Proxy[2];
/**
@@ -386,47 +431,47 @@ public class Meta_GT_Proxy {
public static Object getFieldFromGregtechProxy(boolean client, String fieldName) {
return StaticFields59.getFieldFromGregtechProxy(fieldName);
}
-
+
public static void setCustomGregtechTooltip(String aNbtTagName, FormattedTooltipString aData) {
mCustomGregtechMetaTooltips.put(aNbtTagName, aData);
}
-
- public static void conStructGtTileBlockTooltip(ItemStack aStack, EntityPlayer aPlayer, List