From 6d151929908f5a8f30bc04aa0e4cced84e6fb5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20G=C3=A4=C3=9Fler?= Date: Thu, 8 Jun 2017 23:22:08 +0200 Subject: [PATCH] Implemented Bricked Blast Furnace, added corresponding textures Added a new Casing for the Bricked Blast Furnace, GT_Block_Casings4, ID 15 Refactored the non-electric Blast Furnaces: The Bronze Blast Furnace and the Bricked Blast Furnace extend a superclass to ensure consistent behavior. Subclasses only differ in texture, description, and Casing Block. --- misc/vector/bricked_blast_furnace_active.svg | 1290 +++++++++++++++++ .../vector/bricked_blast_furnace_inactive.svg | 953 ++++++++++++ misc/vector/dense_bricks.svg | 1001 +++++++++++++ .../java/gregtech/api/enums/ItemList.java | 4 +- .../java/gregtech/api/enums/Textures.java | 5 +- .../common/blocks/GT_Block_Casings4.java | 6 +- ...GT_MetaTileEntity_BrickedBlastFurnace.java | 52 + .../GT_MetaTileEntity_BronzeBlastFurnace.java | 323 +---- ..._MetaTileEntity_PrimitiveBlastFurnace.java | 331 +++++ .../preload/GT_Loader_MetaTileEntities.java | 3 + ...HINE_CASING_BRICKEDBLASTFURNACE_ACTIVE.png | Bin 0 -> 705 bytes ...NE_CASING_BRICKEDBLASTFURNACE_INACTIVE.png | Bin 0 -> 645 bytes .../iconsets/MACHINE_CASING_DENSEBRICKS.png | Bin 0 -> 493 bytes 13 files changed, 3653 insertions(+), 315 deletions(-) create mode 100644 misc/vector/bricked_blast_furnace_active.svg create mode 100644 misc/vector/bricked_blast_furnace_inactive.svg create mode 100644 misc/vector/dense_bricks.svg create mode 100644 src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java create mode 100644 src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE.png create mode 100644 src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_DENSEBRICKS.png diff --git a/misc/vector/bricked_blast_furnace_active.svg b/misc/vector/bricked_blast_furnace_active.svg new file mode 100644 index 00000000..4c5b0f77 --- /dev/null +++ b/misc/vector/bricked_blast_furnace_active.svg @@ -0,0 +1,1290 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/misc/vector/bricked_blast_furnace_inactive.svg b/misc/vector/bricked_blast_furnace_inactive.svg new file mode 100644 index 00000000..de6f23d0 --- /dev/null +++ b/misc/vector/bricked_blast_furnace_inactive.svg @@ -0,0 +1,953 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/misc/vector/dense_bricks.svg b/misc/vector/dense_bricks.svg new file mode 100644 index 00000000..08889aa2 --- /dev/null +++ b/misc/vector/dense_bricks.svg @@ -0,0 +1,1001 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java index 12cad31c..a34a9ad9 100644 --- a/src/main/java/gregtech/api/enums/ItemList.java +++ b/src/main/java/gregtech/api/enums/ItemList.java @@ -520,6 +520,7 @@ public enum ItemList implements IItemContainer { Machine_Bronze_Compressor, Machine_Bronze_AlloySmelter, Machine_Bronze_BlastFurnace, + Machine_Bricked_BlastFurnace, Machine_Steel_Boiler_Lava, Machine_Steel_Boiler, Machine_Steel_Furnace, @@ -538,7 +539,8 @@ public enum ItemList implements IItemContainer { Casing_Stripes_A, Casing_Stripes_B, Casing_RadioactiveHazard, Casing_BioHazard, Casing_ExplosionHazard, Casing_FireHazard, Casing_AcidHazard, Casing_MagicHazard, Casing_FrostHazard, Casing_NoiseHazard, Casing_Grate, Casing_Vent, Casing_RadiationProof, Casing_Firebox_Bronze, Casing_Firebox_Steel, Casing_Firebox_TungstenSteel, Casing_RobustTungstenSteel, Casing_CleanStainlessSteel, Casing_StableTitanium, Casing_Firebox_Titanium, Hull_ULV, Hull_LV, Hull_MV, Hull_HV, Hull_EV, Hull_IV, Hull_LuV, Hull_ZPM, Hull_UV, Hull_MAX, - + Casing_DenseBricks, /*DenseBrick, UnfiredDenseBrick,*/ + Automation_Filter_ULV, Automation_Filter_LV, Automation_Filter_MV, Automation_Filter_HV, Automation_Filter_EV, Automation_Filter_IV, Automation_Filter_LuV, Automation_Filter_ZPM, Automation_Filter_UV, Automation_Filter_MAX, Automation_TypeFilter_ULV, Automation_TypeFilter_LV, Automation_TypeFilter_MV, Automation_TypeFilter_HV, Automation_TypeFilter_EV, Automation_TypeFilter_IV, Automation_TypeFilter_LuV, Automation_TypeFilter_ZPM, Automation_TypeFilter_UV, Automation_TypeFilter_MAX, Automation_ChestBuffer_ULV, Automation_ChestBuffer_LV, Automation_ChestBuffer_MV, Automation_ChestBuffer_HV, Automation_ChestBuffer_EV, Automation_ChestBuffer_IV, Automation_ChestBuffer_LuV, Automation_ChestBuffer_ZPM, Automation_ChestBuffer_UV, Automation_ChestBuffer_MAX, diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index d2894ad7..128833ab 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -36,8 +36,9 @@ public class Textures { MACHINE_CASING_GEARBOX_BRONZE, MACHINE_CASING_GEARBOX_STEEL, MACHINE_CASING_GEARBOX_TITANIUM, MACHINE_CASING_GEARBOX_TUNGSTENSTEEL, MACHINE_CASING_DATA_DRIVE, MACHINE_CASING_CONTAINMENT_FIELD, MACHINE_CASING_ASSEMBLER, MACHINE_CASING_PROCESSOR, MACHINE_CASING_STRIPES_A, MACHINE_CASING_STRIPES_B, MACHINE_CASING_RADIOACTIVEHAZARD, MACHINE_CASING_BIOHAZARD, MACHINE_CASING_EXPLOSIONHAZARD, MACHINE_CASING_FIREHAZARD, MACHINE_CASING_ACIDHAZARD, MACHINE_CASING_MAGICHAZARD, MACHINE_CASING_FROSTHAZARD, MACHINE_CASING_NOISEHAZARD, MACHINE_CASING_GRATE, MACHINE_CASING_VENT, - MACHINE_CASING_RADIATIONPROOF, MACHINE_CASING_FIREBOX_BRONZE, MACHINE_CASING_FIREBOX_STEEL, MACHINE_CASING_FIREBOX_TUNGSTENSTEEL, MACHINE_CASING_ENGINE_INTAKE, MACHINE_COIL_CUPRONICKEL, - MACHINE_COIL_KANTHAL, MACHINE_COIL_NICHROME, MACHINE_COIL_TUNGSTENSTEEL, MACHINE_COIL_HSSG, MACHINE_COIL_NAQUADAH, MACHINE_COIL_NAQUADAHALLOY, BOILER_SOLAR, BOILER_FRONT, + MACHINE_CASING_RADIATIONPROOF, MACHINE_CASING_FIREBOX_BRONZE, MACHINE_CASING_FIREBOX_STEEL, MACHINE_CASING_FIREBOX_TUNGSTENSTEEL, MACHINE_CASING_ENGINE_INTAKE, + MACHINE_CASING_DENSEBRICKS, MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE, MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE, + MACHINE_COIL_CUPRONICKEL, MACHINE_COIL_KANTHAL, MACHINE_COIL_NICHROME, MACHINE_COIL_TUNGSTENSTEEL, MACHINE_COIL_HSSG, MACHINE_COIL_NAQUADAH, MACHINE_COIL_NAQUADAHALLOY, BOILER_SOLAR, BOILER_FRONT, BOILER_FRONT_ACTIVE, BOILER_LAVA_FRONT, BOILER_LAVA_FRONT_ACTIVE, NAQUADAH_REACTOR_SOLID_BACK, NAQUADAH_REACTOR_SOLID_FRONT, NAQUADAH_REACTOR_SOLID_SIDE, NAQUADAH_REACTOR_SOLID_BOTTOM, NAQUADAH_REACTOR_SOLID_TOP, NAQUADAH_REACTOR_SOLID_BACK_ACTIVE, NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE, NAQUADAH_REACTOR_SOLID_SIDE_ACTIVE, NAQUADAH_REACTOR_SOLID_BOTTOM_ACTIVE, NAQUADAH_REACTOR_SOLID_TOP_ACTIVE, NAQUADAH_REACTOR_FLUID_BACK, NAQUADAH_REACTOR_FLUID_FRONT, NAQUADAH_REACTOR_FLUID_SIDE, NAQUADAH_REACTOR_FLUID_BOTTOM, NAQUADAH_REACTOR_FLUID_TOP, diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java index 3c3535e4..690ee470 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings4.java @@ -37,7 +37,8 @@ public class GT_Block_Casings4 GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Titanium Turbine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Tungstensteel Turbine Casing"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Engine Intake Casing"); - + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Dense Bricks"); + ItemList.Casing_RobustTungstenSteel.set(new ItemStack(this, 1, 0)); ItemList.Casing_CleanStainlessSteel.set(new ItemStack(this, 1, 1)); ItemList.Casing_StableTitanium.set(new ItemStack(this, 1, 2)); @@ -50,6 +51,7 @@ public class GT_Block_Casings4 ItemList.Casing_Turbine2.set(new ItemStack(this, 1, 11)); ItemList.Casing_Turbine3.set(new ItemStack(this, 1, 12)); ItemList.Casing_EngineIntake.set(new ItemStack(this, 1, 13)); + ItemList.Casing_DenseBricks.set(new ItemStack(this, 1, 15)); } public IIcon getIcon(int aSide, int aMeta) { @@ -85,7 +87,7 @@ public class GT_Block_Casings4 case 14: return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); case 15: - return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + return Textures.BlockIcons.MACHINE_CASING_DENSEBRICKS.getIcon(); } return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java new file mode 100644 index 00000000..34c11dad --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BrickedBlastFurnace.java @@ -0,0 +1,52 @@ +package gregtech.common.tileentities.machines.multi; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.block.Block; + +public class GT_MetaTileEntity_BrickedBlastFurnace extends GT_MetaTileEntity_PrimitiveBlastFurnace{ + private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_DENSEBRICKS)}; + private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE)}; + private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE)}; + + public GT_MetaTileEntity_BrickedBlastFurnace(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_BrickedBlastFurnace(String aName) { + super(aName); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_BrickedBlastFurnace(this.mName); + } + + public String[] getDescription() { + return new String[]{ + "Controller Block for the Bricked Blast Furnace", + "Useable for Steel and general Pyrometallurgy", + "Size(WxHxD): 3x4x3 (Hollow, with opening on top)", + "Built from 32 Bricks", + "Causes 50 Pollution per second"}; + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return aActive ? FACING_ACTIVE : FACING_FRONT; + } + return FACING_SIDE; + } + + @Override + protected boolean isCorrectCasingBlock(Block block) { + return true; + } + + @Override + protected boolean isCorrectCasingMetaID(int metaID) { + return true; + } +} diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java index ea8eb2f7..d5fcc018 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java @@ -1,48 +1,24 @@ package gregtech.common.tileentities.machines.multi; -import gregtech.GT_Mod; import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.objects.XSTR; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; -import gregtech.common.GT_Pollution; -import gregtech.common.gui.GT_Container_BronzeBlastFurnace; -import gregtech.common.gui.GT_GUIContainer_BronzeBlastFurnace; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.ChunkPosition; -import net.minecraftforge.common.util.ForgeDirection; +import net.minecraft.block.Block; public class GT_MetaTileEntity_BronzeBlastFurnace - extends MetaTileEntity { + extends GT_MetaTileEntity_PrimitiveBlastFurnace { private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS)}; private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE)}; private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBLASTFURNACE_ACTIVE)}; - public int mMaxProgresstime = 0; - public int mUpdate = 5; - public int mProgresstime = 0; - public boolean mMachine = false; - public ItemStack mOutputItem1; - public ItemStack mOutputItem2; public GT_MetaTileEntity_BronzeBlastFurnace(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional, 4); + super(aID, aName, aNameRegional); } public GT_MetaTileEntity_BronzeBlastFurnace(String aName) { - super(aName, 4); + super(aName); } public String[] getDescription() { @@ -61,288 +37,15 @@ public class GT_MetaTileEntity_BronzeBlastFurnace return FACING_SIDE; } - public boolean isSteampowered() { - return false; - } + @Override + protected boolean isCorrectCasingBlock(Block block) { + return block == GregTech_API.sBlockCasings1; + } - public boolean isElectric() { - return false; - } + @Override + protected boolean isCorrectCasingMetaID(int metaID) { + return metaID == 10; + } - public boolean isPneumatic() { - return false; - } - - public boolean isEnetInput() { - return false; - } - - public boolean isEnetOutput() { - return false; - } - - public boolean isInputFacing(byte aSide) { - return false; - } - - public boolean isOutputFacing(byte aSide) { - return false; - } - - public boolean isTeleporterCompatible() { - return false; - } - - public boolean isFacingValid(byte aFacing) { - return aFacing > 1; - } - - public boolean isAccessAllowed(EntityPlayer aPlayer) { - return true; - } - - public int getProgresstime() { - return this.mProgresstime; - } - - public int maxProgresstime() { - return this.mMaxProgresstime; - } - - public int increaseProgress(int aProgress) { - this.mProgresstime += aProgress; - return this.mMaxProgresstime - this.mProgresstime; - } - - public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) { - return (GregTech_API.getCoverBehavior(aCoverID.toStack()).isSimpleCover()) && (super.allowCoverOnSide(aSide, aCoverID)); - } - - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_BronzeBlastFurnace(this.mName); - } - - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setInteger("mProgresstime", this.mProgresstime); - aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime); - if (this.mOutputItem1 != null) { - NBTTagCompound tNBT = new NBTTagCompound(); - this.mOutputItem1.writeToNBT(tNBT); - aNBT.setTag("mOutputItem1", tNBT); - } - if (this.mOutputItem2 != null) { - NBTTagCompound tNBT = new NBTTagCompound(); - this.mOutputItem2.writeToNBT(tNBT); - aNBT.setTag("mOutputItem2", tNBT); - } - } - - public void loadNBTData(NBTTagCompound aNBT) { - this.mUpdate = 5; - this.mProgresstime = aNBT.getInteger("mProgresstime"); - this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime"); - this.mOutputItem1 = GT_Utility.loadItem(aNBT, "mOutputItem1"); - this.mOutputItem2 = GT_Utility.loadItem(aNBT, "mOutputItem2"); - } - - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } - aBaseMetaTileEntity.openGUI(aPlayer); - return true; - } - - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_BronzeBlastFurnace(aPlayerInventory, aBaseMetaTileEntity); - } - - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BronzeBlastFurnace(aPlayerInventory, aBaseMetaTileEntity); - } - - private boolean checkMachine() { - int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX; - int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 3; j++) { - for (int k = -1; k < 2; k++) { - if ((xDir + i != 0) || (j != 0) || (zDir + k != 0)) { - if ((i != 0) || (j == -1) || (k != 0)) { - if ((getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k) != GregTech_API.sBlockCasings1) || (getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k) != 10)) { - return false; - } - } else if ((!GT_Utility.arrayContains(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), new Object[]{Blocks.lava, Blocks.flowing_lava, null})) && (!getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) { - return false; - } - } - } - } - } - return true; - } - - public void onMachineBlockUpdate() { - this.mUpdate = 5; - } - - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - if ((aBaseMetaTileEntity.isClientSide()) && - (aBaseMetaTileEntity.isActive())) { - aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), 0.0D, 0.3D, 0.0D); - } - if (aBaseMetaTileEntity.isServerSide()) { - if (this.mUpdate-- == 0) { - this.mMachine = checkMachine(); - } - if (this.mMachine) { - if (this.mMaxProgresstime > 0) { - if (++this.mProgresstime >= this.mMaxProgresstime) { - addOutputProducts(); - this.mOutputItem1 = null; - this.mOutputItem2 = null; - this.mProgresstime = 0; - this.mMaxProgresstime = 0; - GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel"); - } - } else if (aBaseMetaTileEntity.isAllowedToWork()) { - checkRecipe(); - } - } - if(this.mMaxProgresstime>0 && (aTimer % 20L == 0L)){ - GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 50); - } - - aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine)); - if (aBaseMetaTileEntity.isActive()) { - if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) { - aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2); - this.mUpdate = 1; - } - if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) { - aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2); - this.mUpdate = 1; - } - } else { - if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) { - aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2); - this.mUpdate = 1; - } - if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) { - aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2); - this.mUpdate = 1; - } - } - } - } - - private void addOutputProducts() { - if (this.mOutputItem1 != null) { - if (this.mInventory[2] == null) { - this.mInventory[2] = GT_Utility.copy(new Object[]{this.mOutputItem1}); - } else if (GT_Utility.areStacksEqual(this.mInventory[2], this.mOutputItem1)) { - this.mInventory[2].stackSize = Math.min(this.mOutputItem1.getMaxStackSize(), this.mOutputItem1.stackSize + this.mInventory[2].stackSize); - } - } - if (this.mOutputItem2 != null) { - if (this.mInventory[3] == null) { - this.mInventory[3] = GT_Utility.copy(new Object[]{this.mOutputItem2}); - } else if (GT_Utility.areStacksEqual(this.mInventory[3], this.mOutputItem2)) { - this.mInventory[3].stackSize = Math.min(this.mOutputItem2.getMaxStackSize(), this.mOutputItem2.stackSize + this.mInventory[3].stackSize); - } - } - } - - private boolean spaceForOutput(ItemStack aStack1, ItemStack aStack2) { - if (((this.mInventory[2] == null) || (aStack1 == null) || ((this.mInventory[2].stackSize + aStack1.stackSize <= this.mInventory[2].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[2], aStack1)))) && ( - (this.mInventory[3] == null) || (aStack2 == null) || ((this.mInventory[3].stackSize + aStack2.stackSize <= this.mInventory[3].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[3], aStack2))))) { - return true; - } - return false; - } - - private boolean checkRecipe() { - if (!this.mMachine) { - return false; - } - if ((this.mInventory[0] != null) && (this.mInventory[1] != null) && (this.mInventory[0].stackSize >= 1)) { - if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustIron")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "ingotIron"))) { - if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L)))) { - getBaseMetaTileEntity().decrStackSize(0, 1); - getBaseMetaTileEntity().decrStackSize(1, 4); - this.mMaxProgresstime = 7200; - return true; - } - if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 4L)))) { - getBaseMetaTileEntity().decrStackSize(0, 1); - getBaseMetaTileEntity().decrStackSize(1, 2); - this.mMaxProgresstime = 4800; - return true; - } - if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) { - getBaseMetaTileEntity().decrStackSize(0, 9); - getBaseMetaTileEntity().decrStackSize(1, 4); - this.mMaxProgresstime = 64800; - return true; - } - } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustSteel")) { - if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2L)))) { - getBaseMetaTileEntity().decrStackSize(0, 1); - getBaseMetaTileEntity().decrStackSize(1, 2); - this.mMaxProgresstime = 3600; - return true; - } - if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 1) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 2L)))) { - getBaseMetaTileEntity().decrStackSize(0, 1); - getBaseMetaTileEntity().decrStackSize(1, 1); - this.mMaxProgresstime = 2400; - return true; - } - if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 2L)))) { - getBaseMetaTileEntity().decrStackSize(0, 9); - getBaseMetaTileEntity().decrStackSize(1, 2); - this.mMaxProgresstime = 32400; - return true; - } - } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "blockIron")) { - if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 36) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) { - getBaseMetaTileEntity().decrStackSize(0, 1); - getBaseMetaTileEntity().decrStackSize(1, 36); - this.mMaxProgresstime = 64800; - return true; - } - if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 18) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 4L)))) { - getBaseMetaTileEntity().decrStackSize(0, 1); - getBaseMetaTileEntity().decrStackSize(1, 18); - this.mMaxProgresstime = 43200; - return true; - } - if (((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) { - getBaseMetaTileEntity().decrStackSize(0, 1); - getBaseMetaTileEntity().decrStackSize(1, 4); - this.mMaxProgresstime = 64800; - return true; - } - } - } - this.mOutputItem1 = null; - this.mOutputItem2 = null; - return false; - } - - public boolean isGivingInformation() { - return false; - } - - public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return aIndex > 1; - } - - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return !GT_Utility.areStacksEqual(aStack, this.mInventory[0]); - } - - public byte getTileEntityBaseType() { - return 0; - } + } \ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java new file mode 100644 index 00000000..3d54ac0e --- /dev/null +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PrimitiveBlastFurnace.java @@ -0,0 +1,331 @@ +package gregtech.common.tileentities.machines.multi; + +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.XSTR; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import gregtech.common.GT_Pollution; +import gregtech.common.gui.GT_Container_BronzeBlastFurnace; +import gregtech.common.gui.GT_GUIContainer_BronzeBlastFurnace; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkPosition; +import net.minecraftforge.common.util.ForgeDirection; + +public abstract class GT_MetaTileEntity_PrimitiveBlastFurnace + extends MetaTileEntity { + public int mMaxProgresstime = 0; + public int mUpdate = 5; + public int mProgresstime = 0; + public boolean mMachine = false; + public ItemStack mOutputItem1; + public ItemStack mOutputItem2; + + public GT_MetaTileEntity_PrimitiveBlastFurnace(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional, 4); + } + + public GT_MetaTileEntity_PrimitiveBlastFurnace(String aName) { + super(aName, 4); + } + + public boolean isSteampowered() { + return false; + } + + public boolean isElectric() { + return false; + } + + public boolean isPneumatic() { + return false; + } + + public boolean isEnetInput() { + return false; + } + + public boolean isEnetOutput() { + return false; + } + + public boolean isInputFacing(byte aSide) { + return false; + } + + public boolean isOutputFacing(byte aSide) { + return false; + } + + public boolean isTeleporterCompatible() { + return false; + } + + public boolean isFacingValid(byte aFacing) { + return aFacing > 1; + } + + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + public int getProgresstime() { + return this.mProgresstime; + } + + public int maxProgresstime() { + return this.mMaxProgresstime; + } + + public int increaseProgress(int aProgress) { + this.mProgresstime += aProgress; + return this.mMaxProgresstime - this.mProgresstime; + } + + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) { + return (GregTech_API.getCoverBehavior(aCoverID.toStack()).isSimpleCover()) && (super.allowCoverOnSide(aSide, aCoverID)); + } + + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_BronzeBlastFurnace(this.mName); + } + + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("mProgresstime", this.mProgresstime); + aNBT.setInteger("mMaxProgresstime", this.mMaxProgresstime); + if (this.mOutputItem1 != null) { + NBTTagCompound tNBT = new NBTTagCompound(); + this.mOutputItem1.writeToNBT(tNBT); + aNBT.setTag("mOutputItem1", tNBT); + } + if (this.mOutputItem2 != null) { + NBTTagCompound tNBT = new NBTTagCompound(); + this.mOutputItem2.writeToNBT(tNBT); + aNBT.setTag("mOutputItem2", tNBT); + } + } + + public void loadNBTData(NBTTagCompound aNBT) { + this.mUpdate = 5; + this.mProgresstime = aNBT.getInteger("mProgresstime"); + this.mMaxProgresstime = aNBT.getInteger("mMaxProgresstime"); + this.mOutputItem1 = GT_Utility.loadItem(aNBT, "mOutputItem1"); + this.mOutputItem2 = GT_Utility.loadItem(aNBT, "mOutputItem2"); + } + + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_BronzeBlastFurnace(aPlayerInventory, aBaseMetaTileEntity); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_BronzeBlastFurnace(aPlayerInventory, aBaseMetaTileEntity); + } + + private boolean checkMachine() { + int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX; + int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ; + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 3; j++) { + for (int k = -1; k < 2; k++) { + if ((xDir + i != 0) || (j != 0) || (zDir + k != 0)) { + if ((i != 0) || (j == -1) || (k != 0)) { + if (!isCorrectCasingBlock(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k)) || !isCorrectCasingMetaID(getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k))) { + return false; + } + } else if ((!GT_Utility.arrayContains(getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), new Object[]{Blocks.lava, Blocks.flowing_lava, null})) && (!getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) { + return false; + } + } + } + } + } + return true; + } + + protected abstract boolean isCorrectCasingBlock(Block block); + + protected abstract boolean isCorrectCasingMetaID(int metaID); + + public void onMachineBlockUpdate() { + this.mUpdate = 5; + } + + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { + if ((aBaseMetaTileEntity.isClientSide()) && + (aBaseMetaTileEntity.isActive())) { + aBaseMetaTileEntity.getWorld().spawnParticle("largesmoke", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), 0.0D, 0.3D, 0.0D); + } + if (aBaseMetaTileEntity.isServerSide()) { + if (this.mUpdate-- == 0) { + this.mMachine = checkMachine(); + } + if (this.mMachine) { + if (this.mMaxProgresstime > 0) { + if (++this.mProgresstime >= this.mMaxProgresstime) { + addOutputProducts(); + this.mOutputItem1 = null; + this.mOutputItem2 = null; + this.mProgresstime = 0; + this.mMaxProgresstime = 0; + GT_Mod.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel"); + } + } else if (aBaseMetaTileEntity.isAllowedToWork()) { + checkRecipe(); + } + } + if(this.mMaxProgresstime>0 && (aTimer % 20L == 0L)){ + GT_Pollution.addPollution(this.getBaseMetaTileEntity().getWorld(), new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 50); + } + + aBaseMetaTileEntity.setActive((this.mMaxProgresstime > 0) && (this.mMachine)); + if (aBaseMetaTileEntity.isActive()) { + if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) { + aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2); + this.mUpdate = 1; + } + if (aBaseMetaTileEntity.getAir(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) { + aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.lava, 1, 2); + this.mUpdate = 1; + } + } else { + if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) { + aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2); + this.mUpdate = 1; + } + if (aBaseMetaTileEntity.getBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) { + aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), Blocks.air, 0, 2); + this.mUpdate = 1; + } + } + } + } + + private void addOutputProducts() { + if (this.mOutputItem1 != null) { + if (this.mInventory[2] == null) { + this.mInventory[2] = GT_Utility.copy(new Object[]{this.mOutputItem1}); + } else if (GT_Utility.areStacksEqual(this.mInventory[2], this.mOutputItem1)) { + this.mInventory[2].stackSize = Math.min(this.mOutputItem1.getMaxStackSize(), this.mOutputItem1.stackSize + this.mInventory[2].stackSize); + } + } + if (this.mOutputItem2 != null) { + if (this.mInventory[3] == null) { + this.mInventory[3] = GT_Utility.copy(new Object[]{this.mOutputItem2}); + } else if (GT_Utility.areStacksEqual(this.mInventory[3], this.mOutputItem2)) { + this.mInventory[3].stackSize = Math.min(this.mOutputItem2.getMaxStackSize(), this.mOutputItem2.stackSize + this.mInventory[3].stackSize); + } + } + } + + private boolean spaceForOutput(ItemStack aStack1, ItemStack aStack2) { + if (((this.mInventory[2] == null) || (aStack1 == null) || ((this.mInventory[2].stackSize + aStack1.stackSize <= this.mInventory[2].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[2], aStack1)))) && ( + (this.mInventory[3] == null) || (aStack2 == null) || ((this.mInventory[3].stackSize + aStack2.stackSize <= this.mInventory[3].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[3], aStack2))))) { + return true; + } + return false; + } + + private boolean checkRecipe() { + if (!this.mMachine) { + return false; + } + if ((this.mInventory[0] != null) && (this.mInventory[1] != null) && (this.mInventory[0].stackSize >= 1)) { + if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustIron")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "ingotIron"))) { + if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L)))) { + getBaseMetaTileEntity().decrStackSize(0, 1); + getBaseMetaTileEntity().decrStackSize(1, 4); + this.mMaxProgresstime = 7200; + return true; + } + if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 4L)))) { + getBaseMetaTileEntity().decrStackSize(0, 1); + getBaseMetaTileEntity().decrStackSize(1, 2); + this.mMaxProgresstime = 4800; + return true; + } + if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) { + getBaseMetaTileEntity().decrStackSize(0, 9); + getBaseMetaTileEntity().decrStackSize(1, 4); + this.mMaxProgresstime = 64800; + return true; + } + } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustSteel")) { + if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2L)))) { + getBaseMetaTileEntity().decrStackSize(0, 1); + getBaseMetaTileEntity().decrStackSize(1, 2); + this.mMaxProgresstime = 3600; + return true; + } + if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 1) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 2L)))) { + getBaseMetaTileEntity().decrStackSize(0, 1); + getBaseMetaTileEntity().decrStackSize(1, 1); + this.mMaxProgresstime = 2400; + return true; + } + if ((this.mInventory[0].stackSize >= 9) && ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 2) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 2L)))) { + getBaseMetaTileEntity().decrStackSize(0, 9); + getBaseMetaTileEntity().decrStackSize(1, 2); + this.mMaxProgresstime = 32400; + return true; + } + } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "blockIron")) { + if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 36) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) { + getBaseMetaTileEntity().decrStackSize(0, 1); + getBaseMetaTileEntity().decrStackSize(1, 36); + this.mMaxProgresstime = 64800; + return true; + } + if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "fuelCoke")) && (this.mInventory[1].stackSize >= 18) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Ash, 4L)))) { + getBaseMetaTileEntity().decrStackSize(0, 1); + getBaseMetaTileEntity().decrStackSize(1, 18); + this.mMaxProgresstime = 43200; + return true; + } + if (((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (spaceForOutput(this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), this.mOutputItem2 = GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) { + getBaseMetaTileEntity().decrStackSize(0, 1); + getBaseMetaTileEntity().decrStackSize(1, 4); + this.mMaxProgresstime = 64800; + return true; + } + } + } + this.mOutputItem1 = null; + this.mOutputItem2 = null; + return false; + } + + public boolean isGivingInformation() { + return false; + } + + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aIndex > 1; + } + + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return !GT_Utility.areStacksEqual(aStack, this.mInventory[0]); + } + + public byte getTileEntityBaseType() { + return 0; + } +} \ No newline at end of file diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java index c381a29c..2ff1bac3 100644 --- a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java +++ b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java @@ -385,6 +385,9 @@ public class GT_Loader_MetaTileEntities implements Runnable { if (!Loader.isModLoaded("terrafirmacraft")) { GT_ModHandler.addCraftingRecipe(ItemList.Machine_Bronze_BlastFurnace.get(1L, new Object[0]), bits, new Object[]{"PFP", "FwF", "PFP", 'P', OrePrefixes.plate.get(Materials.Bronze), 'F', OreDictNames.craftingFurnace}); } + + ItemList.Machine_Bricked_BlastFurnace.set(new GT_MetaTileEntity_BrickedBlastFurnace(130, "multimachine.brickedblastfurnace", "Bricked Blast Furnace").getStackForm(1L)); + ItemList.Machine_Bronze_Furnace.set(new GT_MetaTileEntity_Furnace_Bronze(103, "bronzemachine.furnace", "Steam Furnace").getStackForm(1L)); ItemList.Machine_Steel_Furnace.set(new GT_MetaTileEntity_Furnace_Steel(104, "steelmachine.furnace", "High Pressure Furnace").getStackForm(1L)); ItemList.Machine_Bronze_Macerator.set(new GT_MetaTileEntity_Macerator_Bronze(106, "bronzemachine.macerator", "Steam Macerator").getStackForm(1L)); diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_BRICKEDBLASTFURNACE_ACTIVE.png new file mode 100644 index 0000000000000000000000000000000000000000..c3b3523c8df0ebc00e81e5f32b14572eed6b7820 GIT binary patch literal 705 zcmV;y0zUnTP)o=?P_G`mdGO{N zaPkR!2%o_R@EJ^qaF@i3P&E}QO>N7zTXtr4XS+Kdwyrb~=QK0FeE;u1^L?KmT4 z1QyUy%xIJX5SavoU}@nF|KqMdkfTzp`IiOFwa?iM3&A$@QQ6Y%mG-JFi$Nq)bvxk1S-ljzJ}ClHG<$;!N+z5 zA{QSAH5v_`E@zW{aP+Og@$u)PQ2?A$o+%rjOXD-Z-u5~=N^k?I=?9YM)e56DZf_74Z*zno)G;bD nNF8I65uu8itxTb`xt0F`wi;++w9fdZ00000NkvXXu0mjf|57qt literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/MACHINE_CASING_BRICKEDBLASTFURNACE_INACTIVE.png new file mode 100644 index 0000000000000000000000000000000000000000..8a09b069f39f012dcc85e7900d1ddffbe47726b3 GIT binary patch literal 645 zcmV;00($+4P)aVN1y83VR>HV8Z zp{M|p7kDoKw-0a=pe_W5wQ?k4O1(~s2wkXL6Rlv_bBYG>#b9{Ijp<6m&9H;cU z%XF67Gng5RQi_%i>V=9q-dSp+bL%LpiZ7#XBfE1BSmETWr<5*47feLB+lpCeYxH8f z#m3rgejP)<-)C!Ui{0Jb>7f89nzp~c&y$DuFu6lVsbL(YBuSTEuU`jN&4A0UQsBKX z7>+2cBN#_1xpi1;`7s!9C3Y@R1$gf%tOFo0){$fdnK5&vR#(Q9$8k)Y<{0bHPaoY! zq4;+A9W~vdE+%y;nVQU@4%t|{)zpD?uD*K(dwVYt5k4LqP)(wqZEqtYd_FotyfBV4 zq9m(zFtydyRZw7Ufp}qOX9p<-@j`A4QVN@oHwkq(X{f4oa26%l!p>?9pgJ#el-Vpol2Aa^bVh)A%Yr zi-_1rUy`2Gz0z@!F^r_s!ql=3|K>YKeEWLe3j{r2ohPLZ02d+%!A*6=B`){1#yAfG zj14?}O>0<)jGw>vRM+bX-)tMCk{O4irh2)iT;(G)HXwvR$!z%OnecLzBVCA``kwE< zb^t7MNlYCnoml3Q|8ZI5iuZS~P*UP!q`E56E|5}(brB`Ai(EF^a%eOFsXOuE&1-&a z_TvV{QbEsI?n5LyH2QH-s2|L@vJa6WACBiZfV3f^jYr!+CIqeZ7#Gmi6Ji=iJI9q; zAisQii$I{AM*t~xytuuYbg-*iR)w1IiydsX4U2cTV+Y&%VbY0w>KOrLk^kfQFF!Pz z>UurtM7j{!H7%|2vmG3@1K_CL^E&wa@$PvY_(y%t4@ze{0M2@LAwtj4!(0d3x*hI? jINL#MJnM3and#&Yp9pz%fBkVE00000NkvXXu0mjfHEh?y literal 0 HcmV?d00001