diff options
author | miozune <miozune@gmail.com> | 2023-05-17 00:01:01 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-16 17:01:01 +0200 |
commit | 04514282c08ebefdb3e68a46db34092f72be2316 (patch) | |
tree | 0c9bc99f480f7e7f45a99a55a5b6619ebb5b014b /src/main/java/gtPlusPlus/xmod/gregtech/common | |
parent | cd58ff7cd4dc4b5ffe917a24a4b4c6da577f462d (diff) | |
download | GT5-Unofficial-04514282c08ebefdb3e68a46db34092f72be2316.tar.gz GT5-Unofficial-04514282c08ebefdb3e68a46db34092f72be2316.tar.bz2 GT5-Unofficial-04514282c08ebefdb3e68a46db34092f72be2316.zip |
Remove a lot of unused classes (#629)
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common')
22 files changed, 2 insertions, 3482 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java deleted file mode 100644 index 13d58aac5f..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java +++ /dev/null @@ -1,37 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.blocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -public class GregtechMetaItemCasings1 extends GregtechMetaItemCasingsAbstract { - - public GregtechMetaItemCasings1(final Block par1) { - super(par1); - } - - @Override - public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, - final boolean aF3_H) { - super.addInformation(aStack, aPlayer, aList, aF3_H); - switch (this.getDamage(aStack)) { - case 0: - aList.add(this.mCasing_Centrifuge); - break; - case 1: - aList.add(this.mCasing_CokeOven); - break; - case 2: - aList.add(this.mCasing_CokeCoil1); - break; - case 3: - aList.add(this.mCasing_CokeCoil2); - break; - default: - aList.add(this.mCasing_CokeCoil2); - break; - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java index ae9f49c60a..ec1ee2a226 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java @@ -9,8 +9,6 @@ import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; public class CasingTextureHandler { - // private static final TexturesGregtech59 gregtech59 = new TexturesGregtech59(); - // private static final TexturesGregtech58 gregtech58 = new TexturesGregtech58(); private static final TexturesCentrifugeMultiblock gregtechX = new TexturesCentrifugeMultiblock(); public static IIcon getIcon(final int ordinalSide, final int aMeta) { // Texture ID's. case 0 == ID[57] diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java deleted file mode 100644 index 5d907f7e3b..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java +++ /dev/null @@ -1,532 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.blocks.textures; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.common.util.ForgeDirection; - -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialCentrifuge; - -public class TexturesGregtech59 { - - private static Textures.BlockIcons.CustomIcon GT8_1_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE1"); - private static Textures.BlockIcons.CustomIcon GT8_1 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST1"); - private static Textures.BlockIcons.CustomIcon GT8_2_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE2"); - private static Textures.BlockIcons.CustomIcon GT8_2 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST2"); - private static Textures.BlockIcons.CustomIcon GT8_3_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE3"); - private static Textures.BlockIcons.CustomIcon GT8_3 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST3"); - private static Textures.BlockIcons.CustomIcon GT8_4_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE4"); - private static Textures.BlockIcons.CustomIcon GT8_4 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST4"); - private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE5"); - private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST5"); - private static Textures.BlockIcons.CustomIcon GT8_6_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE6"); - private static Textures.BlockIcons.CustomIcon GT8_6 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST6"); - private static Textures.BlockIcons.CustomIcon GT8_7_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE7"); - private static Textures.BlockIcons.CustomIcon GT8_7 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST7"); - private static Textures.BlockIcons.CustomIcon GT8_8_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE8"); - private static Textures.BlockIcons.CustomIcon GT8_8 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST8"); - private static Textures.BlockIcons.CustomIcon GT8_9_Active = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST_ACTIVE9"); - private static Textures.BlockIcons.CustomIcon GT8_9 = new Textures.BlockIcons.CustomIcon( - "iconsets/LARGETURBINE_ST9"); - - private static Textures.BlockIcons.CustomIcon frontFace_0 = (GT8_1); - private static Textures.BlockIcons.CustomIcon frontFaceActive_0 = (GT8_1_Active); - private static Textures.BlockIcons.CustomIcon frontFace_1 = (GT8_2); - private static Textures.BlockIcons.CustomIcon frontFaceActive_1 = (GT8_2_Active); - private static Textures.BlockIcons.CustomIcon frontFace_2 = (GT8_3); - private static Textures.BlockIcons.CustomIcon frontFaceActive_2 = (GT8_3_Active); - private static Textures.BlockIcons.CustomIcon frontFace_3 = (GT8_4); - private static Textures.BlockIcons.CustomIcon frontFaceActive_3 = (GT8_4_Active); - private static Textures.BlockIcons.CustomIcon frontFace_4 = (GT8_5); - private static Textures.BlockIcons.CustomIcon frontFaceActive_4 = (GT8_5_Active); - private static Textures.BlockIcons.CustomIcon frontFace_5 = (GT8_6); - private static Textures.BlockIcons.CustomIcon frontFaceActive_5 = (GT8_6_Active); - private static Textures.BlockIcons.CustomIcon frontFace_6 = (GT8_7); - private static Textures.BlockIcons.CustomIcon frontFaceActive_6 = (GT8_7_Active); - private static Textures.BlockIcons.CustomIcon frontFace_7 = (GT8_8); - private static Textures.BlockIcons.CustomIcon frontFaceActive_7 = (GT8_8_Active); - private static Textures.BlockIcons.CustomIcon frontFace_8 = (GT8_9); - private static Textures.BlockIcons.CustomIcon frontFaceActive_8 = (GT8_9_Active); - - Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[] { frontFace_0, frontFace_1, - frontFace_2, frontFace_3, frontFace_4, frontFace_5, frontFace_6, frontFace_7, frontFace_8 }; - - Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[] { frontFaceActive_0, - frontFaceActive_1, frontFaceActive_2, frontFaceActive_3, frontFaceActive_4, frontFaceActive_5, - frontFaceActive_6, frontFaceActive_7, frontFaceActive_8 }; - - public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final ForgeDirection side, final GregtechMetaCasingBlocks thisBlock) { - return this.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, side, thisBlock); - } - - public IIcon handleCasingsGT59(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, - final ForgeDirection side, final GregtechMetaCasingBlocks thisBlock) { - final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); - final int ordinalSide = side.ordinal(); - if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) { - return CasingTextureHandler.getIcon(ordinalSide, tMeta); - } - final int tStartIndex = tMeta == 6 ? 1 : 13; - if (tMeta == 0) { - if ((side == ForgeDirection.NORTH) || (side == ForgeDirection.SOUTH)) { - TileEntity tTileEntity; - IMetaTileEntity tMetaTileEntity; - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[0].getIcon(); - } - return this.TURBINE[0].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[3].getIcon(); - } - return this.TURBINE[3].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.SOUTH ? 1 : -1), yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[6].getIcon(); - } - return this.TURBINE[6].getIcon(); - } - if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[1].getIcon(); - } - return this.TURBINE[1].getIcon(); - } - if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[7].getIcon(); - } - return this.TURBINE[7].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[8].getIcon(); - } - return this.TURBINE[8].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[5].getIcon(); - } - return this.TURBINE[5].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord + (side == ForgeDirection.NORTH ? 1 : -1), yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[2].getIcon(); - } - return this.TURBINE[2].getIcon(); - } - } else if ((side == ForgeDirection.WEST) || (side == ForgeDirection.EAST)) { - TileEntity tTileEntity; - Object tMetaTileEntity; - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord - 1, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[0].getIcon(); - } - return this.TURBINE[0].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[3].getIcon(); - } - return this.TURBINE[3].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord + 1, zCoord + (side == ForgeDirection.WEST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[6].getIcon(); - } - return this.TURBINE[6].getIcon(); - } - if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[1].getIcon(); - } - return this.TURBINE[1].getIcon(); - } - if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[7].getIcon(); - } - return this.TURBINE[7].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord + 1, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[8].getIcon(); - } - return this.TURBINE[8].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[5].getIcon(); - } - return this.TURBINE[5].getIcon(); - } - if ((null != (tTileEntity = aWorld - .getTileEntity(xCoord, yCoord - 1, zCoord + (side == ForgeDirection.EAST ? 1 : -1)))) - && ((tTileEntity instanceof IGregTechTileEntity)) - && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == side) - && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) - && ((tMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge))) { - if (((IGregTechTileEntity) tTileEntity).isActive()) { - return this.TURBINE_ACTIVE[2].getIcon(); - } - return this.TURBINE[2].getIcon(); - } - } - return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); - } - final boolean[] tConnectedSides = { - (aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), - (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), - (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), - (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), - (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), - (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta) }; - switch (side) { - case DOWN: - if (tConnectedSides[0]) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); - } - if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); - } - if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); - } - if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); - } - if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); - } - if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); - } - if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((!tConnectedSides[4]) && (!tConnectedSides[2])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); - } - if ((!tConnectedSides[5]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); - } - case UP: - if (tConnectedSides[1]) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); - } - if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); - } - if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); - } - if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); - } - if ((tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); - } - if ((tConnectedSides[4]) && (tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); - } - if ((!tConnectedSides[4]) && (tConnectedSides[5]) && (tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); - } - if ((!tConnectedSides[4]) && (!tConnectedSides[5]) && (!tConnectedSides[2]) && (!tConnectedSides[3])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((!tConnectedSides[2]) && (!tConnectedSides[4])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); - } - if ((!tConnectedSides[3]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); - } - case NORTH: - if (tConnectedSides[5]) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); - } - if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); - } - if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); - } - if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); - } - if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); - } - if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); - } - if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((!tConnectedSides[2]) && (!tConnectedSides[4])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); - } - case SOUTH: - if (tConnectedSides[3]) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); - } - if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); - } - if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); - } - if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); - } - if ((tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); - } - if ((tConnectedSides[2]) && (tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); - } - if ((!tConnectedSides[2]) && (tConnectedSides[0]) && (tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); - } - if ((!tConnectedSides[2]) && (!tConnectedSides[0]) && (!tConnectedSides[4]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((!tConnectedSides[2]) && (!tConnectedSides[4])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); - } - case WEST: - if (tConnectedSides[4]) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); - } - if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); - } - if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); - } - if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); - } - if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); - } - if ((!tConnectedSides[3]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); - } - case EAST: - if (tConnectedSides[2]) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 6)].getIcon(); - } - if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 5)].getIcon(); - } - if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 2)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 3)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 4)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 11)].getIcon(); - } - if ((tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 8)].getIcon(); - } - if ((tConnectedSides[0]) && (tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 9)].getIcon(); - } - if ((!tConnectedSides[0]) && (tConnectedSides[3]) && (tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 10)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[3]) && (!tConnectedSides[1]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } - if ((!tConnectedSides[0]) && (!tConnectedSides[1])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 0)].getIcon(); - } - if ((!tConnectedSides[3]) && (!tConnectedSides[5])) { - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 1)].getIcon(); - } - break; - } - return Textures.BlockIcons.CONNECTED_HULLS[(tStartIndex + 7)].getIcon(); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java deleted file mode 100644 index e246697285..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java +++ /dev/null @@ -1,185 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.covers; - -import java.lang.reflect.Field; -import java.util.HashMap; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; - -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.ICoverable; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_CoverBehavior; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.util.minecraft.LangUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; - -public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior { - - public final int mInitialCapacity; - public final int mMaxItemCapacity; - - public static final Class sQuantumChest; - public static final Class sSuperChestGTPP; - public static final Class sSuperChestGTNH; - public static HashMap<Integer, Field> mItemAmountFields = new HashMap<Integer, Field>(); - public static HashMap<Integer, Field> mItemTypeFields = new HashMap<Integer, Field>(); - - static { - sQuantumChest = ReflectionUtils.getClass("gregtech.common.tileentities.storage.GT_MetaTileEntity_QuantumChest"); - sSuperChestGTPP = ReflectionUtils - .getClass("gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest"); - sSuperChestGTNH = ReflectionUtils.getClass("gregtech.common.tileentities.storage.GT_MetaTileEntity_SuperChest"); - if (sQuantumChest != null) { - mItemAmountFields.put(0, ReflectionUtils.getField(sQuantumChest, "mItemCount")); - mItemTypeFields.put(0, ReflectionUtils.getField(sQuantumChest, "mItemStack")); - } - if (sSuperChestGTPP != null) { - mItemAmountFields.put(1, ReflectionUtils.getField(sSuperChestGTPP, "mItemCount")); - mItemTypeFields.put(1, ReflectionUtils.getField(sSuperChestGTPP, "mItemStack")); - } - if (sSuperChestGTNH != null) { - mItemAmountFields.put(2, ReflectionUtils.getField(sSuperChestGTNH, "mItemCount")); - mItemTypeFields.put(2, ReflectionUtils.getField(sSuperChestGTNH, "mItemStack")); - } - } - - public GTPP_Cover_Overflow_Item(int aCapacity) { - this.mInitialCapacity = aCapacity; - this.mMaxItemCapacity = aCapacity * 1000; - } - - public int doCoverThings(ForgeDirection side, byte aInputRedstone, int aCoverID, int aCoverVariable, - ICoverable aTileEntity, long aTimer) { - if (aCoverVariable == 0) { - return aCoverVariable; - } - - // Get the IGTTile - IGregTechTileEntity aGtTileEntity = aTileEntity - .getIGregTechTileEntity(aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord()); - if (aGtTileEntity == null) { - return aCoverVariable; - } - - // Get the MetaTile - final IMetaTileEntity aMetaTileEntity = aGtTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return aCoverVariable; - } - boolean didHandle = false; - // Special Case for everything I want to support. /facepalm - if (sQuantumChest != null && sQuantumChest.isInstance(aMetaTileEntity)) { - didHandle = handleDigitalChest(aMetaTileEntity, 0); - } else if (sSuperChestGTPP.isInstance(aMetaTileEntity)) { - didHandle = handleDigitalChest(aMetaTileEntity, 1); - - } else if (sSuperChestGTNH != null && sSuperChestGTNH.isInstance(aMetaTileEntity)) { - didHandle = handleDigitalChest(aMetaTileEntity, 2); - } - - return aCoverVariable; - } - - private boolean handleDigitalChest(IMetaTileEntity aTile, int aType) { - int aItemAmount = (int) ReflectionUtils.getFieldValue(mItemAmountFields.get(aType), aTile); - ItemStack aItemType = (ItemStack) ReflectionUtils.getFieldValue(mItemTypeFields.get(aType), aTile); - - if (aItemType == null || aItemAmount <= 0) { - return false; - } else { - if (aItemAmount > mInitialCapacity) { - int aNewItemAmount = mInitialCapacity; - ReflectionUtils.setField(aTile, mItemAmountFields.get(aType), aNewItemAmount); - } - } - return true; - } - - public int onCoverScrewdriverclick(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (GT_Utility.getClickedFacingCoords(side, aX, aY, aZ)[0] >= 0.5F) { - aCoverVariable += (mMaxItemCapacity * (aPlayer.isSneaking() ? 0.1f : 0.01f)); - } else { - aCoverVariable -= (mMaxItemCapacity * (aPlayer.isSneaking() ? 0.1f : 0.01f)); - } - if (aCoverVariable > mMaxItemCapacity) { - aCoverVariable = mInitialCapacity; - } - if (aCoverVariable <= 0) { - aCoverVariable = mMaxItemCapacity; - } - GT_Utility.sendChatToPlayer( - aPlayer, - LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); - return aCoverVariable; - } - - public boolean onCoverRightclick(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity, - EntityPlayer aPlayer, float aX, float aY, float aZ) { - boolean aShift = aPlayer.isSneaking(); - int aAmount = aShift ? 128 : 8; - if (GT_Utility.getClickedFacingCoords(side, aX, aY, aZ)[0] >= 0.5F) { - aCoverVariable += aAmount; - } else { - aCoverVariable -= aAmount; - } - if (aCoverVariable > mMaxItemCapacity) { - aCoverVariable = mInitialCapacity; - } - if (aCoverVariable <= 0) { - aCoverVariable = mMaxItemCapacity; - } - GT_Utility.sendChatToPlayer( - aPlayer, - LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); - aTileEntity.setCoverDataAtSide(side, aCoverVariable); - return true; - } - - public boolean letsRedstoneGoIn(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public boolean letsRedstoneGoOut(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public boolean letsEnergyIn(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public boolean letsEnergyOut(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public boolean letsItemsIn(ForgeDirection side, int aCoverID, int aCoverVariable, int aSlot, - ICoverable aTileEntity) { - return true; - } - - public boolean letsItemsOut(ForgeDirection side, int aCoverID, int aCoverVariable, int aSlot, - ICoverable aTileEntity) { - return true; - } - - public boolean letsFluidIn(ForgeDirection side, int aCoverID, int aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { - return false; - } - - public boolean letsFluidOut(ForgeDirection side, int aCoverID, int aCoverVariable, Fluid aFluid, - ICoverable aTileEntity) { - return true; - } - - public boolean alwaysLookConnected(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return true; - } - - public int getTickRate(ForgeDirection side, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { - return 5; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java deleted file mode 100644 index 0d85d6299f..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java +++ /dev/null @@ -1,39 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.helpers; - -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.world.World; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.xmod.gregtech.common.helpers.autocrafter.AC_Helper_Container; -import gtPlusPlus.xmod.gregtech.common.helpers.autocrafter.AC_Helper_Utils; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GT4Entity_AutoCrafter; - -public class CraftingHelper { - - public final String mInventoryName; - public final int mPosX; - public final int mPosY; - public final int mPosZ; - public final GT4Entity_AutoCrafter crafter; - public final World world; - public final EntityPlayerMP player; - public final AC_Helper_Container inventory; - - public CraftingHelper(GT4Entity_AutoCrafter AC) { - Logger.INFO("[A-C] Created a crafting helper."); - crafter = AC; - AC_Helper_Utils.addCrafter(AC); - // Get some variables. - world = AC.getBaseMetaTileEntity().getWorld(); - mPosX = AC.getBaseMetaTileEntity().getXCoord(); - mPosY = AC.getBaseMetaTileEntity().getYCoord(); - mPosZ = AC.getBaseMetaTileEntity().getZCoord(); - // Create Fake player to handle crating. - - player = CORE.getFakePlayer(world); - // Set storage container - inventory = new AC_Helper_Container(player.inventory, world, mPosX, mPosY, mPosZ); - mInventoryName = inventory.getMatrix().getInventoryName(); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java index 616475b66b..b866be1d87 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java @@ -8,8 +8,8 @@ import net.minecraftforge.oredict.OreDictionary; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.sys.Log; public class FlotationRecipeHandler { @@ -19,7 +19,7 @@ public class FlotationRecipeHandler { public static boolean registerOreType(Material aMaterial) { String aMaterialKey = aMaterial.getUnlocalizedName(); if (sMaterialMap.containsKey(aMaterialKey)) { - Log.warn("Tried to register a Flotation material already in use. Material: " + aMaterialKey); + Logger.WARNING("Tried to register a Flotation material already in use. Material: " + aMaterialKey); return false; } else { sMaterialMap.put(aMaterialKey, aMaterial); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java deleted file mode 100644 index b9ba13fa3f..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java +++ /dev/null @@ -1,410 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.helpers.treefarm; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSapling; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Direction; -import net.minecraft.world.World; -import net.minecraft.world.gen.feature.WorldGenAbstractTree; -import net.minecraftforge.common.util.ForgeDirection; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.minecraft.FakeBlockPos; -import gtPlusPlus.api.objects.minecraft.FakeWorld; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.math.MathUtils; - -public class TreeGenerator { - - private static final FakeTreeInFakeWorldGenerator mTreeData; - - static { - Logger.WARNING("Created Fake Tree Generator."); - mTreeData = new FakeTreeInFakeWorldGenerator(); - } - - public TreeGenerator() { - if (!mTreeData.hasGenerated) { - mTreeData.generate(null, CORE.RANDOM, 0, 0, 0); - } - } - - public AutoMap<ItemStack> generateOutput(int aTreeSize) { - AutoMap<ItemStack> aOutputMap = mTreeData.getOutputFromTree(); - if (aOutputMap != null && aOutputMap.size() > 0) { - Logger.WARNING("Valid tree data output"); - return aOutputMap; - } - Logger.WARNING("Invalid tree data output"); - return new AutoMap<ItemStack>(); - } - - public static class FakeTreeInFakeWorldGenerator extends WorldGenAbstractTree { - - /** The minimum height of a generated tree. */ - private final int minTreeHeight; - /** True if this tree should grow Vines. */ - private final boolean vinesGrow; - /** The metadata value of the wood to use in tree generation. */ - private final int metaWood; - /** The metadata value of the leaves to use in tree generation. */ - private final int metaLeaves; - - private final AutoMap<FakeWorld> mFakeWorld; - private final int mTreesToGenerate; - - private int mCurrentGeneratorIteration = 0; - - private boolean hasGenerated = false; - private AutoMap<ItemStack> aOutputsFromGenerator = new AutoMap<ItemStack>(); - - public FakeTreeInFakeWorldGenerator() { - this(4, 0, 0, false, 5000); - } - - public FakeTreeInFakeWorldGenerator(int aMinHeight, int aWoodMeta, int aLeafMeta, boolean aVines, - int aTreeCount) { - super(false); - this.minTreeHeight = aMinHeight; - this.metaWood = aWoodMeta; - this.metaLeaves = aLeafMeta; - this.vinesGrow = aVines; - this.mFakeWorld = new AutoMap<FakeWorld>(); - this.mTreesToGenerate = aTreeCount; - Logger.WARNING("Created Fake Tree In Fake World Instance."); - } - - public AutoMap<ItemStack> getOutputFromTree() { - if (!hasGenerated) { - Logger.WARNING("Generating Tree sample data"); - generate(null, CORE.RANDOM, 0, 0, 0); - } - AutoMap<ItemStack> aOutputMap = new AutoMap<ItemStack>(); - int aRandomTreeID = MathUtils.randInt(0, this.mFakeWorld.size() - 1); - FakeWorld aWorld = this.mFakeWorld.get(aRandomTreeID); - if (aWorld != null) { - // Logger.WARNING("Getting all block data from fake world"); - aOutputMap = aWorld.getAllBlocksStoredInFakeWorld(); - } - return aOutputMap; - } - - @Override - protected boolean func_150523_a(Block p_150523_1_) { - return p_150523_1_.getMaterial() == Material.air || p_150523_1_.getMaterial() == Material.leaves - || p_150523_1_ == Blocks.grass - || p_150523_1_ == Blocks.dirt - || p_150523_1_ == Blocks.log - || p_150523_1_ == Blocks.log2 - || p_150523_1_ == Blocks.sapling - || p_150523_1_ == Blocks.vine; - } - - @Override - protected boolean isReplaceable(World world, int x, int y, int z) { - FakeWorld aWorld = getWorld(); - Block block = aWorld.getBlock(x, y, z); - return block.isAir(null, x, y, z) || block.isLeaves(null, x, y, z) - || block.isWood(null, x, y, z) - || func_150523_a(block); - } - - @Override - public boolean generate(World world, Random aRand, int aWorldX, int aWorldRealY, int aWorldZ) { - // Only Generate Once - This object is Cached - if (hasGenerated) { - return hasGenerated; - } else { - for (int yy = 0; yy < mTreesToGenerate; yy++) { - generateTree(0, 0, 0); - mCurrentGeneratorIteration++; - } - hasGenerated = true; - if (this.mFakeWorld.size() > 0) { - for (FakeWorld aWorld : this.mFakeWorld) { - for (ItemStack aBlockInFakeWorld : aWorld.getAllBlocksStoredInFakeWorld()) { - aOutputsFromGenerator.add(aBlockInFakeWorld); - } - } - return true; - } else { - return false; - } - } - } - - private FakeWorld aFakeWorld; - - public FakeWorld getWorld() { - FakeWorld aWorld = this.mFakeWorld.get(mCurrentGeneratorIteration); - if (aWorld == null) { - this.mFakeWorld.set(mCurrentGeneratorIteration, new FakeWorld(200)); - aWorld = this.mFakeWorld.get(mCurrentGeneratorIteration); - } - return aWorld; - } - - public boolean generateTree(int aWorldX, int aWorldRealY, int aWorldZ) { - FakeWorld aWorld = getWorld(); - - // Set some static values - - Logger.WARNING("Stepping through generateTree [0]"); - // Dummy Value - int aWorldY = 10; - - int l = CORE.RANDOM.nextInt(3) + this.minTreeHeight; - boolean flag = true; - - if (aWorldY >= 1 && aWorldY + l + 1 <= 256) { - Logger.WARNING("Stepping through generateTree [1]"); - byte b0; - int k1; - Block block; - - for (int i1 = aWorldY; i1 <= aWorldY + 1 + l; ++i1) { - b0 = 1; - - if (i1 == aWorldY) { - b0 = 0; - } - - if (i1 >= aWorldY + 1 + l - 2) { - b0 = 2; - } - - for (int j1 = aWorldX - b0; j1 <= aWorldX + b0 && flag; ++j1) { - for (k1 = aWorldZ - b0; k1 <= aWorldZ + b0 && flag; ++k1) { - if (i1 >= 0 && i1 < 256) { - block = aWorld.getBlock(j1, i1, k1); - - if (!this.isReplaceable(null, j1, i1, k1)) { - flag = false; - } - } else { - flag = false; - } - } - } - } - - if (!flag) { - Logger.WARNING("Stepping through generateTree [2]"); - return false; - } else { - Logger.WARNING("Stepping through generateTree [3]"); - Block block2 = aWorld.getBlock(aWorldX, aWorldY - 1, aWorldZ); - FakeBlockPos aBlockToGrowPlantOn = aWorld.getBlockAtCoords(aWorldX, aWorldY - 1, aWorldZ); - - boolean isSoil = block2.canSustainPlant( - aWorld, - aWorldX, - aWorldY - 1, - aWorldZ, - ForgeDirection.UP, - (BlockSapling) Blocks.sapling); - if ( - /* isSoil && */ aWorldY < 256 - l - 1) { - Logger.WARNING("Stepping through generateTree [4]"); - aBlockToGrowPlantOn - .onPlantGrow(aWorld, aWorldX, aWorldY - 1, aWorldZ, aWorldX, aWorldY, aWorldZ); - b0 = 3; - byte b1 = 0; - int l1; - int i2; - int j2; - int i3; - - for (k1 = aWorldY - b0 + l; k1 <= aWorldY + l; ++k1) { - i3 = k1 - (aWorldY + l); - l1 = b1 + 1 - i3 / 2; - - for (i2 = aWorldX - l1; i2 <= aWorldX + l1; ++i2) { - j2 = i2 - aWorldX; - - for (int k2 = aWorldZ - l1; k2 <= aWorldZ + l1; ++k2) { - int l2 = k2 - aWorldZ; - - if (Math.abs(j2) != l1 || Math.abs(l2) != l1 - || CORE.RANDOM.nextInt(2) != 0 && i3 != 0) { - Block block1 = aWorld.getBlock(i2, k1, k2); - - if (block1.isAir(null, i2, k1, k2) || block1.isLeaves(null, i2, k1, k2)) { - this.setBlockAndNotifyAdequately( - aWorld, - i2, - k1, - k2, - Blocks.leaves, - this.metaLeaves); - } - } - } - } - } - Logger.WARNING("Stepping through generateTree [5]"); - - for (k1 = 0; k1 < l; ++k1) { - block = aWorld.getBlock(aWorldX, aWorldY + k1, aWorldZ); - - if (block.isAir(null, aWorldX, aWorldY + k1, aWorldZ) - || block.isLeaves(null, aWorldX, aWorldY + k1, aWorldZ)) { - this.setBlockAndNotifyAdequately( - aWorld, - aWorldX, - aWorldY + k1, - aWorldZ, - Blocks.log, - this.metaWood); - - if (this.vinesGrow && k1 > 0) { - if (CORE.RANDOM.nextInt(3) > 0 - && aWorld.isAirBlock(aWorldX - 1, aWorldY + k1, aWorldZ)) { - this.setBlockAndNotifyAdequately( - aWorld, - aWorldX - 1, - aWorldY + k1, - aWorldZ, - Blocks.vine, - 8); - } - - if (CORE.RANDOM.nextInt(3) > 0 - && aWorld.isAirBlock(aWorldX + 1, aWorldY + k1, aWorldZ)) { - this.setBlockAndNotifyAdequately( - aWorld, - aWorldX + 1, - aWorldY + k1, - aWorldZ, - Blocks.vine, - 2); - } - - if (CORE.RANDOM.nextInt(3) > 0 - && aWorld.isAirBlock(aWorldX, aWorldY + k1, aWorldZ - 1)) { - this.setBlockAndNotifyAdequately( - aWorld, - aWorldX, - aWorldY + k1, - aWorldZ - 1, - Blocks.vine, - 1); - } - - if (CORE.RANDOM.nextInt(3) > 0 - && aWorld.isAirBlock(aWorldX, aWorldY + k1, aWorldZ + 1)) { - this.setBlockAndNotifyAdequately( - aWorld, - aWorldX, - aWorldY + k1, - aWorldZ + 1, - Blocks.vine, - 4); - } - } - } - } - Logger.WARNING("Stepping through generateTree [6]"); - - if (this.vinesGrow) { - Logger.WARNING("Stepping through generateTree [7]"); - for (k1 = aWorldY - 3 + l; k1 <= aWorldY + l; ++k1) { - i3 = k1 - (aWorldY + l); - l1 = 2 - i3 / 2; - - for (i2 = aWorldX - l1; i2 <= aWorldX + l1; ++i2) { - for (j2 = aWorldZ - l1; j2 <= aWorldZ + l1; ++j2) { - if (aWorld.getBlock(i2, k1, j2).isLeaves(null, i2, k1, j2)) { - if (CORE.RANDOM.nextInt(4) == 0 - && aWorld.getBlock(i2 - 1, k1, j2).isAir(null, i2 - 1, k1, j2)) { - this.growVines(aWorld, i2 - 1, k1, j2, 8); - } - - if (CORE.RANDOM.nextInt(4) == 0 - && aWorld.getBlock(i2 + 1, k1, j2).isAir(null, i2 + 1, k1, j2)) { - this.growVines(aWorld, i2 + 1, k1, j2, 2); - } - - if (CORE.RANDOM.nextInt(4) == 0 - && aWorld.getBlock(i2, k1, j2 - 1).isAir(null, i2, k1, j2 - 1)) { - this.growVines(aWorld, i2, k1, j2 - 1, 1); - } - - if (CORE.RANDOM.nextInt(4) == 0 - && aWorld.getBlock(i2, k1, j2 + 1).isAir(null, i2, k1, j2 + 1)) { - this.growVines(aWorld, i2, k1, j2 + 1, 4); - } - } - } - } - } - Logger.WARNING("Stepping through generateTree [8]"); - - if (CORE.RANDOM.nextInt(5) == 0 && l > 5) { - for (k1 = 0; k1 < 2; ++k1) { - for (i3 = 0; i3 < 4; ++i3) { - if (CORE.RANDOM.nextInt(4 - k1) == 0) { - l1 = CORE.RANDOM.nextInt(3); - this.setBlockAndNotifyAdequately( - aWorld, - aWorldX + Direction.offsetX[Direction.rotateOpposite[i3]], - aWorldY + l - 5 + k1, - aWorldZ + Direction.offsetZ[Direction.rotateOpposite[i3]], - Blocks.cocoa, - l1 << 2 | i3); - } - } - } - } - } - Logger.WARNING("Stepping through generateTree [9]"); - return true; - } else { - Logger.WARNING("Stepping through generateTree [10]"); - return false; - } - } - } else { - Logger.WARNING("Stepping through generateTree [11]"); - return false; - } - } - - /** - * Grows vines downward from the given block for a given length. Args: World, x, starty, z, vine-length - */ - private void growVines(FakeWorld aWorld, int aX, int aY, int aZ, int aMeta) { - int aLoopSize = vinesGrow ? MathUtils.randInt(0, 4) : 0; - for (int i = 0; i < aLoopSize; i++) { - this.setBlockAndNotifyAdequately(aWorld, aX, aY, aZ, Blocks.vine, aMeta); - } - } - - @Override - protected void setBlockAndNotifyAdequately(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMeta) { - setBlockAndNotifyAdequately(getWorld(), aX, aY, aZ, aBlock, aMeta); - } - - protected void setBlockAndNotifyAdequately(FakeWorld aWorld, int aX, int aY, int aZ, Block aBlock, int aMeta) { - if (aBlock != null && (aMeta >= 0 && aMeta <= Short.MAX_VALUE)) { - Logger.WARNING( - "Setting block " + aX - + ", " - + aY - + ", " - + aZ - + " | " - + aBlock.getLocalizedName() - + " | " - + aMeta); - aWorld.setBlockAtCoords(aX, aY, aZ, aBlock, aMeta); - // aOutputsFromGenerator.put(ItemUtils.simpleMetaStack(aBlock, aMeta, 1)); - } - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index 292ecf807d..cc4503e46e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -446,47 +446,6 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { GregtechItemList.Chip_MultiNerf_NoSpeedBonus .set(this.addItem(161, "No-Bonus Chip", "You won't like using this")); GregtechItemList.Chip_MultiNerf_NoEuBonus.set(this.addItem(162, "No-Bonus Chip", "You won't like using this")); - - /* - * GregtechItemList.Cover_Overflow_Item_ULV.set(this.addItem(165, "Item Overflow Valve (ULV)", - * "Maximum void amount: 8000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - * getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), - * getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_LV.set(this.addItem(166, - * "Item Overflow Valve (LV)", "Maximum void amount: 64000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, - * 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), - * getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_MV.set(this.addItem(167, - * "Item Overflow Valve (MV)", "Maximum void amount: 512000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, - * 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), - * getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_HV.set(this.addItem(168, - * "Item Overflow Valve (HV)", "Maximum void amount: 4096000", new - * Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), - * getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); - * GregtechItemList.Cover_Overflow_Item_EV.set(this.addItem(169, "Item Overflow Valve (EV)", - * "Maximum void amount: 32768000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - * getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), - * getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_IV.set(this.addItem(170, - * "Item Overflow Valve (IV)", "Maximum void amount: 262144000", new - * Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), - * getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); - * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_ULV.get(1L), new GT_MultiTexture(new - * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new - * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(8)); - * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_LV.get(1L), new GT_MultiTexture(new - * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new - * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(64)); - * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_MV.get(1L), new GT_MultiTexture(new - * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new - * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(512)); - * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_HV.get(1L), new GT_MultiTexture(new - * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new - * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(4096)); - * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_EV.get(1L), new GT_MultiTexture(new - * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new - * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(32768)); - * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_IV.get(1L), new GT_MultiTexture(new - * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new - * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(262144)); - */ } private boolean registerComponents_ULV() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java deleted file mode 100644 index 94a18c8f07..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java +++ /dev/null @@ -1,95 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.items.behaviours; - -import java.util.List; - -import net.minecraft.dispenser.IBlockSource; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import gregtech.api.enums.SubTag; -import gregtech.api.interfaces.IItemBehaviour; -import gregtech.api.items.GT_MetaBase_Item; - -public class Behaviour_Grinder implements IItemBehaviour<GT_MetaBase_Item> { - - @Override - public boolean onLeftClickEntity(GT_MetaBase_Item var1, ItemStack var2, EntityPlayer var3, Entity var4) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean onItemUse(GT_MetaBase_Item var1, ItemStack var2, EntityPlayer var3, World var4, int var5, int var6, - int var7, int var8, float var9, float var10, float var11) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean onItemUseFirst(GT_MetaBase_Item var1, ItemStack var2, EntityPlayer var3, World var4, int var5, - int var6, int var7, ForgeDirection side, float var9, float var10, float var11) { - // TODO Auto-generated method stub - return false; - } - - @Override - public ItemStack onItemRightClick(GT_MetaBase_Item var1, ItemStack var2, World var3, EntityPlayer var4) { - // TODO Auto-generated method stub - return null; - } - - @Override - public List<String> getAdditionalToolTips(GT_MetaBase_Item var1, List<String> var2, ItemStack var3) { - // TODO Auto-generated method stub - return null; - } - - @Override - public void onUpdate(GT_MetaBase_Item var1, ItemStack var2, World var3, Entity var4, int var5, boolean var6) { - // TODO Auto-generated method stub - - } - - @Override - public boolean isItemStackUsable(GT_MetaBase_Item var1, ItemStack var2) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean canDispense(GT_MetaBase_Item var1, IBlockSource var2, ItemStack var3) { - // TODO Auto-generated method stub - return false; - } - - @Override - public ItemStack onDispense(GT_MetaBase_Item var1, IBlockSource var2, ItemStack var3) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean hasProjectile(GT_MetaBase_Item var1, SubTag var2, ItemStack var3) { - // TODO Auto-generated method stub - return false; - } - - @Override - public EntityArrow getProjectile(GT_MetaBase_Item var1, SubTag var2, ItemStack var3, World var4, double var5, - double var7, double var9) { - // TODO Auto-generated method stub - return null; - } - - @Override - public EntityArrow getProjectile(GT_MetaBase_Item var1, SubTag var2, ItemStack var3, World var4, - EntityLivingBase var5, float var6) { - // TODO Auto-generated method stub - return null; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java deleted file mode 100644 index 9d0bcf4314..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java +++ /dev/null @@ -1,196 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.generators; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; - -import gregtech.api.enums.Dyes; -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 gregtech.api.util.GT_ModHandler; -import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler; -import gtPlusPlus.core.lib.CORE; - -public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { - - public GT_MetaTileEntity_Boiler_Solar(final int aID, final String aName, final String aNameRegional) { - super(aID, aName, aNameRegional, "Steam Power by the Sun"); - } - - public GT_MetaTileEntity_Boiler_Solar(final String aName, final int aTier, final String aDescription, - final ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); - } - - @Override - public String[] getDescription() { - return new String[] { this.mDescription, "Produces " + (this.getPollution() * 20) + " pollution/sec", - CORE.GT_Tooltip.get() }; - } - - @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[4][17][]; - for (byte i = -1; i < 16; i = (byte) (i + 1)) { - final ITexture[] tmp0 = { new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[0][(i + 1)] = tmp0; - final ITexture[] tmp1 = { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, - Dyes.getModulation(i, Dyes._NULL.mRGBa)), - new GT_RenderedTexture(Textures.BlockIcons.BOILER_SOLAR) }; - rTextures[1][(i + 1)] = tmp1; - final ITexture[] tmp2 = { new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; - rTextures[2][(i + 1)] = tmp2; - final ITexture[] tmp3 = { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, - Dyes.getModulation(i, Dyes._NULL.mRGBa)), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; - rTextures[3][(i + 1)] = tmp3; - } - return rTextures; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[side.offsetY == 0 ? ((byte) (side != facing ? 2 : 3)) : side.ordinal()][aColorIndex + 1]; - } - - @Override - public int maxProgresstime() { - return 500; - } - - @Override - public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescription, this.mTextures); - } - - private int mRunTime = 0; - - @Override - public void saveNBTData(final NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setInteger("mRunTime", this.mRunTime); - } - - @Override - public void loadNBTData(final NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - this.mRunTime = aNBT.getInteger("mRunTime"); - } - - @Override - public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) { - if (this.mTemperature <= 20) { - this.mTemperature = 20; - this.mLossTimer = 0; - } - if (++this.mLossTimer > 45) { - this.mTemperature -= 1; - this.mLossTimer = 0; - } - if (this.mSteam != null) { - final ForgeDirection side = aBaseMetaTileEntity.getFrontFacing(); - final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(side); - if (tTileEntity != null) { - final FluidStack tDrained = aBaseMetaTileEntity - .drain(side, Math.max(1, this.mSteam.amount / 2), false); - if (tDrained != null) { - final int tFilledAmount = tTileEntity.fill(side.getOpposite(), tDrained, false); - if (tFilledAmount > 0) { - tTileEntity.fill( - side.getOpposite(), - aBaseMetaTileEntity.drain(side, tFilledAmount, true), - true); - } - } - } - } - if ((aTick % 25L) == 0L) { - if (this.mTemperature > 100) { - if ((this.mFluid == null) || (!GT_ModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) { - this.mHadNoWater = true; - } else { - if (this.mHadNoWater) { - aBaseMetaTileEntity.doExplosion(2048L); - return; - } - this.mFluid.amount -= 1; - this.mRunTime += 1; - int tOutput = 150; - if (this.mRunTime > 10000) { - tOutput = Math.max(50, 150 - ((this.mRunTime - 10000) / 100)); - } - if (this.mSteam == null) { - this.mSteam = GT_ModHandler.getSteam(tOutput); - } else if (GT_ModHandler.isSteam(this.mSteam)) { - this.mSteam.amount += tOutput; - } else { - this.mSteam = GT_ModHandler.getSteam(tOutput); - } - } - } else { - this.mHadNoWater = false; - } - } - if ((this.mSteam != null) && (this.mSteam.amount > 16000)) { - this.sendSound((byte) 1); - this.mSteam.amount = 12000; - } - if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) - && ((aTick % 256L) == 0L) - && (!aBaseMetaTileEntity.getWorld().isThundering())) { - final boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() - && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F); - this.mProcessingEnergy += (bRain && (aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4)) - || !aBaseMetaTileEntity.getSkyAtSide(ForgeDirection.UP) ? 0 - : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1; - } - if ((this.mTemperature < 500) && (this.mProcessingEnergy > 0) && ((aTick % 12L) == 0L)) { - this.mProcessingEnergy -= 1; - this.mTemperature += 1; - } - aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); - } - } - - @Override - protected int getPollution() { - return 0; - } - - @Override - protected int getProductionPerSecond() { - return 0; - } - - @Override - protected int getMaxTemperature() { - return 0; - } - - @Override - protected int getEnergyConsumption() { - return 0; - } - - @Override - protected int getCooldownInterval() { - return 0; - } - - @Override - protected void updateFuel(IGregTechTileEntity iGregTechTileEntity, long l) {} -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java deleted file mode 100644 index 7df64e3f3a..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java +++ /dev/null @@ -1,171 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.generators; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; - -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; -import gregtech.api.enums.ItemList; -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 gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechRocketFuelGeneratorBase; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; - -public class GregtechMetaTileEntityDoubleFuelGeneratorBase extends GregtechRocketFuelGeneratorBase { - - public int mEfficiency; - - public GregtechMetaTileEntityDoubleFuelGeneratorBase(final int aID, final String aName, final String aNameRegional, - final int aTier) { - super( - aID, - aName, - aNameRegional, - aTier, - "Requires two liquid Fuels. Fuel A is Fastburn, Fuel B is slowburn.", - new ITexture[0]); - this.onConfigLoad(); - } - - public GregtechMetaTileEntityDoubleFuelGeneratorBase(final String aName, final int aTier, final String aDescription, - final ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); - this.onConfigLoad(); - } - - @Override - public String[] getDescription() { - return new String[] { this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick", - "Output Voltage: " + this.getOutputTier() + " EU/t", CORE.GT_Tooltip.get() }; - } - - @Override - public boolean isOutputFacing(final ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getFrontFacing(); - } - - @Override - public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaTileEntityDoubleFuelGeneratorBase( - this.mName, - this.mTier, - this.mDescription, - this.mTextures); - } - - @Override - public GT_Recipe.GT_Recipe_Map getRecipes() { - return GT_Recipe.GT_Recipe_Map.sDieselFuels; - } - - @Override - public int getCapacity() { - return 32000; - } - - public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, - "RocketEngine.efficiency.tier." + this.mTier, - (100 - (this.mTier * 8))); - } - - @Override - public int getEfficiency() { - return this.mEfficiency; - } - - @Override - public int getFuelValue(final ItemStack aStack) { - int rValue = Math.max((GT_ModHandler.getFuelCanValue(aStack) * 6) / 5, super.getFuelValue(aStack)); - if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) { - rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3); - } - return rValue; - } - - private GT_RenderedTexture getCasingTexture() { - if (this.mTier <= 4) { - return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top); - } else if (this.mTier == 5) { - - return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced); - } else { - - return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Ultra); - } - // return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top); - } - - @Override - public ITexture[] getFront(final byte aColor) { - return new ITexture[] { super.getFront(aColor)[0], this.getCasingTexture(), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; - } - - @Override - public ITexture[] getBack(final byte aColor) { - return new ITexture[] { super.getBack(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent) }; - } - - @Override - public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { super.getBottom(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; - } - - @Override - public ITexture[] getTop(final byte aColor) { - return new ITexture[] { super.getTop(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off) }; - } - - @Override - public ITexture[] getSides(final byte aColor) { - return new ITexture[] { super.getSides(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal) }; - } - - @Override - public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { super.getFrontActive(aColor)[0], this.getCasingTexture(), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; - } - - @Override - public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { super.getBackActive(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast) }; - } - - @Override - public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { super.getBottomActive(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; - } - - @Override - public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { super.getTopActive(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On) }; - } - - @Override - public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { super.getSidesActive(aColor)[0], this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active) }; - } - - @Override - public int getPollution() { - return 250; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java deleted file mode 100644 index e25ebb5daa..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java +++ /dev/null @@ -1,270 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; - -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.objects.GT_RenderedTexture; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; - -public class GregtechMetaTileEntityThaumcraftResearcher extends GregtechMetaTileEntity { - - public GregtechMetaTileEntityThaumcraftResearcher(final int aID, final String aName, final String aNameRegional, - final int aTier, final String aDescription, final int aSlotCount) { - super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); - } - - public GregtechMetaTileEntityThaumcraftResearcher(final String aName, final int aTier, final String aDescription, - final ITexture[][][] aTextures, final int aSlotCount) { - super(aName, aTier, aSlotCount, aDescription, aTextures); - } - - @Override - public String[] getDescription() { - return new String[] { this.mDescription, "Generates Thaumcraft research notes, because it's magic." }; - } - - @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[10][17][]; - for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = this.getFront(i); - rTextures[1][i + 1] = this.getBack(i); - rTextures[2][i + 1] = this.getBottom(i); - rTextures[3][i + 1] = this.getTop(i); - rTextures[4][i + 1] = this.getSides(i); - rTextures[5][i + 1] = this.getFrontActive(i); - rTextures[6][i + 1] = this.getBackActive(i); - rTextures[7][i + 1] = this.getBottomActive(i); - rTextures[8][i + 1] = this.getTopActive(i); - rTextures[9][i + 1] = this.getSidesActive(i); - } - return rTextures; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[(aActive ? 5 : 0) - + (side == facing ? 0 - : side == facing.getOpposite() ? 1 - : side == ForgeDirection.DOWN ? 2 : side == ForgeDirection.UP ? 3 : 4)][aColorIndex - + 1]; - } - - public ITexture[] getFront(final byte aColor) { - return new ITexture[] { getSides(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Metal_Grate_A) }; - } - - public ITexture[] getBack(final byte aColor) { - return new ITexture[] { getSides(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Metal_Grate_B) }; - } - - public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { getSides(aColor)[0] }; - } - - public ITexture[] getTop(final byte aColor) { - return new ITexture[] { getSides(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Blue) }; - } - - public ITexture[] getSides(final byte aColor) { - return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) }; - } - - public ITexture[] getFrontActive(final byte aColor) { - return getFront(aColor); - } - - public ITexture[] getBackActive(final byte aColor) { - return getBack(aColor); - } - - public ITexture[] getBottomActive(final byte aColor) { - return getBottom(aColor); - } - - public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { getSides(aColor)[0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; - } - - public ITexture[] getSidesActive(final byte aColor) { - return getSides(aColor); - } - - @Override - public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - super.onScrewdriverRightClick(side, aPlayer, aX, aY, aZ); - } - - @Override - public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaTileEntityThaumcraftResearcher( - this.mName, - this.mTier, - this.mDescription, - this.mTextures, - this.mInventory.length); - } - - @Override - public boolean isSimpleMachine() { - return false; - } - - @Override - public boolean isElectric() { - return true; - } - - @Override - public boolean isValidSlot(final int aIndex) { - return true; - } - - @Override - public boolean isFacingValid(final ForgeDirection facing) { - return true; - } - - @Override - public boolean isEnetInput() { - return true; - } - - @Override - public boolean isEnetOutput() { - return false; - } - - @Override - public boolean isInputFacing(final ForgeDirection side) { - return side != this.getBaseMetaTileEntity().getFrontFacing(); - } - - @Override - public boolean isOutputFacing(final ForgeDirection side) { - return side == this.getBaseMetaTileEntity().getBackFacing(); - } - - @Override - public boolean isTeleporterCompatible() { - return false; - } - - @Override - public long getMinimumStoredEU() { - return 0; - } - - @Override - public long maxEUStore() { - return 512000; - } - - @Override - public int rechargerSlotStartIndex() { - return 0; - } - - @Override - public int dechargerSlotStartIndex() { - return 0; - } - - @Override - public int rechargerSlotCount() { - return 0; - } - - @Override - public int dechargerSlotCount() { - return 0; - } - - @Override - public boolean isAccessAllowed(final EntityPlayer aPlayer) { - return true; - } - - @Override - public int getCapacity() { - return 128000; - } - - @Override - public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } - return true; - } - - @Override - public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - return side == this.getBaseMetaTileEntity().getBackFacing(); - } - - @Override - public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, - final ForgeDirection side, final ItemStack aStack) { - return true; - } - - @Override - public String[] getInfoData() { - return new String[] { this.getLocalName(), }; - } - - @Override - public boolean isGivingInformation() { - return true; - } - - @Override - public int getSizeInventory() { - return 2; - } - - @Override - public boolean isOverclockerUpgradable() { - return false; - } - - @Override - public boolean isTransformerUpgradable() { - return false; - } - - @Override - public void saveNBTData(final NBTTagCompound aNBT) { - // aNBT.setInteger("mCurrentPollution", this.mCurrentPollution); - // aNBT.setInteger("mAveragePollution", this.mAveragePollution); - } - - @Override - public void loadNBTData(final NBTTagCompound aNBT) { - // this.mCurrentPollution = aNBT.getInteger("mCurrentPollution"); - // this.mAveragePollution = aNBT.getInteger("mAveragePollution"); - } - - @Override - public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) { - super.onFirstTick(aBaseMetaTileEntity); - } - - @Override - public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java deleted file mode 100644 index b93bde0f30..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; public class - * GregtechMetaTileEntity_IndustrialSinter extends GT_MetaTileEntity_MultiBlockBase { RenderBlocks asdasd = - * RenderBlocks.getInstance(); public GregtechMetaTileEntity_IndustrialSinter(final int aID, final String aName, final - * String aNameRegional) { super(aID, aName, aNameRegional); } public GregtechMetaTileEntity_IndustrialSinter(final - * String aName) { super(aName); } - * @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new - * GregtechMetaTileEntity_IndustrialSinter(this.mName); } - * @Override public String[] getDescription() { return new String[]{ - * "Controller Block for the Industrial Sinter Furnace", "Size: 3x5x3 [WxLxH] (Hollow)", "Controller (front centered)", - * "2x Input Bus (side centered)", "2x Output Bus (side centered)", "1x Energy Hatch (top or bottom centered)", - * "1x Maintenance Hatch (back centered)", "Sinter Furnace Casings for the rest (32 at least!)", "Causes " + 20 * - * this.getPollutionPerTick(null) + " Pollution per second", CORE.GT_Tooltip.get() }; } - * @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte - * aFacing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { if (side == facing) { return new - * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(7)), new GT_RenderedTexture(aActive ? - * TexturesGtBlock.Overlay_Machine_Controller_Default_Active : TexturesGtBlock.Overlay_Machine_Controller_Default)}; } - * return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(7))}; } - * @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sWiremillRecipes; } - * @Override public boolean isCorrectMachinePart(final ItemStack aStack) { return true; } - * @Override public boolean isFacingValid(final ForgeDirection facing) { return facing.offsetY == 0; } - * @Override public boolean checkRecipe(final ItemStack aStack) { final ArrayList<ItemStack> tInputList = - * this.getStoredInputs(); for (final ItemStack tInput : tInputList) { final long tVoltage = this.getMaxInputVoltage(); - * final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); final GT_Recipe tRecipe = - * GT_Recipe.GT_Recipe_Map.sWiremillRecipes.findRecipe(this.getBaseMetaTileEntity(), false, - * gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[]{tInput}); if (tRecipe != null) { if - * (tRecipe.isRecipeInputEqual(true, null, new ItemStack[]{tInput})) { this.mEfficiency = (10000 - - * ((this.getIdealStatus() - this.getRepairStatus()) * 1000)); this.mEfficiencyIncrease = 10000; if (tRecipe.mEUt <= 16) - * { this.mEUt = (tRecipe.mEUt * (1 << (tTier - 1)) * (1 << (tTier - 1))); this.mMaxProgresstime = (tRecipe.mDuration / - * (1 << (tTier - 1))); } else { this.mEUt = tRecipe.mEUt; this.mMaxProgresstime = tRecipe.mDuration; while (this.mEUt - * <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { this.mEUt *= 4; this.mMaxProgresstime /= 2; } } if (this.mEUt > 0) - * { this.mEUt = (-this.mEUt); } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = new - * ItemStack[]{tRecipe.getOutput(0)}; this.updateSlots(); return true; } } } return false; } - * @Override public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { final - * int controllerX = aBaseMetaTileEntity.getXCoord(); final int controllerY = aBaseMetaTileEntity.getYCoord(); final int - * controllerZ = aBaseMetaTileEntity.getZCoord(); final byte tSide = this.getBaseMetaTileEntity().getBackFacing(); if - * ((this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 1)) && - * (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 2) && - * (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 3)))) { int - * tAirCount = 0; for (byte i = -1; i < 2; i = (byte) (i + 1)) { for (byte j = -1; j < 2; j = (byte) (j + 1)) { for - * (byte k = -1; k < 2; k = (byte) (k + 1)) { if (this.getBaseMetaTileEntity().getAirOffset(i, j, k)) { - * Logger.INFO("Found Air at: "+(controllerX+i)+" "+(controllerY+k)+" "+(controllerZ+k)); //if - * (aBaseMetaTileEntity.getWorld().isRemote){ //asdasd.renderStandardBlock(ModBlocks.MatterFabricatorEffectBlock, - * (controllerX+i), (controllerY+k), (controllerZ+k)); //UtilsRendering.drawBlockInWorld((controllerX+i), - * (controllerY+k), (controllerZ+k), Color.YELLOW_GREEN); //} tAirCount++; } } } } if (tAirCount != 10) { - * Logger.INFO("False. Air != 10. Air == "+tAirCount); //return false; } for (byte i = 2; i < 6; i = (byte) (i + 1)) { - * //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY), (controllerZ), Color.LIME_GREEN); - * IGregTechTileEntity tTileEntity; if ((null != (tTileEntity = - * this.getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) && (tTileEntity.getFrontFacing() == - * this.getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) && - * ((tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialSinter))) { - * //Utils.LOG_INFO("False 1"); return false; } } final int tX = this.getBaseMetaTileEntity().getXCoord(); final int tY - * = this.getBaseMetaTileEntity().getYCoord(); final int tZ = this.getBaseMetaTileEntity().getZCoord(); for (byte i = - * -1; i < 2; i = (byte) (i + 1)) { for (byte j = -1; j < 2; j = (byte) (j + 1)) { if ((i != 0) || (j != 0)) { for (byte - * k = 0; k < 5; k = (byte) (k + 1)) { //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), - * (controllerZ+k), Color.ORANGE); if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2) || (k == 3))) { - * //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), (controllerZ+k), Color.TOMATO); if - * ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : - * tside == ForgeDirection.SOUTH ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + - * (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tside == ForgeDirection.SOUTH ? k : i)) == - * this.getCasingMeta())) { } else if (!this.addToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + - * (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tside == ForgeDirection.SOUTH ? k : i))) && - * (!this.addEnergyInputToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide - * == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tside == ForgeDirection.SOUTH ? k : i))))) { Logger.INFO("False 2"); - * return false; } } else if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + - * j, tZ + (tSide == 2 ? -k : tside == ForgeDirection.SOUTH ? k : i)) == this.getCasingBlock()) && - * (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : - * tside == ForgeDirection.SOUTH ? k : i)) == this.getCasingMeta())) { } else { Logger.INFO("False 3"); return false; } - * } } } } if ((this.mOutputHatches.size() != 0) || (this.mInputHatches.size() != 0)) { - * Logger.INFO("Use Busses, Not Hatches for Input/Output."); return false; } if ((this.mInputBusses.size() != 2) || - * (this.mOutputBusses.size() != 2)) { Logger.INFO("Incorrect amount of Input & Output busses."); return false; } - * this.mMaintenanceHatches.clear(); final IGregTechTileEntity tTileEntity = - * this.getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), - * 4); if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) { if ((tTileEntity.getMetaTileEntity() - * instanceof GT_MetaTileEntity_Hatch_Maintenance)) { this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) - * tTileEntity.getMetaTileEntity()); ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = - * this.getCasingTextureIndex(); } else { Logger.INFO("Maintenance hatch must be in the middle block on the back."); - * return false; } } if ((this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() != 1)) { - * Logger.INFO("Incorrect amount of Maintenance or Energy hatches."); return false; } } else { Logger.INFO("False 5"); - * return false; } Logger.INFO("True"); return true; } - * @Override public int getMaxEfficiency(final ItemStack aStack) { return 10000; } - * @Override public int getPollutionPerTick(final ItemStack aStack) { return 0; } - * @Override public int getDamageToComponent(final ItemStack aStack) { return 0; } public int getAmountOfOutputs() { - * return 1; } - * @Override public boolean explodesOnComponentBreak(final ItemStack aStack) { return false; } public Block - * getCasingBlock() { return ModBlocks.blockCasingsMisc; } public byte getCasingMeta() { return 6; } public byte - * getCasingTextureIndex() { return 1; //TODO } private boolean addToMachineList(final IGregTechTileEntity tTileEntity) - * { return ((this.addMaintenanceToMachineList(tTileEntity, this.getCasingTextureIndex())) || - * (this.addInputToMachineList(tTileEntity, this.getCasingTextureIndex())) || (this.addOutputToMachineList(tTileEntity, - * this.getCasingTextureIndex())) || (this.addMufflerToMachineList(tTileEntity, this.getCasingTextureIndex()))); } - * private boolean addEnergyInputToMachineList(final IGregTechTileEntity tTileEntity) { return - * ((this.addEnergyInputToMachineList(tTileEntity, this.getCasingTextureIndex()))); } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java deleted file mode 100644 index 2913e5bbed..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; public class - * GregtechMTE_FastNeutronReactor extends GregtechMeta_MultiBlockBase { private int mSuperEfficencyIncrease = 0; public - * GregtechMTE_FastNeutronReactor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } - * public GregtechMTE_FastNeutronReactor(String mName) { super(mName); } - * @Override public String getMachineType() { return "Reactor"; } - * @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new - * GregtechMTE_FastNeutronReactor(this.mName); } - * @Override public boolean isFacingValid(ForgeDirection facing) { return facing.offsetY == 0; } - * @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } - * @Override public int getDamageToComponent(ItemStack aStack){ return 0; } - * @Override public boolean checkRecipe(final ItemStack aStack) { this.mSuperEfficencyIncrease=0; if - * (processing_Stage_1()) { if (processing_Stage_2()) { if (processing_Stage_3()) { if (processing_Stage_4()) { } else { - * //Stage 4 } } else { //Stage 3 } } else { //Stage 2 } } else { //Stage 1 } return false; } - * @Override public int getMaxParallelRecipes() { return 1; } - * @Override public int getEuDiscountForParallelism() { return 0; } public boolean processing_Stage_1() { //Deplete - * Water, Add More Progress Time for (GT_MetaTileEntity_Hatch_Input tRecipe : this.mInputHatches) { if - * (tRecipe.getFluid() != null){ FluidStack tFluid = FluidUtils.getFluidStack(tRecipe.getFluid(), 200); if (tFluid != - * null) { if (tFluid == GT_ModHandler.getDistilledWater(1)) { if (depleteInput(tFluid)) { this.mMaxProgresstime = - * Math.max(1, runtimeBoost(8 * 2)); this.mEUt = getEUt(); this.mEfficiencyIncrease = (this.mMaxProgresstime * - * getEfficiencyIncrease()); return true; } } } } } this.mMaxProgresstime = 0; this.mEUt = 0; return false; } public - * boolean processing_Stage_2() { return false; } public boolean processing_Stage_3() { return false; } public boolean - * processing_Stage_4() { return false; } - * @Override public boolean onRunningTick(ItemStack aStack) { if (this.mEUt > 0) { if(this.mSuperEfficencyIncrease>0){ - * this.mEfficiency = Math.min(10000, this.mEfficiency + this.mSuperEfficencyIncrease); } int tGeneratedEU = (int) - * (this.mEUt * 2L * this.mEfficiency / 10000L); if (tGeneratedEU > 0) { long amount = (tGeneratedEU + 160) / 160; if - * (!depleteInput(GT_ModHandler.getDistilledWater(amount))) { explodeMultiblock(); } else { - * addOutput(GT_ModHandler.getSteam(tGeneratedEU)); } } return true; } return true; } public int getEUt() { return 0; - * //Default 400 } public int getEfficiencyIncrease() { return 0; //Default 12 } int runtimeBoost(int mTime) { return - * mTime * 150 / 100; } - * @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return true; } - * @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; } - * @Override public int getPollutionPerTick(ItemStack aStack) { return 0; } public int getAmountOfOutputs() { return 1; - * } - * @Override public String[] getTooltip() { return new String[]{ "Fukushima-Daiichi Reactor No. 6", - * "------------------------------------------", "Boiling Water Reactor", "Harness the power of Nuclear Fission", - * "------------------------------------------", "Consult user manual for more information", }; } - * @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte - * aFacing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { if (side == facing) { return new - * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(1)), new GT_RenderedTexture(aActive ? - * Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : - * Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; } return new - * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(1))}; } - * @Override public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack arg1) { return true; } - * public boolean damageFilter(){ return false; } - * @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - * super.onPostTick(aBaseMetaTileEntity, aTick); } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java deleted file mode 100644 index 5b190f09db..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; public class - * GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase { public ArrayList<GT_MetaTileEntity_Hatch_Naquadah> - * mNaqHatches = new ArrayList<GT_MetaTileEntity_Hatch_Naquadah>(); public static String[] mCasingName = new String[5]; - * public static String mHatchName = "Naquadah Fuel Hatch"; private final int CASING_TEXTURE_ID = - * TAE.getIndexFromPage(0, 13); private final int META_BaseCasing = 0; //4 private final int META_ContainmentCasing = - * 15; //3 private final int META_Shielding = 13; //1 private final int META_PipeCasing = 1; //4 private final int - * META_IntegralCasing = 6; //0 private final int META_ContainmentChamberCasing = 2; //4 public - * GregtechMTE_LargeNaqReactor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - * mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0); mCasingName[1] = - * LangUtils.getLocalizedNameOfBlock(getCasing(4), 1); mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), - * 2); mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15); mCasingName[4] = - * LangUtils.getLocalizedNameOfBlock(getCasing(1), 13); mHatchName = - * LangUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 969); } public GregtechMTE_LargeNaqReactor(String - * aName) { super(aName); } public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new - * GregtechMTE_LargeNaqReactor(this.mName); } public String[] getTooltip() { if - * (mCasingName[0].toLowerCase().contains(".name")) { mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), - * 0); } if (mCasingName[1].toLowerCase().contains(".name")) { mCasingName[1] = - * LangUtils.getLocalizedNameOfBlock(getCasing(4), 1); } if (mCasingName[2].toLowerCase().contains(".name")) { - * mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2); } if - * (mCasingName[3].toLowerCase().contains(".name")) { mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), - * 15); } if (mCasingName[4].toLowerCase().contains(".name")) { mCasingName[4] = - * LangUtils.getLocalizedNameOfBlock(getCasing(1), 13); } if (mHatchName.toLowerCase().contains(".name")) { mHatchName = - * LangUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 969); } return new String[]{ - * "Naquadah reacts violently with potassium, ", "resulting in massive explosions with radioactive potential.", - * "Size: 3x4x12, WxHxL", "Bottom Layer: "+mCasingName[0]+"s, (30x min)", - * "Middle Layer: "+mCasingName[2]+"s (10x), with", " "+mCasingName[3]+"s on either side", - * " "+mCasingName[3]+"s also on each end (x26)", "Middle Layer2: "+mCasingName[1]+" (12x total), with", - * " "+mCasingName[4]+"s on either side (x24)", - * "Top: Single row of "+mCasingName[0]+" along the middle (x12) ", "", "1x " + mHatchName + - * " (Any bottom layer casing)", "1x " + "Maintenance Hatch" + " (Any bottom layer side casing)", "1x " + "Energy Hatch" - * + " (Any top layer casing)", }; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, - * byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return side == facing ? new - * ITexture[]{BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(3, 0)), new GT_RenderedTexture(aActive ? - * TexturesGtBlock.Overlay_Machine_Controller_Default_Active : TexturesGtBlock.Overlay_Machine_Controller_Default)} : - * new ITexture[]{BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(3, 0))}; } public GT_Recipe_Map getRecipeMap() { - * return null; } public boolean isCorrectMachinePart(ItemStack aStack) { return true; } public boolean - * isFacingValid(byte aFacing) { return aFacing == 1; } public boolean checkRecipe(ItemStack aStack) { return false; } - * @Override public int getMaxParallelRecipes() { return 1; } - * @Override public int getEuDiscountForParallelism() { return 0; } public void startSoundLoop(byte aIndex, double aX, - * double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 20) { - * GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ); } } - * @Override public String getSound() { return (String) GregTech_API.sSoundList.get(Integer.valueOf(212)); } private - * Block getCasing(int casingID) { if (casingID == 1) { return ModBlocks.blockCasingsMisc; } else if (casingID == 2) { - * return ModBlocks.blockCasings2Misc; } else if (casingID == 3) { return ModBlocks.blockCasings3Misc; } else if - * (casingID == 4) { return ModBlocks.blockCasings4Misc; } else { return ModBlocks.blockCasingsTieredGTPP; } } - * //Casing3, Meta 10 - "Grate Machine Casing"); //Casing2, Meta 0 - "Solid Steel Machine Casing" //Casing2, Meta 5 - - * "Assembling Line Casing" //Casing2, Meta 9 - "Assembler Machine Casing" //Magic Glass - blockAlloyGlass public - * boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 4; int zDir = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 4; // Counts for all Casing Types int - * aBaseCasingCount = 0; int aContainmentCasingCount = 0; int aShieldingCount = 0; int aPipeCount = 0; int - * aIntegralCasingCount = 0; int aContainmentChamberCount = 0; // Bottom Layer aBaseCasingCount += - * checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, -7, xDir, zDir); - * log("Bottom Layer is Valid. Moving to Layer 1."); // Layer 1 aShieldingCount += checkOuterRing(aBaseMetaTileEntity, - * getCasing(1), this.META_Shielding, -6, xDir, zDir); aIntegralCasingCount += checkIntegralRing(aBaseMetaTileEntity, - * getCasing(0), this.META_IntegralCasing, -6, xDir, zDir); aContainmentChamberCount += - * checkContainmentRing(aBaseMetaTileEntity, getCasing(4), this.META_ContainmentChamberCasing, -6, xDir, zDir); - * log("Layer 1 is Valid. Moving to Layer 2."); // Layer 2 aShieldingCount += checkOuterRing(aBaseMetaTileEntity, - * getCasing(1), this.META_Shielding, -5, xDir, zDir); aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), - * this.META_PipeCasing, -5, xDir, zDir); log("Layer 2 is Valid. Moving to Layer 3."); // Layer 3 - * aContainmentCasingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -4, xDir, - * zDir); aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -4, xDir, zDir); - * log("Layer 3 is Valid. Moving to Layer 4."); // Layer 4 aContainmentCasingCount += - * checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -3, xDir, zDir); aPipeCount += - * checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -3, xDir, zDir); - * log("Layer 4 is Valid. Moving to Layer 5."); // Layer 5 aShieldingCount += checkOuterRing(aBaseMetaTileEntity, - * getCasing(1), this.META_Shielding, -2, xDir, zDir); aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), - * this.META_PipeCasing, -2, xDir, zDir); log("Layer 5 is Valid. Moving to Layer 6."); // Layer 6 aShieldingCount += - * checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -1, xDir, zDir); aIntegralCasingCount += - * checkIntegralRing(aBaseMetaTileEntity, getCasing(0), this.META_IntegralCasing, -1, xDir, zDir); - * aContainmentChamberCount += checkContainmentRing(aBaseMetaTileEntity, getCasing(4), - * this.META_ContainmentChamberCasing, -1, xDir, zDir); log("Layer 6 is Valid. Moving to Top Layer."); // Top Layer - * aBaseCasingCount += checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, 0, xDir, zDir); - * log("Found "+aBaseCasingCount+" "+mCasingName[0]+"s"); log("Found "+aShieldingCount+" "+mCasingName[4]+"s"); - * log("Found "+aPipeCount+" "+mCasingName[1]+"s"); log("Found "+aContainmentCasingCount+" "+mCasingName[3]+"s"); - * log("Found "+aIntegralCasingCount+" "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s"); - * log("Found "+aContainmentChamberCount+" "+mCasingName[2]+"s"); // Try mesage player String aOwnerName = - * this.getBaseMetaTileEntity().getOwnerName(); EntityPlayer aOwner = null; if (aOwnerName != null && - * aOwnerName.length() > 0) { aOwner = PlayerUtils.getPlayer(aOwnerName); } if (aShieldingCount != 128) { - * log("Not enough "+mCasingName[4]+"s, require 128."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, - * "Not enough "+mCasingName[4]+"s, require 128."); } return false; } if (aPipeCount != 20) { - * log("Not enough "+mCasingName[1]+"s, require 20."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, - * "Not enough "+mCasingName[1]+"s, require 20."); } return false; } if (aContainmentCasingCount != 64) { - * log("Not enough "+mCasingName[3]+"s, require 64."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, - * "Not enough "+mCasingName[3]+"s, require 64."); } return false; } if (aContainmentChamberCount != 42) { - * log("Not enough "+mCasingName[2]+"s, require 42."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, - * "Not enough "+mCasingName[2]+"s, require 42."); } return false; } if (aBaseCasingCount < 140) { - * log("Not enough "+mCasingName[0]+"s, require 140 at a minimum."); if (aOwner != null) { - * PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[0]+"s, require 140 at a minimum."); } return false; } if - * (aIntegralCasingCount != 48) { log("Not enough "+LangUtils.getLocalizedNameOfBlock(getCasing(0), - * 6)+"s, require 48."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, - * "Not enough "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s, require 48."); } return false; } - * log("LNR Formed."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, - * "Large Naquadah Reactor has formed successfully."); } return true; } public boolean - * addNaquadahHatchToMachineInput(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { - * return false; } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == - * null) { return false; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Naquadah) { - * this.updateTexture(aMetaTileEntity, aBaseCasingIndex); return this.mNaqHatches.add((GT_MetaTileEntity_Hatch_Naquadah) - * aMetaTileEntity); } else { return false; } } } public int checkEntireLayer(IGregTechTileEntity aBaseMetaTileEntity, - * Block aBlock, int aMeta, int aY, int xDir, int zDir) { int aCasingCount = 0; for (int x = -4; x < 5; x++) { for (int - * z = -4; z < 5; z++) { int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = - * this.getBaseMetaTileEntity().getYCoord() + aY; int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip - * the corners if ((x == 4 && z == 4) || (x == -4 && z == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) { continue; - * } // Skip controller if (aY == 0 && x == 0 && z == 0) { continue; } Block aCurrentBlock = - * aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); int aCurrentMeta = (int) - * aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { - * aCasingCount++; } final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, - * aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, - * aBlock, aMeta)) { log("Layer has error. Height: "+aY); //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, - * aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; } } } return aCasingCount; } public int - * checkOuterRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { int - * aCasingCount = 0; for (int x = -4; x < 5; x++) { for (int z = -4; z < 5; z++) { int aOffsetX = - * this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY; int - * aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip the corners if ((x == 4 && z == 4) || (x == -4 && z - * == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) { continue; } // If we are on the 5x5 ring, proceed if ((x > -4 - * && x < 4 ) && (z > -4 && z < 4)) { if ((x == 3 && z == 3) || (x == -3 && z == -3) || (x == 3 && z == -3) || (x == -3 - * && z == 3)) { //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); } - * else { continue; } } Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); int - * aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && - * aCurrentMeta == aMeta) { aCasingCount++; } final IGregTechTileEntity tTileEntity = - * aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, - * CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { log("Layer has error. Height: "+aY); - * //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; } } } - * return aCasingCount; } public int checkIntegralRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, - * int aY, int xDir, int zDir) { int aCasingCount = 0; for (int x = -3; x < 4; x++) { for (int z = -3; z < 4; z++) { int - * aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + - * aY; int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip the corners if ((x == 3 && z == 3) || (x == - * -3 && z == -3) || (x == 3 && z == -3) || (x == -3 && z == 3)) { continue; } // If we are on the 5x5 ring, proceed if - * ((x > -3 && x < 3 ) && (z > -3 && z < 3)) { if ((x == 2 && z == 2) || (x == -2 && z == -2) || (x == 2 && z == -2) || - * (x == -2 && z == 2)) { //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, - * aMeta, 3); } else { continue; } } Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); - * int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && - * aCurrentMeta == aMeta) { aCasingCount++; } final IGregTechTileEntity tTileEntity = - * aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, - * CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { log("Layer has error. Height: "+aY); - * //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; } } } - * return aCasingCount; } public int checkPipes(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int - * aY, int xDir, int zDir) { int aCasingCount = 0; for (int x = -1; x < 2; x++) { for (int z = -1; z < 2; z++) { int - * aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + - * aY; int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip the corners if ((x == 1 && z == 1) || (x == - * -1 && z == -1) || (x == 1 && z == -1) || (x == -1 && z == 1) || (x == 0 && z == 0)) { Block aCurrentBlock = - * aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); int aCurrentMeta = (int) - * aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { - * aCasingCount++; } final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, - * aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, - * aBlock, aMeta)) { log("Pipe has error. Height: "+aY); //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, - * aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; }; } } } return aCasingCount; } public int - * checkContainmentRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { - * int aCasingCount = 0; for (int x = -2; x < 3; x++) { for (int z = -2; z < 3; z++) { int aOffsetX = - * this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY; int - * aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip the corners if ((x == 2 && z == 2) || (x == -2 && z - * == -2) || (x == 2 && z == -2) || (x == -2 && z == 2)) { continue; } Block aCurrentBlock = - * aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); int aCurrentMeta = (int) - * aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { - * aCasingCount++; } final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, - * aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, - * aBlock, aMeta)) { log("Layer has error. Height: "+aY); //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, - * aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; } } } return aCasingCount; } public int getMaxEfficiency(ItemStack - * aStack) { return 10000; } public int getPollutionPerTick(ItemStack aStack) { return 133; } public int - * getDamageToComponent(ItemStack aStack) { return 0; } public boolean explodesOnComponentBreak(ItemStack aStack) { - * return false; } - * @Override public String getMachineType() { return "Reactor"; } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java deleted file mode 100644 index 4d245cedc3..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; public class - * GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase { public long currentVoltage = GT_Values.V[7]; public - * byte currentTier = 8; public void upvolt() { byte f = currentTier; if ((f+1) > 10) { f = 8; } else { f++; } - * this.currentTier = f; updateVoltage(); } public void downvolt() { byte f = currentTier; if ((f-1) < 8) { f = 10; } - * else { f--; } this.currentTier = f; updateVoltage(); } private long updateVoltage() { this.currentVoltage = - * GT_Values.V[this.currentTier-1]; return currentVoltage; } public GregtechMTE_MiniFusionPlant(String aName) { - * super(aName); } public GregtechMTE_MiniFusionPlant(int aID, String aName, String aNameRegional) { super(aID, aName, - * aNameRegional); } - * @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new - * GregtechMTE_MiniFusionPlant(this.mName); } - * @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } - * @Override public int getDamageToComponent(ItemStack aStack) { return 0; } - * @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte - * aFacing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == - * this.getBaseMetaTileEntity().getBackFacing()) { return new - * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10)), - * Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[(int) this.getInputTier()]}; } if (side == ForgeDirection.UP) { return - * new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10)), - * Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[(int) this.getOutputTier()]}; } if (side == facing) { return new - * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10)), new GT_RenderedTexture(aActive ? - * Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER)}; } return - * new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10))}; } - * @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes; } - * @Override public String getMachineType() { return "Fusion Reactor"; } - * @Override public String[] getTooltip() { return new String[] { "Small scale fusion", - * "16x slower than using Multiblock of the same voltage", //"Input voltage can be changed within the GUI", - * "Place Input/Output Hatches on sides and bottom", "Power can only be inserted into the back", - * //e"Power can only be extracted from the top", TAG_HIDE_HATCHES }; } - * @Override public int getMaxParallelRecipes() { return 1; } - * @Override public int getEuDiscountForParallelism() { return 0; } - * @Override public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; int xDir2 = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()).offsetX; int zDir2 = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()).offsetZ; int tAmount = 0; ForgeDirection aDir = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()); //Require air in front, I think if - * (!aBaseMetaTileEntity.getAirOffset(xDir2, 0, zDir2)) { Logger.INFO("Did not find air in front"); return false; } else - * { for (int i = -1; i < 2; ++i) { for (int j = -1; j < 2; ++j) { for (int h = -1; h < 2; ++h) { if (h != 0 || (xDir + - * i != 0 || zDir + j != 0) && (i != 0 || j != 0)) { IGregTechTileEntity tTileEntity = - * aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); if (this.addToMachineList(tTileEntity, - * TAE.GTPP_INDEX(10))) { tAmount++; } } } } } } Logger.INFO("Tanks found: "+tAmount); return tAmount == 3; } - * @Override public boolean checkRecipe(ItemStack arg0) { ArrayList tFluidList = this.getStoredFluids(); int - * tFluidList_sS = tFluidList.size(); for (int tFluids = 0; tFluids < tFluidList_sS - 1; ++tFluids) { for (int tRecipe = - * tFluids + 1; tRecipe < tFluidList_sS; ++tRecipe) { if (GT_Utility.areFluidsEqual((FluidStack) - * tFluidList.get(tFluids), (FluidStack) tFluidList.get(tRecipe))) { if (((FluidStack) tFluidList.get(tFluids)).amount < - * ((FluidStack) tFluidList.get(tRecipe)).amount) { tFluidList.remove(tFluids--); tFluidList_sS = tFluidList.size(); - * break; } tFluidList.remove(tRecipe--); tFluidList_sS = tFluidList.size(); } } } int aStep = 0; - * //Logger.INFO("Step "+aStep++); if (tFluidList.size() > 1) { //Logger.INFO("Step "+aStep++); FluidStack[] arg5 = - * (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]); GT_Recipe arg6 = - * getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, this.getMaxInputVoltage(), arg5, new - * ItemStack[0]); if (arg6 == null && !this.mRunningOnLoad || (arg6 != null && this.maxEUStore() < (long) - * arg6.mSpecialValue)) { //Logger.INFO("Bad Step "+aStep++); //this.turnCasingActive(false); this.mLastRecipe = null; - * return false; } //Logger.INFO("Step "+aStep++); if (this.mRunningOnLoad || (arg6 != null && - * arg6.isRecipeInputEqual(true, arg5, new ItemStack[0]))) { //Logger.INFO("Step "+aStep++); this.mLastRecipe = arg6; - * this.mEUt = this.mLastRecipe.mEUt * 1; this.mMaxProgresstime = this.mLastRecipe.mDuration / 1; - * this.mEfficiencyIncrease = 10000; this.mOutputFluids = this.mLastRecipe.mFluidOutputs; //this.turnCasingActive(true); - * this.mRunningOnLoad = false; return true; } //Logger.INFO("Step "+aStep++); } //Logger.INFO("Step "+aStep++); return - * false; //return this.checkRecipeGeneric(this.getMaxParallelRecipes(), getEuDiscountForParallelism(), 0); } - * @Override public int getMaxEfficiency(ItemStack arg0) { return 10000; } - * @Override public boolean drainEnergyInput(long aEU) { // Not applicable to this machine return true; } - * @Override public boolean addEnergyOutput(long aEU) { // Not applicable to this machine return true; } - * @Override public long maxEUStore() { return this.getMaxInputVoltage() * 256 * 512; } - * @Override public long getMinimumStoredEU() { return 0; } - * @Override public String[] getExtraInfoData() { String mode = EnumChatFormatting.BLUE + "" + currentVoltage + - * EnumChatFormatting.RESET; String aOutput = EnumChatFormatting.BLUE + "" + mEUt + EnumChatFormatting.RESET; String - * storedEnergyText; if (this.getEUVar() > maxEUStore()) { storedEnergyText = EnumChatFormatting.RED + - * GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET; } else { storedEnergyText = - * EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET; } return new - * String[]{ "Stored EU: " + storedEnergyText, "Capacity: " + EnumChatFormatting.YELLOW + - * GT_Utility.formatNumbers(this.maxEUStore()) + EnumChatFormatting.RESET, "Voltage: " + mode, "Output Voltage: " + - * aOutput }; } - * @Override public void explodeMultiblock() { super.explodeMultiblock(); } - * @Override public void doExplosion(long aExplosionPower) { super.doExplosion(aExplosionPower); } - * @Override public long getMaxInputVoltage() { return updateVoltage(); } - * @Override public long getInputTier() { return (long) GT_Utility.getTier(maxEUInput()); } - * @Override public boolean isElectric() { return true; } - * @Override public boolean isEnetInput() { return true; } - * @Override public boolean isEnetOutput() { return false; } - * @Override public boolean isInputFacing(ForgeDirection side) { return (aSide == - * this.getBaseMetaTileEntity().getBackFacing()); } - * @Override public boolean isOutputFacing(ForgeDirection side) { return side == ForgeDirection.UP; } - * @Override public long maxAmperesIn() { return 32; } - * @Override public long maxAmperesOut() { return 1; } - * @Override public long maxEUInput() { return updateVoltage(); } - * @Override public long maxEUOutput() { return mEUt > 0 ? mEUt : 0; } - * @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - * super.onPostTick(aBaseMetaTileEntity, aTick); this.mWrench = true; this.mScrewdriver = true; this.mSoftHammer = true; - * this.mHardHammer = true; this.mSolderingTool = true; this.mCrowbar = true; } - * @Override public boolean causeMaintenanceIssue() { return true; } - * @Override public int getControlCoreTier() { return this.currentTier; } - * @Override public int getPollutionPerTick(ItemStack arg0) { return 0; } - * @Override public GT_MetaTileEntity_Hatch_ControlCore getControlCoreBus() { GT_MetaTileEntity_Hatch_ControlCore x = - * new GT_MetaTileEntity_Hatch_ControlCore("", 0, "", null); return (GT_MetaTileEntity_Hatch_ControlCore) x; } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java index ef1d88d05b..ac961f8fdc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java @@ -75,7 +75,6 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< public static int CASING_TEXTURE_ID; public static String mCasingName = "Sterile Farm Casing"; - // public static TreeGenerator mTreeData; public static HashMap<String, ItemStack> sLogCache = new HashMap<>(); private static final int TICKS_PER_OPERATION = 100; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java deleted file mode 100644 index 97bd9dbce7..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.bedrock; public class - * GregtechMetaTileEntity_BedrockMiningPlatform1 extends GregtechMetaTileEntity_BedrockMiningPlatformBase { public - * GregtechMetaTileEntity_BedrockMiningPlatform1(final int aID, final String aName, final String aNameRegional) { - * super(aID, aName, aNameRegional); } public GregtechMetaTileEntity_BedrockMiningPlatform1(final String aName) { - * super(aName); } public String[] getTooltip() { return this.getDescriptionInternal("I"); } public IMetaTileEntity - * newMetaEntity(final IGregTechTileEntity aTileEntity) { return (IMetaTileEntity) new - * GregtechMetaTileEntity_BedrockMiningPlatform1(this.mName); } protected Material getFrameMaterial() { return - * ALLOY.INCONEL_690; } protected int getCasingTextureIndex() { return TAE.getIndexFromPage(0, 14); } protected int - * getRadiusInChunks() { return 9; } protected int getMinTier() { return 5; } protected int getBaseProgressTime() { - * return (int) (420*(this.mProductionModifier/100)); } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java deleted file mode 100644 index b4be6eb80f..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.bedrock; public class - * GregtechMetaTileEntity_BedrockMiningPlatform2 extends GregtechMetaTileEntity_BedrockMiningPlatformBase { public - * GregtechMetaTileEntity_BedrockMiningPlatform2(final int aID, final String aName, final String aNameRegional) { - * super(aID, aName, aNameRegional); } public GregtechMetaTileEntity_BedrockMiningPlatform2(final String aName) { - * super(aName); } public String[] getTooltip() { return this.getDescriptionInternal("II"); } public IMetaTileEntity - * newMetaEntity(final IGregTechTileEntity aTileEntity) { return (IMetaTileEntity) new - * GregtechMetaTileEntity_BedrockMiningPlatform2(this.mName); } protected Material getFrameMaterial() { return - * ELEMENT.getInstance().AMERICIUM241; } protected int getCasingTextureIndex() { return 62; } protected int - * getRadiusInChunks() { return 9; } protected int getMinTier() { return 5; } protected int getBaseProgressTime() { - * return 480; } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java deleted file mode 100644 index 810be16b79..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java +++ /dev/null @@ -1,621 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.bedrock; - -import static gregtech.api.enums.Mods.Railcraft; -import static gregtech.api.enums.Mods.Thaumcraft; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; - -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; -import gregtech.common.GT_Worldgen_GT_Ore_Layer; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.material.ORES; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.MiningUtils; -import gtPlusPlus.core.util.minecraft.OreDictUtils; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; - -public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends GregtechMeta_MultiBlockBase { - - protected double mProductionModifier = 0; - - private static final ItemStack miningPipe; - private static final ItemStack miningPipeTip; - - private Block casingBlock; - private int casingMeta; - // private int frameMeta; - private int casingTextureIndex; - - private ForgeDirection back; - - private int xDrill; - private int yDrill; - private int zDrill; - - private int[] xCenter = new int[5]; - private int[] zCenter = new int[5]; - - public GregtechMetaTileEntity_BedrockMiningPlatformBase(final int aID, final String aName, - final String aNameRegional) { - super(aID, aName, aNameRegional); - this.initFields(); - } - - public GregtechMetaTileEntity_BedrockMiningPlatformBase(final String aName) { - super(aName); - this.initFields(); - } - - private void initFields() { - this.casingBlock = this.getCasingBlockItem().getBlock(); - this.casingMeta = this.getCasingBlockItem().get(0L, new Object[0]).getItemDamage(); - this.casingTextureIndex = this.getCasingTextureIndex(); - } - - @Override - protected IIconContainer getActiveOverlay() { - return Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT_ACTIVE; - } - - @Override - protected IIconContainer getInactiveOverlay() { - return Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_FRONT; - } - - @Override - protected int getCasingTextureId() { - return this.casingTextureIndex; - } - - @Override - public int getAmountOfOutputs() { - return 1; - } - - @Override - public void saveNBTData(final NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setDouble("mProductionModifier", mProductionModifier); - } - - @Override - public void loadNBTData(final NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - this.mProductionModifier = aNBT.getDouble("mProductionModifier"); - } - - @Override - public boolean checkRecipe(final ItemStack aStack) { - // this.setElectricityStats(); - - if (true) { - return false; - } - - boolean[] didWork = new boolean[5]; - - if (!this.tryConsumeDrillingFluid()) { - Logger.INFO("No drilling Fluid."); - return false; - } - - if (MathUtils.isNumberEven((int) this.mProductionModifier)) { - if (!this.tryConsumePyrotheum()) { - Logger.INFO("No tryConsumePyrotheum Fluid."); - return false; - } else { - mProductionModifier++; - } - } else { - if (!this.tryConsumeCryotheum()) { - Logger.INFO("No tryConsumeCryotheum Fluid."); - return false; - } else { - mProductionModifier++; - } - } - - for (int i = 0; i < 5; i++) { - process(); - didWork[i] = true; - } - - // Fail recipe handling if one pipe didn't handle properly, to try again - // next run. - for (boolean y : didWork) { - if (!y) { - Logger.INFO("[Bedrock Miner] Fail [x]"); - return false; - } - } - - this.lEUt = -8000; - this.mMaxProgresstime = 1; - this.mEfficiencyIncrease = 10000; - - return true; - } - - private boolean isEnergyEnough() { - long requiredEnergy = 512L + this.getMaxInputVoltage() * 4L; - for (final GT_MetaTileEntity_Hatch_Energy energyHatch : this.mEnergyHatches) { - requiredEnergy -= energyHatch.getEUVar(); - if (requiredEnergy <= 0L) { - return true; - } - } - return false; - } - - private void setElectricityStats() { - // this.mEfficiency = this.getCurrentEfficiency((ItemStack) null); - this.mEfficiencyIncrease = 10000; - final int overclock = 8 << GT_Utility.getTier(this.getMaxInputVoltage()); - // this.mEUt = -12 * overclock * overclock; - Logger.INFO("Trying to set EU to " + (12 * overclock * overclock)); - int mCombinedAvgTime = 0; - for (int g = 0; g < 5; g++) { - mCombinedAvgTime += this.getBaseProgressTime() / overclock; - } - Logger.INFO("Trying to set Max Time to " + (mCombinedAvgTime)); - // this.mMaxProgresstime = (mCombinedAvgTime / 5); - } - - private boolean tryConsumeDrillingFluid() { - boolean consumed = false; - boolean g = (this.getBaseMetaTileEntity().getWorld().getTotalWorldTime() % 2 == 0); - consumed = (g ? tryConsumePyrotheum() : tryConsumeCryotheum()); - if (consumed) { - // increaseProduction(g ? 2 : 1); - } else { - // lowerProduction(g ? 5 : 3); - } - return consumed; - } - - private boolean tryConsumePyrotheum() { - return this.depleteInput(FluidUtils.getFluidStack("pyrotheum", 4)); - } - - private boolean tryConsumeCryotheum() { - return this.depleteInput(FluidUtils.getFluidStack("cryotheum", 4)); - } - - private void putMiningPipesFromInputsInController() { - final int maxPipes = 64; - if (this.isHasMiningPipes(maxPipes)) { - return; - } - ItemStack pipes = this.getStackInSlot(1); - for (final ItemStack storedItem : this.getStoredInputs()) { - if (!storedItem.isItemEqual(GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe)) { - continue; - } - if (pipes == null) { - this.setInventorySlotContents( - 1, - GT_Utility.copy(new Object[] { GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe })); - pipes = this.getStackInSlot(1); - } - if (pipes.stackSize == maxPipes) { - break; - } - final int needPipes = maxPipes - pipes.stackSize; - final int transferPipes = (storedItem.stackSize < needPipes) ? storedItem.stackSize : needPipes; - final ItemStack itemStack = pipes; - itemStack.stackSize += transferPipes; - final ItemStack itemStack2 = storedItem; - itemStack2.stackSize -= transferPipes; - } - this.updateSlots(); - } - - private boolean isHasMiningPipes(final int minCount) { - final ItemStack pipe = this.getStackInSlot(1); - return pipe != null && pipe.stackSize > minCount - 1 - && pipe.isItemEqual(GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe); - } - - public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - this.updateCoordinates(); - int xDir = aBaseMetaTileEntity.getBackFacing().offsetX; - int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ; - int tAmount = 0; - if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) { - return false; - } else { - - Block aCasing = Block.getBlockFromItem(getCasingBlockItem().getItem()); - - for (int i = -1; i < 2; ++i) { - for (int j = -1; j < 2; ++j) { - for (int h = -1; h < 2; ++h) { - if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity - .getIGregTechTileEntityOffset(xDir + i, h, zDir + j); - Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j); - int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); - - if (!this.addToMachineList(tTileEntity, 48)) { - if (aBlock != aCasing) { - Logger.INFO("Found Bad Casing"); - return false; - } - if (aMeta != 3) { - Logger.INFO("Found Bad Meta"); - return false; - } - } - ++tAmount; - - } - } - } - } - return tAmount >= 10; - } - } - - private void updateCoordinates() { - this.xDrill = this.getBaseMetaTileEntity().getXCoord(); - this.yDrill = this.getBaseMetaTileEntity().getYCoord() - 1; - this.zDrill = this.getBaseMetaTileEntity().getZCoord(); - this.back = this.getBaseMetaTileEntity().getBackFacing(); - - // Middle - this.xCenter[0] = this.xDrill + this.back.offsetX; - this.zCenter[0] = this.zDrill + this.back.offsetZ; - - this.xCenter[1] = xCenter[0] + 1; - this.zCenter[1] = zCenter[0]; - - this.xCenter[2] = xCenter[0] - 1; - this.zCenter[2] = zCenter[0]; - - this.xCenter[3] = xCenter[0]; - this.zCenter[3] = zCenter[0] + 1; - - this.xCenter[4] = xCenter[0]; - this.zCenter[4] = zCenter[0] - 1; - } - - @Override - public boolean isCorrectMachinePart(final ItemStack aStack) { - return true; - } - - @Override - public int getMaxEfficiency(final ItemStack aStack) { - return 10000; - } - - @Override - public int getPollutionPerTick(final ItemStack aStack) { - return 0; - } - - @Override - public int getDamageToComponent(final ItemStack aStack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(final ItemStack aStack) { - return false; - } - - protected GregtechItemList getCasingBlockItem() { - return GregtechItemList.Casing_BedrockMiner; - } - - protected abstract Material getFrameMaterial(); - - protected abstract int getCasingTextureIndex(); - - protected abstract int getRadiusInChunks(); - - protected abstract int getMinTier(); - - protected abstract int getBaseProgressTime(); - - protected String[] getDescriptionInternal(final String tierSuffix) { - final String casings = this.getCasingBlockItem().get(0L, new Object[0]).getDisplayName(); - return new String[] { - "Controller Block for the Experimental Deep Earth Drilling Platform - MK " - + ((tierSuffix != null) ? tierSuffix : ""), - "Size(WxHxD): 3x7x3, Controller (Front middle bottom)", "3x1x3 Base of " + casings, - "1x3x1 " + casings + " pillar (Center of base)", - "1x3x1 " + this.getFrameMaterial().getLocalizedName() + " Frame Boxes (Each pillar side and on top)", - "2x Input Hatch (Any bottom layer casing)", - "1x Input Bus for mining pipes (Any bottom layer casing; not necessary)", - "1x Output Bus (Any bottom layer casing)", "1x Maintenance Hatch (Any bottom layer casing)", - "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", - "Radius is " + (this.getRadiusInChunks() << 4) + " blocks", - "Every tick, this machine altenates betweem consumption of Pyrotheum & Cryotheum", - "Pyrotheum is used to bore through the Mantle of the world", - "Cryotheum is used to keep the internal components cool", }; - } - - static { - miningPipe = GT_ModHandler.getIC2Item("miningPipe", 0L); - miningPipeTip = GT_ModHandler.getIC2Item("miningPipeTip", 0L); - } - - private AutoMap<ItemStack> mOutputs; - - public void process() { - ItemStack aOutput = generateOutputWithchance(); - if (aOutput != null) { - this.addOutput(aOutput); - Logger.INFO("Mined some " + aOutput.getDisplayName()); - } - this.updateSlots(); - } - - public ItemStack generateOutputWithchance() { - int aChance = MathUtils.randInt(0, 7500); - if (aChance < 100) { - return generateOutput(); - } else { - return null; - } - } - - public ItemStack generateOutput() { - AutoMap<ItemStack> aData = generateOreForOutput(); - int aMax = aData.size() - 1; - return aData.get(MathUtils.randInt(0, aMax)); - } - - /** - * Here we generate valid ores and also a basic loot set - */ - public AutoMap<ItemStack> generateOreForOutput() { - - if (mOutputs != null) { - return mOutputs; - } - - AutoMap<GT_Worldgen_GT_Ore_Layer> aOverWorldOres = MiningUtils.getOresForDim(0); - AutoMap<GT_Worldgen_GT_Ore_Layer> aNetherOres = MiningUtils.getOresForDim(-1); - AutoMap<GT_Worldgen_GT_Ore_Layer> aEndOres = MiningUtils.getOresForDim(1); - - AutoMap<ItemStack> aTempMap = new AutoMap<ItemStack>(); - Block tOreBlock = GregTech_API.sBlockOres1; - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Initial]"); - - for (GT_Worldgen_GT_Ore_Layer layer : aOverWorldOres) { - if (layer.mEnabled) { - ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1); - ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1); - ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1); - ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1); - aTempMap.put(aTempOreStack1); - aTempMap.put(aTempOreStack2); - aTempMap.put(aTempOreStack3); - aTempMap.put(aTempOreStack4); - aTempMap.put(aTempOreStack1); - aTempMap.put(aTempOreStack2); - aTempMap.put(aTempOreStack3); - aTempMap.put(aTempOreStack4); - aTempMap.put(aTempOreStack1); - aTempMap.put(aTempOreStack2); - aTempMap.put(aTempOreStack3); - aTempMap.put(aTempOreStack4); - } - } - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Overworld]"); - for (GT_Worldgen_GT_Ore_Layer layer : aNetherOres) { - if (layer.mEnabled) { - ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1); - ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1); - ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1); - ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1); - aTempMap.put(aTempOreStack1); - aTempMap.put(aTempOreStack2); - aTempMap.put(aTempOreStack3); - aTempMap.put(aTempOreStack4); - aTempMap.put(aTempOreStack1); - aTempMap.put(aTempOreStack2); - aTempMap.put(aTempOreStack3); - aTempMap.put(aTempOreStack4); - } - } - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Nether]"); - for (GT_Worldgen_GT_Ore_Layer layer : aEndOres) { - if (layer.mEnabled) { - ItemStack aTempOreStack1 = ItemUtils.simpleMetaStack(tOreBlock, layer.mPrimaryMeta, 1); - ItemStack aTempOreStack2 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSecondaryMeta, 1); - ItemStack aTempOreStack3 = ItemUtils.simpleMetaStack(tOreBlock, layer.mBetweenMeta, 1); - ItemStack aTempOreStack4 = ItemUtils.simpleMetaStack(tOreBlock, layer.mSporadicMeta, 1); - aTempMap.put(aTempOreStack1); - aTempMap.put(aTempOreStack2); - aTempMap.put(aTempOreStack3); - aTempMap.put(aTempOreStack4); - } - } - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [End]"); - - addOreTypeToMap(ELEMENT.getInstance().IRON, 200, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().COPPER, 175, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().TIN, 150, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().GOLD, 150, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().SILVER, 110, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().NICKEL, 40, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().ZINC, 40, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().LEAD, 40, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().ALUMINIUM, 30, aTempMap); - addOreTypeToMap(ELEMENT.getInstance().THORIUM, 20, aTempMap); - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Extra Common Ores]"); - - AutoMap<Pair<String, Integer>> mMixedOreData = new AutoMap<Pair<String, Integer>>(); - mMixedOreData.put(new Pair<String, Integer>("oreRuby", 30)); - mMixedOreData.put(new Pair<String, Integer>("oreSapphire", 25)); - mMixedOreData.put(new Pair<String, Integer>("oreEmerald", 25)); - mMixedOreData.put(new Pair<String, Integer>("oreLapis", 40)); - mMixedOreData.put(new Pair<String, Integer>("oreRedstone", 40)); - - if (Thaumcraft.isModLoaded() || (OreDictUtils.containsValidEntries("oreAmber") - && OreDictUtils.containsValidEntries("oreCinnabar"))) { - mMixedOreData.put(new Pair<String, Integer>("oreAmber", 20)); - mMixedOreData.put(new Pair<String, Integer>("oreCinnabar", 20)); - } - if (Railcraft.isModLoaded() || OreDictUtils.containsValidEntries("oreSaltpeter")) { - mMixedOreData.put(new Pair<String, Integer>("oreSaltpeter", 10)); - } - mMixedOreData.put(new Pair<String, Integer>("oreUranium", 10)); - if (OreDictUtils.containsValidEntries("oreSulfur")) { - mMixedOreData.put(new Pair<String, Integer>("oreSulfur", 15)); - } - if (OreDictUtils.containsValidEntries("oreSilicon")) { - mMixedOreData.put(new Pair<String, Integer>("oreSilicon", 15)); - } - if (OreDictUtils.containsValidEntries("oreApatite")) { - mMixedOreData.put(new Pair<String, Integer>("oreApatite", 25)); - } - - mMixedOreData.put(new Pair<String, Integer>("oreFirestone", 2)); - mMixedOreData.put(new Pair<String, Integer>("oreBismuth", 20)); - mMixedOreData.put(new Pair<String, Integer>("oreLithium", 20)); - mMixedOreData.put(new Pair<String, Integer>("oreManganese", 20)); - mMixedOreData.put(new Pair<String, Integer>("oreBeryllium", 20)); - mMixedOreData.put(new Pair<String, Integer>("oreCoal", 75)); - mMixedOreData.put(new Pair<String, Integer>("oreLignite", 75)); - mMixedOreData.put(new Pair<String, Integer>("oreSalt", 15)); - mMixedOreData.put(new Pair<String, Integer>("oreCalcite", 15)); - mMixedOreData.put(new Pair<String, Integer>("oreBauxite", 20)); - mMixedOreData.put(new Pair<String, Integer>("oreAlmandine", 15)); - mMixedOreData.put(new Pair<String, Integer>("oreGraphite", 25)); - mMixedOreData.put(new Pair<String, Integer>("oreGlauconite", 15)); - mMixedOreData.put(new Pair<String, Integer>("orePyrolusite", 15)); - mMixedOreData.put(new Pair<String, Integer>("oreGrossular", 15)); - mMixedOreData.put(new Pair<String, Integer>("oreTantalite", 15)); - - for (Pair<String, Integer> g : mMixedOreData) { - for (int i = 0; i < g.getValue(); i++) { - aTempMap.put(ItemUtils.getItemStackOfAmountFromOreDict(g.getKey(), 1)); - } - } - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [Extra Mixed Ores]"); - - addOreTypeToMap(ELEMENT.STANDALONE.RUNITE, 2, aTempMap); - addOreTypeToMap(ELEMENT.STANDALONE.GRANITE, 8, aTempMap); - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [OSRS Ores]"); - - AutoMap<Material> aMyOreMaterials = new AutoMap<Material>(); - aMyOreMaterials.add(ORES.CROCROITE); - aMyOreMaterials.add(ORES.GEIKIELITE); - aMyOreMaterials.add(ORES.NICHROMITE); - aMyOreMaterials.add(ORES.TITANITE); - aMyOreMaterials.add(ORES.ZIMBABWEITE); - aMyOreMaterials.add(ORES.ZIRCONILITE); - aMyOreMaterials.add(ORES.GADOLINITE_CE); - aMyOreMaterials.add(ORES.GADOLINITE_Y); - aMyOreMaterials.add(ORES.LEPERSONNITE); - aMyOreMaterials.add(ORES.SAMARSKITE_Y); - aMyOreMaterials.add(ORES.SAMARSKITE_YB); - aMyOreMaterials.add(ORES.XENOTIME); - aMyOreMaterials.add(ORES.YTTRIAITE); - aMyOreMaterials.add(ORES.YTTRIALITE); - aMyOreMaterials.add(ORES.YTTROCERITE); - aMyOreMaterials.add(ORES.ZIRCON); - aMyOreMaterials.add(ORES.POLYCRASE); - aMyOreMaterials.add(ORES.ZIRCOPHYLLITE); - aMyOreMaterials.add(ORES.ZIRKELITE); - aMyOreMaterials.add(ORES.LANTHANITE_LA); - aMyOreMaterials.add(ORES.LANTHANITE_CE); - aMyOreMaterials.add(ORES.LANTHANITE_ND); - aMyOreMaterials.add(ORES.AGARDITE_Y); - aMyOreMaterials.add(ORES.AGARDITE_CD); - aMyOreMaterials.add(ORES.AGARDITE_LA); - aMyOreMaterials.add(ORES.AGARDITE_ND); - aMyOreMaterials.add(ORES.HIBONITE); - aMyOreMaterials.add(ORES.CERITE); - aMyOreMaterials.add(ORES.FLUORCAPHITE); - aMyOreMaterials.add(ORES.FLORENCITE); - aMyOreMaterials.add(ORES.CRYOLITE); - aMyOreMaterials.add(ORES.LAUTARITE); - aMyOreMaterials.add(ORES.LAFOSSAITE); - aMyOreMaterials.add(ORES.DEMICHELEITE_BR); - aMyOreMaterials.add(ORES.COMANCHEITE); - aMyOreMaterials.add(ORES.PERROUDITE); - aMyOreMaterials.add(ORES.HONEAITE); - aMyOreMaterials.add(ORES.ALBURNITE); - aMyOreMaterials.add(ORES.MIESSIITE); - aMyOreMaterials.add(ORES.KASHINITE); - aMyOreMaterials.add(ORES.IRARSITE); - aMyOreMaterials.add(ORES.RADIOBARITE); - aMyOreMaterials.add(ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT); - - for (Material aOreType : aMyOreMaterials) { - if (aOreType == ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT || aOreType == ORES.RADIOBARITE) { - addOreTypeToMap(aOreType, 4, aTempMap); - } else { - addOreTypeToMap(aOreType, 7, aTempMap); - } - } - - // Cleanup Map - Logger.INFO("Ore Map contains " + aTempMap.size() + " values. [GT++]"); - AutoMap<ItemStack> aCleanUp = new AutoMap<ItemStack>(); - for (ItemStack verify : aTempMap) { - if (!ItemUtils.checkForInvalidItems(verify)) { - aCleanUp.put(verify); - } - } - Logger.INFO("Cleanup Map contains " + aCleanUp.size() + " values."); - for (ItemStack remove : aCleanUp) { - aTempMap.remove(remove); - } - - // Generate Massive Map - AutoMap<ItemStack> aFinalMap = new AutoMap<ItemStack>(); - for (ItemStack aTempItem : aTempMap) { - int aTempMulti = MathUtils.randInt(20, 50); - for (int i = 0; i < aTempMulti; i++) { - aFinalMap.put(aTempItem.copy()); - } - } - Logger.INFO("Final Ore Map contains " + aFinalMap.size() + " values."); - mOutputs = aFinalMap; - return mOutputs; - } - - private static void addOreTypeToMap(Material aMaterial, int aAmount, AutoMap<ItemStack> aMap) { - for (int i = 0; i < aAmount; i++) { - aMap.add(aMaterial.getOre(1)); - } - } - - @Override - public String getMachineType() { - return "Miner"; - } - - @Override - public int getMaxParallelRecipes() { - return 1; - } - - @Override - public int getEuDiscountForParallelism() { - return 0; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java deleted file mode 100644 index 8f81c180ad..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java +++ /dev/null @@ -1,270 +0,0 @@ -/* - * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage; public class - * GregtechMetaTileEntity_MultiTank extends GregtechMeta_MultiBlockBase { public GregtechMetaTileEntity_MultiTank(final - * int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); } private short - * multiblockCasingCount = 0; private int mInternalSaveClock = 0; private final short storageMultiplier = 1; private int - * maximumFluidStorage = 128000; private FluidStack internalStorageTank = null; private final NBTTagCompound - * internalCraftingComponentsTag = new NBTTagCompound(); - * @Override public String getMachineType() { return "Fluid Tank"; } - * @Override public String[] getExtraInfoData() { final ArrayList<GT_MetaTileEntity_Hatch_Energy> mTier = - * this.mEnergyHatches; if (!mTier.isEmpty()){ final int temp = mTier.get(0).mTier; if (this.internalStorageTank == - * null) { return new String[]{ GT_Values.VOLTAGE_NAMES[temp]+" Large Fluid Tank", "Stored Fluid: No Fluid", - * "Internal | Current: "+Integer.toString(0) + "L", "Internal | Maximum: "+Integer.toString(this.maximumFluidStorage) + - * "L"}; } return new String[]{ GT_Values.VOLTAGE_NAMES[temp]+" Large Fluid Tank", - * "Stored Fluid: "+this.internalStorageTank.getLocalizedName(), - * "Internal | Current: "+Integer.toString(this.internalStorageTank.amount) + "L", - * "Internal | Maximum: "+Integer.toString(this.maximumFluidStorage) + "L"}; } return new String[]{ - * "Voltage Tier not set -" +" Large Fluid Tank", "Stored Fluid: No Fluid", "Internal | Current: "+Integer.toString(0) + - * "L", "Internal | Maximum: "+Integer.toString(this.maximumFluidStorage) + "L"}; } - * @Override public void saveNBTData(final NBTTagCompound aNBT) { super.saveNBTData(aNBT); - */ -/* - * final NBTTagCompound gtCraftingComponentsTag = aNBT.getCompoundTag("GT.CraftingComponents"); if - * (gtCraftingComponentsTag != null){ Utils.LOG_WARNING("Got Crafting Tag"); if (this.internalStorageTank != null){ - * Utils.LOG_WARNING("mFluid was not null, Saving TileEntity NBT data."); gtCraftingComponentsTag.setString("xFluid", - * this.internalStorageTank.getFluid().getName()); gtCraftingComponentsTag.setInteger("xAmount", - * this.internalStorageTank.amount); gtCraftingComponentsTag.setLong("xAmountMax", this.maximumFluidStorage); - * aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag); } else { - * Utils.LOG_WARNING("mFluid was null, Saving TileEntity NBT data."); gtCraftingComponentsTag.removeTag("xFluid"); - * gtCraftingComponentsTag.removeTag("xAmount"); gtCraftingComponentsTag.removeTag("xAmountMax"); - * gtCraftingComponentsTag.setLong("xAmountMax", this.maximumFluidStorage); aNBT.setTag("GT.CraftingComponents", - * gtCraftingComponentsTag); } } - *//* - * } - * @Override public void loadNBTData(final NBTTagCompound aNBT) { super.loadNBTData(aNBT); - */ -/* - * final NBTTagCompound gtCraftingComponentsTag = aNBT.getCompoundTag("GT.CraftingComponents"); String xFluid = null; - * int xAmount = 0; if (gtCraftingComponentsTag.hasNoTags()){ if (this.internalStorageTank != null){ - * Utils.LOG_WARNING("mFluid was not null, Creating TileEntity NBT data."); - * gtCraftingComponentsTag.setInteger("xAmount", this.internalStorageTank.amount); - * gtCraftingComponentsTag.setString("xFluid", this.internalStorageTank.getFluid().getName()); - * aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag); } } else { //internalCraftingComponentsTag = - * gtCraftingComponentsTag.getCompoundTag("backupTag"); if (gtCraftingComponentsTag.hasKey("xFluid")){ - * Utils.LOG_WARNING("xFluid was not null, Loading TileEntity NBT data."); xFluid = - * gtCraftingComponentsTag.getString("xFluid"); } if (gtCraftingComponentsTag.hasKey("xAmount")){ - * Utils.LOG_WARNING("xAmount was not null, Loading TileEntity NBT data."); xAmount = - * gtCraftingComponentsTag.getInteger("xAmount"); } if ((xFluid != null) && (xAmount != 0)){ - * Utils.LOG_WARNING("Setting Internal Tank, loading "+xAmount+"L of "+xFluid); this.setInternalTank(xFluid, xAmount); } - * } - *//* - * } private boolean setInternalTank(final String fluidName, final int amount){ final FluidStack temp = - * FluidUtils.getFluidStack(fluidName, amount); if (temp != null){ if (this.internalStorageTank == null){ - * this.internalStorageTank = temp; Logger.WARNING(temp.getFluid().getName()+" Amount: "+temp.amount+"L"); } else{ - * Logger.WARNING("Retained Fluid."); - * Logger.WARNING(this.internalStorageTank.getFluid().getName()+" Amxount: "+this.internalStorageTank.amount+"L"); } - * this.markDirty(); return true; } return false; } - * @Override public void onLeftclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { - * this.tryForceNBTUpdate(); super.onLeftclick(aBaseMetaTileEntity, aPlayer); } - * @Override public boolean onWrenchRightClick(final byte aSide, final byte aWrenchingSide, final EntityPlayer - * aPlayer, final float aX, final float aY, final float aZ) { this.tryForceNBTUpdate(); return - * super.onWrenchRightclick(side, aWrenchingSide, aPlayer, aX, aY, aZ); } - * @Override public void onRemoval() { this.tryForceNBTUpdate(); super.onRemoval(); } - * @Override public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - * super.onPostTick(aBaseMetaTileEntity, aTick); if ((this.internalStorageTank != null) && - * this.internalStorageTank.amount >= this.maximumFluidStorage){ if (this.internalStorageTank.amount > - * this.maximumFluidStorage){ this.internalStorageTank.amount = this.maximumFluidStorage; } this.stopMachine(); } if - * (this.mInternalSaveClock != 20){ this.mInternalSaveClock++; } else { this.mInternalSaveClock = 0; - * this.tryForceNBTUpdate(); } } public GregtechMetaTileEntity_MultiTank(final String aName) { super(aName); } - * @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new - * GregtechMetaTileEntity_MultiTank(this.mName); } - * @Override public String[] getTooltip() { return new String[]{ "Controller Block for the Multitank", - * "Size: 3xHx3 (Block behind controller must be air)", "Structure must be at least 4 blocks tall, maximum 20.", - * "Each casing within the structure adds 128000L storage.", "Multitank Exterior Casings (16 at least!)", - * "Controller (front centered)", "1x Input hatch", "1x Output hatch", "1x Energy Hatch", }; } - * @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte - * aFacing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { if (side == facing) { return new - * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(11)), new GT_RenderedTexture(aActive ? - * TexturesGtBlock.Overlay_Machine_Screen_Logo : TexturesGtBlock.Overlay_Machine_Screen_Logo)}; } return new - * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(11))}; } - * @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return null; } - * @Override public boolean isFacingValid(final ForgeDirection facing) { return facing.offsetY == 0; } - * @Override public boolean checkRecipe(final ItemStack aStack) { final ArrayList<ItemStack> tInputList = - * this.getStoredInputs(); for (int i = 0; i < (tInputList.size() - 1); i++) { for (int j = i + 1; j < - * tInputList.size(); j++) { if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { if - * (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { tInputList.remove(j--); } else { - * tInputList.remove(i--); break; } } } } final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new - * ItemStack[tInputList.size()]), 0, 2); final ArrayList<FluidStack> tFluidList = this.getStoredFluids(); for (int i - * = 0; i < (tFluidList.size() - 1); i++) { for (int j = i + 1; j < tFluidList.size(); j++) { if - * (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { if (tFluidList.get(i).amount >= - * tFluidList.get(j).amount) { tFluidList.remove(j--); } else { tFluidList.remove(i--); break; } } } } final - * FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[1]), 0, 1); if (tFluids.length >= 2){ - * Logger.WARNING("Bad"); return false; } final ArrayList<Pair<GT_MetaTileEntity_Hatch_Input, Boolean>> rList = new - * ArrayList<>(); int slotInputCount = 0; for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { - * boolean containsFluid = false; if (isValidMetaTileEntity(tHatch)) { slotInputCount++; for (int i=0; - * i<tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { if (tHatch.canTankBeEmptied()){containsFluid=true;} } - * rList.add(new Pair<>(tHatch, containsFluid)); } } if ((tFluids.length <= 0) || (slotInputCount > 1)){ - * Logger.WARNING("Bad"); return false; } Logger.WARNING("Okay - 2"); if (this.internalStorageTank == null){ - * Logger.WARNING("Okay - 3"); if ((rList.get(0).getKey().mFluid != null) && (rList.get(0).getKey().mFluid.amount > - * 0)){ Logger.WARNING("Okay - 4"); - * Logger.WARNING("Okay - 1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount - */ -/* +" internalStorageTank:"+internalStorageTank.amount *//* - * ); final FluidStack tempFluidStack = - * rList.get(0).getKey().mFluid; final Fluid tempFluid = - * tempFluidStack.getFluid(); this.internalStorageTank = - * FluidUtils.getFluidStack(tempFluid.getName(), - * tempFluidStack.amount); rList.get(0).getKey().mFluid.amount - * = 0; Logger.WARNING("Okay - 1.1" - * +" rList.get(0).getKey().mFluid.amount: "+rList.get(0). - * getKey().mFluid.amount - * +" internalStorageTank:"+this.internalStorageTank.amount); - * return true; } Logger.WARNING("No Fluid in hatch."); return - * false; } else if - * (this.internalStorageTank.isFluidEqual(rList.get(0).getKey() - * .mFluid)){ - * Logger.WARNING("Storing "+rList.get(0).getKey().mFluid. - * amount+"L"); - * Logger.WARNING("Contains "+this.internalStorageTank.amount+ - * "L"); int tempAdd = 0; tempAdd = - * rList.get(0).getKey().getFluidAmount(); - * rList.get(0).getKey().mFluid = null; - * Logger.WARNING("adding "+tempAdd); - * this.internalStorageTank.amount = - * this.internalStorageTank.amount + tempAdd; - * Logger.WARNING("Tank now Contains "+this.internalStorageTank - * .amount+"L of "+this.internalStorageTank.getFluid().getName( - * )+"."); //Utils.LOG_WARNING("Tank"); return true; } else { - * final FluidStack superTempFluidStack = - * rList.get(0).getKey().mFluid; - * Logger.WARNING("is input fluid equal to stored fluid? "+( - * this.internalStorageTank.isFluidEqual(superTempFluidStack))) - * ; if (superTempFluidStack != null) { - * Logger.WARNING("Input hatch[0] Contains " - * +superTempFluidStack.amount+"L of "+superTempFluidStack. - * getFluid().getName()+"."); } - * Logger.WARNING("Large Multi-Tank Contains "+this. - * internalStorageTank.amount+"L of "+this.internalStorageTank. - * getFluid().getName()+"."); if - * (this.internalStorageTank.amount <= 0){ - * Logger.WARNING("Internal Tank is empty, sitting idle."); - * return false; } if ((this.mOutputHatches.get(0).mFluid == - * null) || this.mOutputHatches.isEmpty() || - * (this.mOutputHatches.get(0).mFluid.isFluidEqual(this. - * internalStorageTank) && - * (this.mOutputHatches.get(0).mFluid.amount < - * this.mOutputHatches.get(0).getCapacity()))){ - * Logger.WARNING("Okay - 3"); final int tempCurrentStored = - * this.internalStorageTank.amount; int tempResult = 0; final - * int tempHatchSize = - * this.mOutputHatches.get(0).getCapacity(); final int - * tempHatchCurrentHolding = - * this.mOutputHatches.get(0).getFluidAmount(); final int - * tempHatchRemainingSpace = tempHatchSize - - * tempHatchCurrentHolding; final FluidStack tempOutputFluid = - * this.internalStorageTank; if (tempHatchRemainingSpace <= 0){ - * return false; } - * Logger.WARNING("Okay - 3.1.x"+" hatchCapacity: " - * +tempHatchSize +" tempCurrentStored: " - * +tempCurrentStored+" output hatch holds: " - * +tempHatchCurrentHolding+" tank has " - * +tempHatchRemainingSpace+"L of space left."); if - * (tempHatchSize >= tempHatchRemainingSpace){ - * Logger.WARNING("Okay - 3.1.1"+" hatchCapacity: " - * +tempHatchSize +" tempCurrentStored: " - * +tempCurrentStored+" output hatch holds: " - * +tempHatchCurrentHolding+" tank has " - * +tempHatchRemainingSpace+"L of space left."); int adder; if - * ((tempCurrentStored > 0) && (tempCurrentStored <= - * tempHatchSize)){ adder = tempCurrentStored; if (adder >= - * tempHatchRemainingSpace){ adder = tempHatchRemainingSpace; } - * } else { adder = 0; if (tempCurrentStored >= - * tempHatchRemainingSpace){ adder = tempHatchRemainingSpace; } - * } tempResult = adder; tempOutputFluid.amount = tempResult; - * Logger.WARNING("Okay - 3.1.2"+" result: "+tempResult - * +" tempCurrentStored: "+tempCurrentStored + - * " filling output hatch with: "+tempOutputFluid. - * amount+"L of "+tempOutputFluid.getFluid().getName()); - * this.mOutputHatches.get(0).fill(tempOutputFluid, true); - * //mOutputHatches.get(0).mFluid.amount = tempResult; - * this.internalStorageTank.amount = (tempCurrentStored-adder); - * Logger.WARNING("Okay - 3.1.3"+" internalTankStorage: "+this. - * internalStorageTank.amount - * +"L | output hatch contains: "+this.mOutputHatches.get(0). - * mFluid.amount+"L of "+this.mOutputHatches.get(0).mFluid. - * getFluid().getName()); - */ -/* - * if (internalStorageTank.amount <= 0) internalStorageTank = null; - *//* - * } Logger.WARNING("Tank ok."); return true; } } //this.getBaseMetaTileEntity().(tFluids[0].amount, true); - * Logger.WARNING("Tank"); return false; } - * @Override public int getMaxParallelRecipes() { return 1; } - * @Override public int getEuDiscountForParallelism() { return 0; } - * @Override public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - * final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; final int zDir = - * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; if - * (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) { Logger.WARNING("Must be hollow."); return false; } int - * tAmount = 0; for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { for (int h = -1; h < 19; h++) { if ((h - * != 0) || ((((xDir + i) != 0) || ((zDir + j) != 0)) && ((i != 0) || (j != 0)))) { final IGregTechTileEntity - * tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); if - * ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addInputToMachineList(tTileEntity, - * TAE.GTPP_INDEX(11))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && - * (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11)))) { if - * (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { if (h < 3){ - * Logger.WARNING("Casing Expected."); return false; } else if (h >= 3){ - * //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); } } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + - * i, h, zDir + j) != 11) { if (h < 3){ Logger.WARNING("Wrong Meta."); return false; } else if (h >= 3){ - * //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); } } if (h < 3){ tAmount++; } else if (h >= 3){ if - * ((aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == Blocks.air) || - * aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){ - * Logger.WARNING("Found air"); } else { - * Logger.WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank."); tAmount++; } } } } } } - * } this.multiblockCasingCount = (short) tAmount; this.maximumFluidStorage = getMaximumTankStorage(tAmount); - * Logger.INFO("Your Multitank can be 20 blocks tall."); - * Logger.INFO("Casings Count: "+this.multiblockCasingCount+" Valid Multiblock: "+(tAmount >= - * 16)+" Tank Storage Capacity:"+this.maximumFluidStorage+"L"); this.tryForceNBTUpdate(); return tAmount >= 16; } - */ -/* - * public int countCasings() { Utils.LOG_INFO("Counting Machine Casings"); try{ if - * (this.getBaseMetaTileEntity().getWorld() == null){ Utils.LOG_INFO("Tile Entity's world was null for casing count."); - * return 0; } if (this.getBaseMetaTileEntity() == null){ Utils.LOG_INFO("Tile Entity was null for casing count."); - * return 0; } } catch(NullPointerException r){ Utils.LOG_INFO("Null Pointer Exception caught."); return 0; } int xDir = - * ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; int zDir = - * ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; if - * (!this.getBaseMetaTileEntity().getAirOffset(xDir, 0, zDir)) { Utils.LOG_INFO("Failed due to air being misplaced."); - * Utils.LOG_WARNING("Must be hollow."); return 0; } int tAmount = 0; Utils.LOG_INFO("Casing Count set to 0."); for (int - * i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { for (int h = -1; h < 19; h++) { if ((h != 0) || (((xDir + i != - * 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) { IGregTechTileEntity tTileEntity = - * this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(xDir + i, h, zDir + j); if - * ((!addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!addInputToMachineList(tTileEntity, - * TAE.GTPP_INDEX(11))) && (!addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && - * (!addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11)))) { if - * (this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { if (h < 3){ - * Utils.LOG_WARNING("Casing Expected."); return 0; } else if (h >= 3){ - * //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); } } if - * (this.getBaseMetaTileEntity().getMetaIDOffset(xDir + i, h, zDir + j) != 11) { if (h < 3){ - * Utils.LOG_WARNING("Wrong Meta."); return 0; } else if (h >= 3){ - * //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); } } if (h < 3){ tAmount++; } else if (h >= 3){ if - * (this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j) == Blocks.air || - * this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){ - * Utils.LOG_WARNING("Found air"); } else { - * Utils.LOG_WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank."); tAmount++; } } } } } } - * } Utils.LOG_INFO("Finished counting."); multiblockCasingCount = (short) tAmount; - * //Utils.LOG_INFO("Your Multitank can be 20 blocks tall."); - * Utils.LOG_INFO("Casings Count: "+tAmount+" Valid Multiblock: "+(tAmount >= - * 16)+" Tank Storage Capacity:"+getMaximumTankStorage(tAmount)+"L"); return tAmount; } - *//* - * @Override public int getMaxEfficiency(final ItemStack aStack) { return 10000; } - * @Override public int getPollutionPerTick(final ItemStack aStack) { return 5; } - * @Override public int getAmountOfOutputs() { return 1; } - * @Override public boolean explodesOnComponentBreak(final ItemStack aStack) { return false; } private static short - * getStorageMultiplier(final int casingCount){ final int tsm = 1*casingCount; if (tsm <= 0){ return 1; } return - * (short) tsm; } private static int getMaximumTankStorage(final int casingCount){ final int multiplier = - * getStorageMultiplier(casingCount); final int tempTankStorageMax = 128000*multiplier; if (tempTankStorageMax <= - * 0){return 128000;} return tempTankStorageMax; } private boolean tryForceNBTUpdate(){ - */ -/* - * //Block is invalid. if ((this == null) || (this.getBaseMetaTileEntity() == null)){ - * Utils.LOG_WARNING("Block was not valid for saving data."); return false; } //Don't need this to run clientside. if - * (!this.getBaseMetaTileEntity().isServerSide()) { return false; } //Internal Tag was not valid. try{ if - * (this.internalCraftingComponentsTag == null){ Utils.LOG_WARNING("Internal NBT data tag was null."); return false; } } - * catch (final NullPointerException x){ Utils.LOG_WARNING("Caught null NBT."); } //Internal tag was valid. - * this.saveNBTData(this.internalCraftingComponentsTag); //Mark block for update int x,y,z = 0; x = - * this.getBaseMetaTileEntity().getXCoord(); y = this.getBaseMetaTileEntity().getYCoord(); z = - * this.getBaseMetaTileEntity().getZCoord(); this.getBaseMetaTileEntity().getWorld().markBlockForUpdate(x, y, z); //Mark - * block dirty, let chunk know it's data has changed and it must be saved to disk. (Albeit slowly) - * this.getBaseMetaTileEntity().markDirty(); - *//* - * return true; } } - */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java deleted file mode 100644 index 4f2ebd9a80..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java +++ /dev/null @@ -1,186 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tools; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.AchievementList; -import net.minecraft.util.DamageSource; -import net.minecraft.util.EntityDamageSource; -import net.minecraft.util.IChatComponent; -import net.minecraftforge.event.world.BlockEvent; - -import gregtech.api.GregTech_API; -import gregtech.api.damagesources.GT_DamageSources; -import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats; -import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool; - -public abstract class TOOL_Gregtech_Base implements Interface_ToolStats { - - public static final Enchantment[] FORTUNE_ENCHANTMENT = { Enchantment.fortune }; - public static final Enchantment[] LOOTING_ENCHANTMENT = { Enchantment.looting }; - public static final Enchantment[] ZERO_ENCHANTMENTS = new Enchantment[0]; - public static final int[] ZERO_ENCHANTMENT_LEVELS = new int[0]; - - @Override - public int getToolDamagePerBlockBreak() { - return 100; - } - - @Override - public int getToolDamagePerDropConversion() { - return 100; - } - - @Override - public int getToolDamagePerContainerCraft() { - return 800; - } - - @Override - public int getToolDamagePerEntityAttack() { - return 200; - } - - @Override - public float getSpeedMultiplier() { - return 1.0F; - } - - @Override - public float getMaxDurabilityMultiplier() { - return 1.0F; - } - - @Override - public int getHurtResistanceTime(final int aOriginalHurtResistance, final Entity aEntity) { - return aOriginalHurtResistance; - } - - @Override - public String getMiningSound() { - return null; - } - - @Override - public String getCraftingSound() { - return null; - } - - @Override - public String getEntityHitSound() { - return null; - } - - @Override - public String getBreakingSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(0)); - } - - @Override - public int getBaseQuality() { - return 0; - } - - @Override - public boolean canBlock() { - return false; - } - - @Override - public boolean isCrowbar() { - return false; - } - - @Override - public boolean isWrench() { - return false; - } - - @Override - public boolean isWeapon() { - return false; - } - - @Override - public boolean isRangedWeapon() { - return false; - } - - @Override - public boolean isMiningTool() { - return true; - } - - @Override - public boolean isChainsaw() { - return false; - } - - @Override - public boolean isGrafter() { - return false; - } - - @Override - public DamageSource getDamageSource(final EntityLivingBase aPlayer, final Entity aEntity) { - return GT_DamageSources.getCombatDamage( - (aPlayer instanceof EntityPlayer) ? "player" : "mob", - aPlayer, - (aEntity instanceof EntityLivingBase) ? this.getDeathMessage(aPlayer, (EntityLivingBase) aEntity) - : null); - } - - public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) { - return new EntityDamageSource((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer) - .func_151519_b(aEntity); - } - - @Override - public int convertBlockDrops(final List<ItemStack> aDrops, final ItemStack aStack, final EntityPlayer aPlayer, - final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune, - final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) { - return 0; - } - - @Override - public ItemStack getBrokenItem(final ItemStack aStack) { - return null; - } - - @Override - public Enchantment[] getEnchantments(final ItemStack aStack) { - return ZERO_ENCHANTMENTS; - } - - @Override - public int[] getEnchantmentLevels(final ItemStack aStack) { - return ZERO_ENCHANTMENT_LEVELS; - } - - @Override - public void onToolCrafted(final ItemStack aStack, final EntityPlayer aPlayer) { - aPlayer.triggerAchievement(AchievementList.openInventory); - aPlayer.triggerAchievement(AchievementList.mineWood); - aPlayer.triggerAchievement(AchievementList.buildWorkBench); - } - - @Override - public void onStatsAddedToTool(final Gregtech_MetaTool aItem, final int aID) {} - - @Override - public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, - final EntityPlayer aPlayer) { - return aOriginalDamage; - } - - @Override - public float getMagicDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, - final EntityPlayer aPlayer) { - return aOriginalDamage; - } -} |