diff options
author | Alkalus <Draknyte1@hotmail.com> | 2020-05-25 15:56:44 +0100 |
---|---|---|
committer | Alkalus <Draknyte1@hotmail.com> | 2020-05-25 15:56:44 +0100 |
commit | d97f90bfc6c7f799d2986c0b40c9c4a89ba45ee1 (patch) | |
tree | cb79d04262fb42dde1db388abb0782e9d7076954 /src | |
parent | 6f6a22a69f307db13a94aef472e5aab6876791db (diff) | |
download | GT5-Unofficial-d97f90bfc6c7f799d2986c0b40c9c4a89ba45ee1.tar.gz GT5-Unofficial-d97f90bfc6c7f799d2986c0b40c9c4a89ba45ee1.tar.bz2 GT5-Unofficial-d97f90bfc6c7f799d2986c0b40c9c4a89ba45ee1.zip |
+ Added steam tier I/O buses & input hatch.
+ Added recipes for the custom steam hatch, buses and Macerator controller.
% Changed Steam Grinder Meta ID.
% Moved some logic internal to the SteamMultiBase class. (Handling of output buffering, bus/hatch handling and recipes)
$ Fixed spelling of Maintenance in most multiblock tooltips.
Diffstat (limited to 'src')
9 files changed, 1050 insertions, 66 deletions
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 391073dcc2..cc51a9dcb2 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -4,6 +4,7 @@ import static gtPlusPlus.core.lib.CORE.GTNH; import codechicken.nei.api.API; import cpw.mods.fml.common.Loader; +import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -629,6 +630,35 @@ public class RECIPES_Machines { RECIPE_SteamCondenser); } + ItemStack aBronzeBricks = ItemUtils.simpleMetaStack(GregTech_API.sBlockCasings1, 10, 1); + // Steam Macerator Multi + RecipeUtils.addShapedGregtechRecipe( + aBronzeBricks, ALLOY.POTIN.getGear(1), aBronzeBricks, + aBronzeBricks, ALLOY.POTIN.getFrameBox(1), aBronzeBricks, + aBronzeBricks, ALLOY.POTIN.getGear(1), aBronzeBricks, + GregtechItemList.Controller_SteamMaceratorMulti.get(1)); + + // Steam Hatch + RecipeUtils.addShapedGregtechRecipe( + "plateBronze", "pipeMediumBronze", "plateBronze", + "plateBronze", GregtechItemList.GT_FluidTank_ULV.get(1), "plateBronze", + "plateBronze", "pipeMediumBronze", "plateBronze", + GregtechItemList.Hatch_Input_Steam.get(1)); + + // Steam Input Bus + RecipeUtils.addShapedGregtechRecipe( + "plateBronze", ALLOY.POTIN.getPlate(1), "plateBronze", + "plateTin", ItemUtils.getSimpleStack(Blocks.chest), "plateTin", + "plateBronze", ALLOY.POTIN.getPlate(1), "plateBronze", + GregtechItemList.Hatch_Input_Bus_Steam.get(1)); + + // Steam Output Bus + RecipeUtils.addShapedGregtechRecipe( + "plateBronze", "plateTin", "plateBronze", + ALLOY.POTIN.getPlate(1), ItemUtils.getSimpleStack(Blocks.chest), ALLOY.POTIN.getPlate(1), + "plateBronze", "plateTin", "plateBronze", + GregtechItemList.Hatch_Output_Bus_Steam.get(1)); + //RF Convertor if (LoadedMods.CoFHCore && CORE.ConfigSwitches.enableMachine_RF_Convetor){ diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 99bd8e916c..087858ae97 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -429,6 +429,11 @@ public enum GregtechItemList implements GregtechItemContainer { Hatch_Input_Cryotheum, Hatch_Input_Pyrotheum, Hatch_Input_Naquadah, + Hatch_Input_Steam, + + //Steam Multi Buses + Hatch_Input_Bus_Steam, + Hatch_Output_Bus_Steam, //Battery hatches for PSS diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java new file mode 100644 index 0000000000..f358d13930 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java @@ -0,0 +1,231 @@ +package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; + +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_2by2; +import gregtech.api.gui.GT_GUIContainer_2by2; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class GT_MetaTileEntity_Hatch_Steam_BusInput extends GT_MetaTileEntity_Hatch { + public GT_Recipe_Map mRecipeMap = null; + public boolean disableSort; + + public GT_MetaTileEntity_Hatch_Steam_BusInput(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, getSlots(aTier), new String[]{ + "Item Input for Steam Multiblocks", + "Shift + right click with screwdriver to toggle automatic item shuffling", + "Capacity: 4 stacks"}); + } + + public GT_MetaTileEntity_Hatch_Steam_BusInput(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 4, aDescription, aTextures); + } + + public GT_MetaTileEntity_Hatch_Steam_BusInput(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 4, aDescription, aTextures); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_IN)}; + } + + @Override + public boolean isSimpleMachine() { + return true; + } + + @Override + public boolean isFacingValid(byte aFacing) { + return true; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public boolean isValidSlot(int aIndex) { + return true; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_Steam_BusInput(mName, mTier, mDescriptionArray, mTextures); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_2by2(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, "Steam Input Bus"); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { + if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) { + fillStacksIntoFirstSlots(); + } + } + + public void updateSlots() { + for (int i = 0; i < mInventory.length; i++) + if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null; + fillStacksIntoFirstSlots(); + } + + protected void fillStacksIntoFirstSlots() { + if (disableSort) { + for (int i = 0; i < mInventory.length; i++) + if (mInventory[i] != null && mInventory[i].stackSize <= 0) + mInventory[i] = null; + } else { + for (int i = 0; i < mInventory.length; i++) + for (int j = i + 1; j < mInventory.length; j++) + if (mInventory[j] != null && (mInventory[i] == null || GT_Utility.areStacksEqual(mInventory[i], mInventory[j]))) + GT_Utility.moveStackFromSlotAToSlotB(getBaseMetaTileEntity(), getBaseMetaTileEntity(), j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1); + } + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setBoolean("disableSort", disableSort); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + disableSort = aNBT.getBoolean("disableSort"); + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (aPlayer.isSneaking()) { + disableSort = !disableSort; + GT_Utility.sendChatToPlayer(aPlayer, trans("200", "Automatic Item Shuffling: " + (disableSort ? "Disabled" : "Enabled"))); + } + } + + public String trans(String aKey, String aEnglish) { + return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false); + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aSide == getBaseMetaTileEntity().getFrontFacing() && (mRecipeMap == null || mRecipeMap.containsInput(aStack)); + } + + + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[14][17][]; + for (byte c = -1; c < 16; c++) { + if (rTextures[0][c + 1] == null) rTextures[0][c + 1] = getSideFacingActive(c); + if (rTextures[1][c + 1] == null) rTextures[1][c + 1] = getSideFacingInactive(c); + if (rTextures[2][c + 1] == null) rTextures[2][c + 1] = getFrontFacingActive(c); + if (rTextures[3][c + 1] == null) rTextures[3][c + 1] = getFrontFacingInactive(c); + if (rTextures[4][c + 1] == null) rTextures[4][c + 1] = getTopFacingActive(c); + if (rTextures[5][c + 1] == null) rTextures[5][c + 1] = getTopFacingInactive(c); + if (rTextures[6][c + 1] == null) rTextures[6][c + 1] = getBottomFacingActive(c); + if (rTextures[7][c + 1] == null) rTextures[7][c + 1] = getBottomFacingInactive(c); + if (rTextures[8][c + 1] == null) rTextures[8][c + 1] = getBottomFacingPipeActive(c); + if (rTextures[9][c + 1] == null) rTextures[9][c + 1] = getBottomFacingPipeInactive(c); + if (rTextures[10][c + 1] == null) rTextures[10][c + 1] = getTopFacingPipeActive(c); + if (rTextures[11][c + 1] == null) rTextures[11][c + 1] = getTopFacingPipeInactive(c); + if (rTextures[12][c + 1] == null) rTextures[12][c + 1] = getSideFacingPipeActive(c); + if (rTextures[13][c + 1] == null) rTextures[13][c + 1] = getSideFacingPipeInactive(c); + } + return rTextures; + } + + public ITexture[] getSideFacingActive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)}; + } + + public ITexture[] getSideFacingInactive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)}; + } + + public ITexture[] getFrontFacingActive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)}; + } + + public ITexture[] getFrontFacingInactive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)}; + } + + public ITexture[] getTopFacingActive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP)}; + } + + public ITexture[] getTopFacingInactive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP)}; + } + + public ITexture[] getBottomFacingActive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM)}; + } + + public ITexture[] getBottomFacingInactive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM)}; + } + + public ITexture[] getBottomFacingPipeActive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + public ITexture[] getBottomFacingPipeInactive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + public ITexture[] getTopFacingPipeActive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + public ITexture[] getTopFacingPipeInactive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + public ITexture[] getSideFacingPipeActive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + public ITexture[] getSideFacingPipeInactive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java new file mode 100644 index 0000000000..37dc016c1e --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java @@ -0,0 +1,172 @@ +package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; + +import gregtech.api.enums.Textures; +import gregtech.api.gui.GT_Container_2by2; +import gregtech.api.gui.GT_GUIContainer_2by2; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +public class GT_MetaTileEntity_Hatch_Steam_BusOutput extends GT_MetaTileEntity_Hatch { + public GT_MetaTileEntity_Hatch_Steam_BusOutput(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 4, new String[]{"Item Output for Steam Multiblocks", + "Capacity: 4 stacks"}); + } + + public GT_MetaTileEntity_Hatch_Steam_BusOutput(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 4, aDescription, aTextures); + } + + public GT_MetaTileEntity_Hatch_Steam_BusOutput(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 4, aDescription, aTextures); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + @Override + public boolean isSimpleMachine() { + return true; + } + + @Override + public boolean isFacingValid(byte aFacing) { + return true; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public boolean isValidSlot(int aIndex) { + return true; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_Steam_BusOutput(mName, mTier, mDescriptionArray, mTextures); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_2by2(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, "Steam Output Bus"); + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aSide == aBaseMetaTileEntity.getFrontFacing(); + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + + + @Override + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[14][17][]; + for (byte c = -1; c < 16; c++) { + if (rTextures[0][c + 1] == null) rTextures[0][c + 1] = getSideFacingActive(c); + if (rTextures[1][c + 1] == null) rTextures[1][c + 1] = getSideFacingInactive(c); + if (rTextures[2][c + 1] == null) rTextures[2][c + 1] = getFrontFacingActive(c); + if (rTextures[3][c + 1] == null) rTextures[3][c + 1] = getFrontFacingInactive(c); + if (rTextures[4][c + 1] == null) rTextures[4][c + 1] = getTopFacingActive(c); + if (rTextures[5][c + 1] == null) rTextures[5][c + 1] = getTopFacingInactive(c); + if (rTextures[6][c + 1] == null) rTextures[6][c + 1] = getBottomFacingActive(c); + if (rTextures[7][c + 1] == null) rTextures[7][c + 1] = getBottomFacingInactive(c); + if (rTextures[8][c + 1] == null) rTextures[8][c + 1] = getBottomFacingPipeActive(c); + if (rTextures[9][c + 1] == null) rTextures[9][c + 1] = getBottomFacingPipeInactive(c); + if (rTextures[10][c + 1] == null) rTextures[10][c + 1] = getTopFacingPipeActive(c); + if (rTextures[11][c + 1] == null) rTextures[11][c + 1] = getTopFacingPipeInactive(c); + if (rTextures[12][c + 1] == null) rTextures[12][c + 1] = getSideFacingPipeActive(c); + if (rTextures[13][c + 1] == null) rTextures[13][c + 1] = getSideFacingPipeInactive(c); + } + return rTextures; + } + + + + public ITexture[] getSideFacingActive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)}; + } + + public ITexture[] getSideFacingInactive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)}; + } + + public ITexture[] getFrontFacingActive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)}; + } + + public ITexture[] getFrontFacingInactive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE)}; + } + + public ITexture[] getTopFacingActive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP)}; + } + + public ITexture[] getTopFacingInactive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP)}; + } + + public ITexture[] getBottomFacingActive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM)}; + } + + public ITexture[] getBottomFacingInactive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM)}; + } + + public ITexture[] getBottomFacingPipeActive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + public ITexture[] getBottomFacingPipeInactive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + public ITexture[] getTopFacingPipeActive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + public ITexture[] getTopFacingPipeInactive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + public ITexture[] getSideFacingPipeActive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } + + public ITexture[] getSideFacingPipeInactive(byte aColor) { + return new ITexture[]{new GT_RenderedTexture(mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + } +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index ea14320f93..17bf67317b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -325,6 +325,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult private final String aRequiresMaint = "1x Maintanence Hatch";*/ public final static String TAG_HIDE_HATCHES = "TAG_HIDE_HATCHES"; + public final static String TAG_HIDE_MAINT = "TAG_HIDE_MAINT"; public final static String TAG_HIDE_POLLUTION = "TAG_HIDE_POLLUTION"; public final static String TAG_HIDE_MACHINE_TYPE = "TAG_HIDE_MACHINE_TYPE"; @@ -348,13 +349,14 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult String aRequiresMuffler = "1x Muffler Hatch"; //String aRequiresCoreModule = "1x Core Module"; - String aRequiresMaint = "1x Maintanence Hatch"; + String aRequiresMaint = "1x Maintenance Hatch"; String[] x = getTooltip(); //Filter List, toggle switches, rebuild map without flags boolean showHatches = true; boolean showMachineType = true; + boolean showMaint = true; boolean showPollution = getPollutionPerTick(null) > 0; AutoMap<String> aTempMap = new AutoMap<String>(); for (int ee = 0; ee < x.length; ee++) { @@ -368,6 +370,9 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult else if (hh.equals(TAG_HIDE_MACHINE_TYPE)) { showMachineType = false; } + else if (hh.equals(TAG_HIDE_MAINT)) { + showMaint = false; + } else { aTempMap.put(x[ee]); } @@ -382,11 +387,13 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult //Assemble ordered map for misc tooltips AutoMap<String> aOrderedMap = new AutoMap<String>(); if (showHatches) { - aOrderedMap.put(aRequiresMaint); //aOrderedMap.put(aRequiresCoreModule); if (showPollution) { aOrderedMap.put(aRequiresMuffler); } + if (showMaint) { + aOrderedMap.put(aRequiresMaint); + } } if (showMachineType) { @@ -478,7 +485,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult public int canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes, boolean aAllow16SlotWithoutCheck) { - Logger.INFO("Determining if we have space to buffer outputs. Parallel: "+aParallelRecipes); + log("Determining if we have space to buffer outputs. Parallel: "+aParallelRecipes); // Null recipe or a recipe with lots of outputs? // E.G. Gendustry custom comb with a billion centrifuge outputs? @@ -510,7 +517,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult */ if (aDoesOutputItems) { - Logger.INFO("We have items to output."); + log("We have items to output."); // How many slots are free across all the output buses? int aInputBusSlotsFree = 0; @@ -628,9 +635,9 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult if (aInputMap.size() > aInputBusSlotsFree) { aParallelRecipes = (int) Math.floor((double) aInputBusSlotsFree/aInputMap.size() * aParallelRecipes); // We do not have enough free slots in total to accommodate the remaining managed stacks. - Logger.INFO(" Free: "+aInputBusSlotsFree+", Required: "+aInputMap.size()); + log(" Free: "+aInputBusSlotsFree+", Required: "+aInputMap.size()); if(aParallelRecipes == 0) { - Logger.INFO("Failed to find enough space for all item outputs."); + log("Failed to find enough space for all item outputs."); return 0; } @@ -655,7 +662,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult if (aDoesOutputFluids) { - Logger.INFO("We have Fluids to output."); + log("We have Fluids to output."); // How many slots are free across all the output buses? int aFluidHatches = 0; int aEmptyFluidHatches = 0; @@ -783,12 +790,12 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult } // We have Fluid Stacks we did not merge. Do we have space? - Logger.INFO("fluids to output "+aOutputFluids.size()+" empty hatches "+aEmptyFluidHatches); + log("fluids to output "+aOutputFluids.size()+" empty hatches "+aEmptyFluidHatches); if (aOutputFluids.size() > 0) { // Not enough space to add fluids. if (aOutputFluids.size() > aEmptyFluidHatches) { aParallelRecipes = (int) Math.floor((double) aEmptyFluidHatches/aOutputFluids.size() * aParallelRecipes); - Logger.INFO("Failed to find enough space for all fluid outputs. Free: "+aEmptyFluidHatches+", Required: "+aOutputFluids.size()); + log("Failed to find enough space for all fluid outputs. Free: "+aEmptyFluidHatches+", Required: "+aOutputFluids.size()); return 0; } @@ -922,18 +929,18 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult * log("parallelRecipes: "+parallelRecipes); * log("aMaxParallelRecipes: "+aMaxParallelRecipes); * log("tTotalEUt: "+tTotalEUt); log("tVoltage: "+tVoltage); - * log("tRecipeEUt: "+tRecipeEUt); Logger.INFO("EU1: "+tRecipeEUt); // Count + * log("tRecipeEUt: "+tRecipeEUt); log("EU1: "+tRecipeEUt); // Count * recipes to do in parallel, consuming input items and fluids and considering * input voltage limits for (; parallelRecipes < aMaxParallelRecipes && * tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { if * (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { * log("Broke at "+parallelRecipes+"."); break; } * log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); tTotalEUt - * += tRecipeEUt; Logger.INFO("EU2: "+tTotalEUt); } + * += tRecipeEUt; log("EU2: "+tTotalEUt); } * * if (parallelRecipes == 0) { log("BAD RETURN - 3"); return false; } * - * Logger.INFO("EU3: "+tTotalEUt); + * log("EU3: "+tTotalEUt); * * // -- Try not to fail after this point - inputs have already been consumed! * -- @@ -945,7 +952,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult * aSpeedBonusPercent); this.mMaxProgresstime = (int)(tRecipe.mDuration * * tTimeFactor * 10000); * - * int aTempEu = (int) Math.floor(tTotalEUt); Logger.INFO("EU4: "+aTempEu); + * int aTempEu = (int) Math.floor(tTotalEUt); log("EU4: "+aTempEu); * this.mEUt = (int) aTempEu; * * @@ -1912,7 +1919,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult //Handle Fluid Hatches using seperate logic else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) - aDidAdd = addFluidInputToMachineList(aMetaTileEntity, aBaseCasingIndex); + aDidAdd = addToMachineListInternal(mInputHatches, aMetaTileEntity, aBaseCasingIndex); else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) aDidAdd = addToMachineListInternal(mOutputHatches, aMetaTileEntity, aBaseCasingIndex); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java index 083af9f2f5..a15388b27b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java @@ -12,19 +12,25 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.*; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gtPlusPlus.api.objects.Logger; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.data.*; import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusInput; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusOutput; +import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; public abstract class GregtechMeta_SteamMultiBase extends GregtechMeta_MultiBlockBase { - - private int aMaxParallelForCurrentRecipe = 0; + + public ArrayList<GT_MetaTileEntity_Hatch_Steam_BusInput> mSteamInputs = new ArrayList<GT_MetaTileEntity_Hatch_Steam_BusInput>(); + public ArrayList<GT_MetaTileEntity_Hatch_Steam_BusOutput> mSteamOutputs = new ArrayList<GT_MetaTileEntity_Hatch_Steam_BusOutput>(); + public ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase> mSteamInputFluids = new ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase>(); public GregtechMeta_SteamMultiBase(String aName) { super(aName); @@ -47,12 +53,12 @@ public abstract class GregtechMeta_SteamMultiBase extends GregtechMeta_MultiBloc protected abstract GT_RenderedTexture getFrontOverlayActive(); private int getCasingTextureIndex() { - return 0; + return 10; } @Override public boolean hasSlotInGUI() { - return false; + return true; } @Override @@ -68,6 +74,7 @@ public abstract class GregtechMeta_SteamMultiBase extends GregtechMeta_MultiBloc @Override public boolean checkRecipe(ItemStack arg0) { + log("Running checkRecipeGeneric(0)"); ArrayList<ItemStack> tItems = getStoredInputs(); ArrayList<FluidStack> tFluids = getStoredFluids(); @@ -79,6 +86,7 @@ public abstract class GregtechMeta_SteamMultiBase extends GregtechMeta_MultiBloc FluidStack[] aFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]); GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[1], null, null, aItemInputs); if (tRecipe == null) { + log("BAD RETURN - 1"); return false; } @@ -98,12 +106,12 @@ public abstract class GregtechMeta_SteamMultiBase extends GregtechMeta_MultiBloc this.mLastRecipe = tRecipe; - int aMaxParallelRecipes = this.canBufferOutputs(tRecipe, this.getMaxParallelRecipes()); + int aMaxParallelRecipes = canBufferOutputs(tRecipe.mOutputs, tRecipe.mFluidOutputs, this.getMaxParallelRecipes()); if (aMaxParallelRecipes == 0) { log("BAD RETURN - 2"); return false; } - aMaxParallelForCurrentRecipe = aMaxParallelRecipes; + // EU discount float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; float tTotalEUt = 0.0f; @@ -140,9 +148,9 @@ public abstract class GregtechMeta_SteamMultiBase extends GregtechMeta_MultiBloc // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent); - this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor * 2); + this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor * 1.5f); - this.mEUt = (int)Math.ceil(tTotalEUt * 3); + this.mEUt = (int)Math.ceil(tTotalEUt*1.33f); //this.mEUt = (3 * tRecipe.mEUt); @@ -156,22 +164,10 @@ public abstract class GregtechMeta_SteamMultiBase extends GregtechMeta_MultiBloc this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); // Collect fluid outputs - FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length]; - for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) { - if (tRecipe.getFluidOutput(h) != null) { - tOutputFluids[h] = tRecipe.getFluidOutput(h).copy(); - tOutputFluids[h].amount *= parallelRecipes; - } - } + FluidStack[] tOutputFluids = getOutputFluids(tRecipe, parallelRecipes); // Collect output item types - ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length]; - for (int h = 0; h < tRecipe.mOutputs.length; h++) { - if (tRecipe.getOutput(h) != null) { - tOutputItems[h] = tRecipe.getOutput(h).copy(); - tOutputItems[h].stackSize = 0; - } - } + ItemStack[] tOutputItems = getOutputItems(tRecipe); // Set output item stack sizes (taking output chance into account) for (int f = 0; f < tOutputItems.length; f++) { @@ -212,7 +208,6 @@ public abstract class GregtechMeta_SteamMultiBase extends GregtechMeta_MultiBloc // Commit outputs this.mOutputItems = tOutputItems; this.mOutputFluids = tOutputFluids; - aMaxParallelForCurrentRecipe = 0; updateSlots(); // Play sounds (GT++ addition - GT multiblocks play no sounds) @@ -256,15 +251,26 @@ public abstract class GregtechMeta_SteamMultiBase extends GregtechMeta_MultiBloc return 0; } + @Override + public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + if (this.mUpdate == 1 || this.mStartUpCheck == 1) { + this.mSteamInputs.clear(); + this.mSteamOutputs.clear(); + this.mSteamInputFluids.clear(); + } + } + super.onPostTick(aBaseMetaTileEntity, aTick); + } /** * Called every tick the Machine runs */ public boolean onRunningTick(ItemStack aStack) { + fixAllMaintenanceIssue(); if (mEUt < 0) { long aSteamVal = (((long) -mEUt * 10000) / Math.max(1000, mEfficiency)); - Logger.INFO("Trying to drain "+aSteamVal+" steam per tick."); - //aMaxParallelForCurrentRecipe + //Logger.INFO("Trying to drain "+aSteamVal+" steam per tick."); if (!tryConsumeSteam((int) aSteamVal)) { stopMachine(); return false; @@ -272,23 +278,519 @@ public abstract class GregtechMeta_SteamMultiBase extends GregtechMeta_MultiBloc } return true; } - + @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setInteger("aMaxParallelForCurrentRecipe", aMaxParallelForCurrentRecipe); - } + public boolean addToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - aMaxParallelForCurrentRecipe = aNBT.getInteger("aMaxParallelForCurrentRecipe"); + //Use this to determine the correct value, then update the hatch texture after. + boolean aDidAdd = false; + + //Handle Custom Hustoms + + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase) + aDidAdd = addToMachineListInternal(mSteamInputFluids, aMetaTileEntity, aBaseCasingIndex); + + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput) + aDidAdd = addToMachineListInternal(mSteamInputs, aMetaTileEntity, aBaseCasingIndex); + + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusOutput) + aDidAdd = addToMachineListInternal(mSteamOutputs, aMetaTileEntity, aBaseCasingIndex); + + return aDidAdd; } + + + @Override public void stopMachine() { super.stopMachine(); - aMaxParallelForCurrentRecipe = 0; } + + public FluidStack[] getOutputFluids(GT_Recipe aRecipe, int parallelRecipes) { + // Collect fluid outputs + FluidStack[] tOutputFluids = new FluidStack[aRecipe.mFluidOutputs.length]; + for (int h = 0; h < aRecipe.mFluidOutputs.length; h++) { + if (aRecipe.getFluidOutput(h) != null) { + tOutputFluids[h] = aRecipe.getFluidOutput(h).copy(); + tOutputFluids[h].amount *= parallelRecipes; + } + } + return tOutputFluids; + } + + public ItemStack[] getOutputItems(GT_Recipe aRecipe) { + // Collect output item types + ItemStack[] tOutputItems = new ItemStack[aRecipe.mOutputs.length]; + for (int h = 0; h < aRecipe.mOutputs.length; h++) { + if (aRecipe.getOutput(h) != null) { + tOutputItems[h] = aRecipe.getOutput(h).copy(); + tOutputItems[h].stackSize = 0; + } + } + return tOutputItems; + } + + public int getOutputCount(ItemStack[] aOutputs) { + return aOutputs.length; + } + public int getOutputFluidCount(FluidStack[] aOutputs) { + return aOutputs.length; + } + + public int canBufferOutputs(final ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int aParallelRecipes) { + + log("Determining if we have space to buffer outputs. Parallel: "+aParallelRecipes); + + // Null recipe or a recipe with lots of outputs? + // E.G. Gendustry custom comb with a billion centrifuge outputs? + // Do it anyway, provided the multi allows it. Default behaviour is aAllow16SlotWithoutCheck = true. + if (aOutputs == null && aFluidOutputs == null) { + return 0; + } + + // Do we even need to check for item outputs? + boolean aDoesOutputItems = aOutputs != null ? aOutputs.length > 0 : false; + // Do we even need to check for fluid outputs? + boolean aDoesOutputFluids = aFluidOutputs != null ? aFluidOutputs.length > 0 : false; + + if (!aDoesOutputItems && !aDoesOutputFluids) { + return 0; + } + + /* ======================================== + * Item Management + * ======================================== + */ + + if (aDoesOutputItems) { + log("We have items to output."); + + // How many slots are free across all the output buses? + int aInputBusSlotsFree = 0; + + /* + * Create Variables for Item Output + */ + + AutoMap<FlexiblePair<ItemStack, Integer>> aItemMap = new AutoMap<FlexiblePair<ItemStack, Integer>>(); + AutoMap<ItemStack> aItemOutputs = new AutoMap<ItemStack>(aOutputs); + + for (final GT_MetaTileEntity_Hatch_Steam_BusOutput tBus : this.mSteamOutputs) { + if (!isValidMetaTileEntity(tBus)) { + continue; + } + final IInventory tBusInv = tBus.getBaseMetaTileEntity(); + for (int i = 0; i < tBusInv.getSizeInventory(); i++) { + if (tBus.getStackInSlot(i) == null) { + aInputBusSlotsFree++; + } + else { + ItemStack aT = tBus.getStackInSlot(i); + int aSize = aT.stackSize; + aT = aT.copy(); + aT.stackSize = 0; + aItemMap.put(new FlexiblePair<ItemStack, Integer>(aT, aSize)); + } + } + } + + // Count the slots we need, later we can check if any are able to merge with existing stacks + int aRecipeSlotsRequired = 0; + + // A map to hold the items we will be 'inputting' into the output buses. These itemstacks are actually the recipe outputs. + ConcurrentSet<FlexiblePair<ItemStack, Integer>> aInputMap = new ConcurrentHashSet<FlexiblePair<ItemStack, Integer>>(); + + // Iterate over the outputs, calculating require stack spacing they will require. + for (int i=0;i<getOutputCount(aOutputs);i++) { + ItemStack aY = aItemOutputs.get(i); + if (aY == null) { + continue; + } + else { + int aStackSize = aY.stackSize * aParallelRecipes; + if (aStackSize > 64) { + int aSlotsNeedsForThisStack = (int) Math.ceil((double) ((float) aStackSize / 64f)); + // Should round up and add as many stacks as required nicely. + aRecipeSlotsRequired += aSlotsNeedsForThisStack; + for (int o=0;o<aRecipeSlotsRequired;o++) { + int aStackToRemove = (aStackSize -= 64) > 64 ? 64 : aStackSize; + aY = aY.copy(); + aY.stackSize = 0; + aInputMap.add(new FlexiblePair<ItemStack, Integer>(aY, aStackToRemove)); + } + } + else { + // Only requires one slot + aRecipeSlotsRequired++; + aY = aY.copy(); + aY.stackSize = 0; + aInputMap.add(new FlexiblePair<ItemStack, Integer>(aY, aStackSize)); + } + } + } + + // We have items to add to the output buses. See if any are not full stacks and see if we can make them full. + if (aInputMap.size() > 0) { + // Iterate over the current stored items in the Output busses, if any match and are not full, we can try account for merging. + busItems: for (FlexiblePair<ItemStack, Integer> y : aItemMap) { + // Iterate over the 'inputs', we can safely remove these as we go. + outputItems: for (FlexiblePair<ItemStack, Integer> u : aInputMap) { + // Create local vars for readability. + ItemStack aOutputBusStack = y.getKey(); + ItemStack aOutputStack = u.getKey(); + // Stacks match, including NBT. + if (GT_Utility.areStacksEqual(aOutputBusStack, aOutputStack, false)) { + // Stack Matches, but it's full, continue. + if (aOutputBusStack.stackSize >= 64) { + // This stack is full, no point checking it. + continue busItems; + } + else { + // We can merge these two stacks without any hassle. + if ((aOutputBusStack.stackSize + aOutputStack.stackSize) <= 64) { + // Update the stack size in the bus storage map. + y.setValue(aOutputBusStack.stackSize + aOutputStack.stackSize); + // Remove the 'input' stack from the recipe outputs, so we don't try count it again. + aInputMap.remove(u); + continue outputItems; + } + // Stack merging is too much, so we fill this stack, leave the remainder. + else { + int aRemainder = (aOutputBusStack.stackSize + aOutputStack.stackSize) - 64; + // Update the stack size in the bus storage map. + y.setValue(64); + // Create a new object to iterate over later, with the remainder data; + FlexiblePair<ItemStack, Integer> t = new FlexiblePair<ItemStack, Integer>(u.getKey(), aRemainder); + // Remove the 'input' stack from the recipe outputs, so we don't try count it again. + aInputMap.remove(u); + // Add the remainder stack. + aInputMap.add(t); + continue outputItems; + } + } + } + else { + continue outputItems; + } + } + } + } + + // We have stacks that did not merge, do we have space for them? + if (aInputMap.size() > 0) { + if (aInputMap.size() > aInputBusSlotsFree) { + aParallelRecipes = (int) Math.floor((double) aInputBusSlotsFree/aInputMap.size() * aParallelRecipes); + // We do not have enough free slots in total to accommodate the remaining managed stacks. + log(" Free: "+aInputBusSlotsFree+", Required: "+aInputMap.size()); + if(aParallelRecipes == 0) { + log("Failed to find enough space for all item outputs."); + return 0; + } + + } + } + + /* + * End Item Management + */ + + } + + + + + + /* ======================================== + * Fluid Management + * ======================================== + */ + + + + if (aDoesOutputFluids) { + log("We have Fluids to output."); + // How many slots are free across all the output buses? + int aFluidHatches = 0; + int aEmptyFluidHatches = 0; + int aFullFluidHatches = 0; + // Create Map for Fluid Output + ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>> aOutputHatches = new ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>>(); + for (final GT_MetaTileEntity_Hatch_Output tBus : this.mOutputHatches) { + if (!isValidMetaTileEntity(tBus)) { + continue; + } + aFluidHatches++; + // Map the Hatch with the space left for easy checking later. + if (tBus.getFluid() == null) { + aOutputHatches.add(new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(tBus, null, tBus.getCapacity())); + } + else { + int aSpaceLeft = tBus.getCapacity() - tBus.getFluidAmount(); + aOutputHatches.add(new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(tBus, tBus.getFluid(), aSpaceLeft)); + } + } + // Create a map of all the fluids we would like to output, we can iterate over this and see how many we can merge into existing hatch stacks. + ArrayList<FluidStack> aOutputFluids = new ArrayList<FluidStack>(); + // Ugly ass boxing + aOutputFluids.addAll(new AutoMap<FluidStack>(aFluidOutputs)); + // Iterate the Hatches, updating their 'stored' data. + //for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aHatchData : aOutputHatches) { + for (int i = 0;i<aOutputHatches.size();i++) { + // The Hatch Itself + GT_MetaTileEntity_Hatch_Output aHatch = aOutputHatches.get(i).getValue_1(); + // Fluid in the Hatch + FluidStack aHatchStack = aOutputHatches.get(i).getValue_2(); + // Space left in Hatch + int aSpaceLeftInHatch = aHatch.getCapacity() - aHatch.getFluidAmount(); + // Hatch is full, + if (aSpaceLeftInHatch <= 0) { + aFullFluidHatches++; + aOutputHatches.remove(aOutputHatches.get(i)); + i--; + continue; + } + // Hatch has space + else { + // Check if any fluids match + //aFluidMatch: for (FluidStack aOutputStack : aOutputFluids) { + for(int j = 0;j<getOutputFluidCount(aFluidOutputs);j++) { + //log(" aHatchStack "+aHatchStack.getLocalizedName()+" aOutput stack "+aOutputStack.getLocalizedName()); + if (GT_Utility.areFluidsEqual(aHatchStack, aOutputFluids.get(j))) { + int aFluidToPutIntoHatch = aOutputFluids.get(j).amount * aParallelRecipes; + // Not Enough space to insert all of the fluid. + // We fill this hatch and add a smaller Fluidstack back to the iterator. + if (aSpaceLeftInHatch < aFluidToPutIntoHatch) { + // Copy existing Hatch Stack + FluidStack aNewHatchStack = aHatchStack.copy(); + aNewHatchStack.amount = 0; + // Copy existing Hatch Stack again + FluidStack aNewOutputStack = aHatchStack.copy(); + aNewOutputStack.amount = 0; + // How much fluid do we have left after we fill the hatch? + int aFluidLeftAfterInsert = aFluidToPutIntoHatch - aSpaceLeftInHatch; + // Set new stacks to appropriate values + aNewHatchStack.amount = aHatch.getCapacity(); + aNewOutputStack.amount = aFluidLeftAfterInsert; + // Remove fluid from output list, merge success + aOutputFluids.remove(aOutputFluids.get(j)); + j--; + // Remove hatch from hatch list, data is now invalid. + aOutputHatches.remove(aOutputHatches.get(i)); + i--; + // Add remaining Fluid to Output list + aOutputFluids.add(aNewOutputStack); + // Re-add hatch to hatch list, with new data. + //Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount); + //aOutputHatches.add(aNewHatchData); + break; + } + // We can fill this hatch perfectly (rare case), may as well add it directly to the full list. + else if (aSpaceLeftInHatch == aFluidToPutIntoHatch) { + // Copy Old Stack + FluidStack aNewHatchStack = aHatchStack.copy(); + // Add in amount from output stack + aNewHatchStack.amount += aFluidToPutIntoHatch; + // Remove fluid from output list, merge success + aOutputFluids.remove(aOutputFluids.get(j)); + j--; + // Remove hatch from hatch list, data is now invalid. + aOutputHatches.remove(aOutputHatches.get(i)); + i--; + // Re-add hatch to hatch list, with new data. + Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount); + aOutputHatches.add(aNewHatchData); + break; + } + // We have more space than we need to merge, so we remove the stack from the output list and update the hatch list. + else { + // Copy Old Stack + FluidStack aNewHatchStack = aHatchStack.copy(); + // Add in amount from output stack + aNewHatchStack.amount += aFluidToPutIntoHatch; + // Remove fluid from output list, merge success + aOutputFluids.remove(aOutputFluids.get(j)); + j--; + // Remove hatch from hatch list, data is now invalid. + aOutputHatches.remove(aOutputHatches.get(i)); + i--; + // Re-add hatch to hatch list, with new data. + Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount); + aOutputHatches.add(aNewHatchData); + // Check next fluid + continue; + } + + } + else { + continue; + } + } + } + } + + for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aFreeHatchCheck : aOutputHatches) { + // Free Hatch + if (aFreeHatchCheck.getValue_2() == null || aFreeHatchCheck.getValue_3() == 0 || aFreeHatchCheck.getValue_1().getFluid() == null) { + aEmptyFluidHatches++; + } + } + + // We have Fluid Stacks we did not merge. Do we have space? + log("fluids to output "+aOutputFluids.size()+" empty hatches "+aEmptyFluidHatches); + if (aOutputFluids.size() > 0) { + // Not enough space to add fluids. + if (aOutputFluids.size() > aEmptyFluidHatches) { + aParallelRecipes = (int) Math.floor((double) aEmptyFluidHatches/aOutputFluids.size() * aParallelRecipes); + log("Failed to find enough space for all fluid outputs. Free: "+aEmptyFluidHatches+", Required: "+aOutputFluids.size()); + return 0; + + } + } + + /* + * End Fluid Management + */ + } + + return aParallelRecipes; + } + + + /* + * Handle I/O with custom hatches + */ + + @Override + public boolean depleteInput(FluidStack aLiquid) { + if (aLiquid == null) return false; + for (GT_MetaTileEntity_Hatch_Input tHatch : mSteamInputFluids) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + FluidStack tLiquid = tHatch.getFluid(); + if (tLiquid != null && tLiquid.isFluidEqual(aLiquid)) { + tLiquid = tHatch.drain(aLiquid.amount, false); + if (tLiquid != null && tLiquid.amount >= aLiquid.amount) { + tLiquid = tHatch.drain(aLiquid.amount, true); + return tLiquid != null && tLiquid.amount >= aLiquid.amount; + } + } + } + } + return false; + } + + @Override + public boolean depleteInput(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return false; + FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true); + if (aLiquid != null) return depleteInput(aLiquid); + for (GT_MetaTileEntity_Hatch_Input tHatch : mSteamInputFluids) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(0))) { + if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) { + tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize); + return true; + } + } + } + } + for (GT_MetaTileEntity_Hatch_Steam_BusInput tHatch : mSteamInputs) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { + if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(i))) { + if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) { + tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize); + return true; + } + } + } + } + } + return false; + } + + @Override + public ArrayList<FluidStack> getStoredFluids() { + ArrayList<FluidStack> rList = new ArrayList<FluidStack>(); + for (GT_MetaTileEntity_Hatch_Input tHatch : mSteamInputFluids) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) { + rList.add(tHatch.getFillableStack()); + } + } + return rList; + } + + @Override + public ArrayList<ItemStack> getStoredInputs() { + ArrayList<ItemStack> rList = new ArrayList<ItemStack>(); + for (GT_MetaTileEntity_Hatch_Steam_BusInput tHatch : mSteamInputs) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { + if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null) { + rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); + } + } + } + } + return rList; + } + + @Override + public boolean addOutput(ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return false; + aStack = GT_Utility.copy(aStack); + boolean outputSuccess = true; + while (outputSuccess && aStack.stackSize > 0) { + outputSuccess = false; + ItemStack single = aStack.splitStack(1); + for (GT_MetaTileEntity_Hatch_Steam_BusOutput tHatch : mSteamOutputs) { + if (!outputSuccess && isValidMetaTileEntity(tHatch)) { + for (int i = tHatch.getSizeInventory() - 1; i >= 0 && !outputSuccess; i--) { + if (tHatch.getBaseMetaTileEntity().addStackToSlot(i, single)) outputSuccess = true; + } + } + } + for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { + if (!outputSuccess && isValidMetaTileEntity(tHatch) && tHatch.outputsItems()) { + if (tHatch.getBaseMetaTileEntity().addStackToSlot(1, single)) outputSuccess = true; + } + } + } + return outputSuccess; + } + + @Override + public ArrayList<ItemStack> getStoredOutputs() { + ArrayList<ItemStack> rList = new ArrayList<ItemStack>(); + for (GT_MetaTileEntity_Hatch_Steam_BusOutput tHatch : mSteamOutputs) { + if (isValidMetaTileEntity(tHatch)) { + for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { + rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); + } + } + } + return rList; + } + + @Override + public void updateSlots() { + for (GT_MetaTileEntity_Hatch_Input tHatch : mSteamInputFluids) + if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots(); + for (GT_MetaTileEntity_Hatch_Steam_BusInput tHatch : mSteamInputs) + if (isValidMetaTileEntity(tHatch)) tHatch.updateSlots(); + } + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java index 6e87e4c191..06d63867da 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java @@ -1,6 +1,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.steam; -import static gregtech.api.GregTech_API.sBlockCasings4; +import static gregtech.api.GregTech_API.sBlockCasings1; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; @@ -16,7 +16,7 @@ import net.minecraftforge.common.util.ForgeDirection; public class GregtechMetaTileEntity_SteamMacerator extends GregtechMeta_SteamMultiBase { - private String mCasingName = "Robust Tungstensteel Machine Casing"; + private String mCasingName = "Bronze Plated Bricks"; public GregtechMetaTileEntity_SteamMacerator(String aName) { super(aName); @@ -37,12 +37,12 @@ public class GregtechMetaTileEntity_SteamMacerator extends GregtechMeta_SteamMul @Override protected GT_RenderedTexture getFrontOverlay() { - return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR); + return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR); } @Override protected GT_RenderedTexture getFrontOverlayActive() { - return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE); + return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE); } @Override @@ -53,16 +53,17 @@ public class GregtechMetaTileEntity_SteamMacerator extends GregtechMeta_SteamMul @Override public String[] getTooltip() { if (mCasingName.contains("gt.blockcasings")) { - mCasingName = ItemList.Casing_RobustTungstenSteel.get(1).getDisplayName(); + mCasingName = ItemList.Casing_BronzePlatedBricks.get(1).getDisplayName(); } return new String[]{ "Controller Block for the Steam Macerator", "Macerates "+getMaxParallelRecipes()+" ores at a time", "Size(WxHxD): 3x3x3 (Hollow), Controller (Front centered)", "1x Input Bus (Any casing)", - "1x Steam Hatch (Any casing)", "1x Output Bus (Any casing)", - mCasingName+"s for the rest (16 at least!)" + "1x Steam Hatch (Any casing)", + mCasingName+" for the rest (14 at least!)", + TAG_HIDE_MAINT }; } @@ -93,9 +94,9 @@ public class GregtechMetaTileEntity_SteamMacerator extends GregtechMeta_SteamMul Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j); int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); - if (!isValidBlockForStructure(tTileEntity, 48, true, aBlock, aMeta, - sBlockCasings4, 0)) { - Logger.INFO("Bad centrifuge casing"); + if (!isValidBlockForStructure(tTileEntity, 10, true, aBlock, aMeta, + sBlockCasings1, 10)) { + Logger.INFO("Bad macerator casing"); return false; } ++tAmount; @@ -104,9 +105,30 @@ public class GregtechMetaTileEntity_SteamMacerator extends GregtechMeta_SteamMul } } } - return tAmount >= 10; + if (tAmount >= 14) { + fixAllMaintenanceIssue(); + } + return tAmount >= 14; } } + + @Override + public ItemStack[] getOutputItems(GT_Recipe aRecipe) { + // Collect output item types + ItemStack[] tOutputItems = new ItemStack[1]; + for (int h = 0; h < 1; h++) { + if (aRecipe.getOutput(h) != null) { + tOutputItems[h] = aRecipe.getOutput(h).copy(); + tOutputItems[h].stackSize = 0; + } + } + return tOutputItems; + } + + @Override + public int getOutputCount(ItemStack[] aOutputs) { + return 1; + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java index 2c622b9d8e..677a47639c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java @@ -74,7 +74,18 @@ public class GregtechCustomHatches { // Multiblock Air Intake Hatch GregtechItemList.Hatch_Air_Intake.set(new GT_MetaTileEntity_Hatch_AirIntake(861, "hatch.air.intake.tier.00", "Air Intake Hatch", 5).getStackForm(1L)); - + // Steam Hatch + GregtechItemList.Hatch_Input_Steam + .set(new GT_MetaTileEntity_Hatch_CustomFluidBase(FluidUtils.getSteam(1).getFluid(), // Fluid + // to + // resitrct + // hatch + // to + 64000, // Capacity + 31040, // ID + "hatch.steam.input.tier.00", // unlocal name + "Steam Hatch" // Local name + ).getStackForm(1L)); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java index cdb9eddea8..add0400d87 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java @@ -2,6 +2,8 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusInput; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusOutput; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.steam.GregtechMetaTileEntity_SteamMacerator; public class GregtechSteamMultis { @@ -10,8 +12,10 @@ public class GregtechSteamMultis { Logger.INFO("Gregtech5u Content | Registering Steam Multiblocks."); - GregtechItemList.Controller_SteamMaceratorMulti.set(new GregtechMetaTileEntity_SteamMacerator(31030, "gtpp.multimachine.steam.macerator", "Steam Grinder").getStackForm(1L)); - + GregtechItemList.Controller_SteamMaceratorMulti.set(new GregtechMetaTileEntity_SteamMacerator(31041, "gtpp.multimachine.steam.macerator", "Steam Grinder").getStackForm(1L)); + + GregtechItemList.Hatch_Input_Bus_Steam.set(new GT_MetaTileEntity_Hatch_Steam_BusInput(31046, "hatch.input_bus.tier.steam", "Input Bus (Steam)", 0).getStackForm(1L)); + GregtechItemList.Hatch_Output_Bus_Steam.set(new GT_MetaTileEntity_Hatch_Steam_BusOutput(31047, "hatch.output_bus.tier.steam", "Output Bus (Steam)", 0).getStackForm(1L)); } |