From 311ab89f93558233a40079f7cb16605b141b5346 Mon Sep 17 00:00:00 2001 From: Johann Bernhardt Date: Sun, 12 Dec 2021 19:38:06 +0100 Subject: Move sources and resources --- .../common/blocks/GTPP_Block_Machines.java | 534 +++++++++++++++++ .../gregtech/common/blocks/GTPP_Item_Machines.java | 229 ++++++++ .../common/blocks/GregtechMetaCasingBlocks.java | 78 +++ .../common/blocks/GregtechMetaCasingBlocks2.java | 89 +++ .../common/blocks/GregtechMetaCasingBlocks3.java | 366 ++++++++++++ .../common/blocks/GregtechMetaCasingBlocks4.java | 115 ++++ .../common/blocks/GregtechMetaCasingBlocks5.java | 83 +++ .../blocks/GregtechMetaCasingBlocksAbstract.java | 150 +++++ .../common/blocks/GregtechMetaCasingItems.java | 10 + .../common/blocks/GregtechMetaItemCasings1.java | 36 ++ .../blocks/GregtechMetaItemCasingsAbstract.java | 61 ++ .../blocks/GregtechMetaSpecialMachineCasings.java | 81 +++ .../blocks/GregtechMetaSpecialMultiCasings.java | 103 ++++ .../blocks/GregtechMetaTieredCasingBlocks1.java | 110 ++++ .../common/blocks/fluid/GregtechFluidHandler.java | 111 ++++ .../blocks/textures/CasingTextureHandler.java | 82 +++ .../blocks/textures/CasingTextureHandler2.java | 57 ++ .../blocks/textures/CasingTextureHandler3.java | 68 +++ .../textures/TexturesCentrifugeMultiblock.java | 166 ++++++ .../common/blocks/textures/TexturesGregtech58.java | 443 ++++++++++++++ .../common/blocks/textures/TexturesGregtech59.java | 444 ++++++++++++++ .../blocks/textures/TexturesGrinderMultiblock.java | 150 +++++ .../common/blocks/textures/TexturesGtBlock.java | 652 +++++++++++++++++++++ .../blocks/textures/TexturesGtCutomCovers.java | 32 + .../common/blocks/textures/TexturesGtTools.java | 61 ++ .../turbine/LargeTurbineTextureHandler.java | 318 ++++++++++ 26 files changed, 4629 insertions(+) create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common/blocks') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java new file mode 100644 index 0000000000..01f655c355 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java @@ -0,0 +1,534 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import java.util.ArrayList; +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.IDebugableBlock; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.metatileentity.BaseTileEntity; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Item_Machines; +import gregtech.common.blocks.GT_Material_Machines; +import gregtech.common.render.GT_Renderer_Block; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.random.XSTR; +import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; +import gtPlusPlus.xmod.gregtech.common.render.GTPP_Render_MachineBlock; +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.StatCollector; +import net.minecraft.world.Explosion; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableBlock, ITileEntityProvider { + public static ThreadLocal mTemporaryTileEntity = new ThreadLocal(); + + public GTPP_Block_Machines() { + super(GTPP_Item_Machines.class, "gtpp.blockmachines", new GT_Material_Machines()); + GregTech_API.registerMachineBlock(this, -1); + this.setHardness(1.0F); + this.setResistance(10.0F); + this.setStepSound(soundTypeMetal); + this.setCreativeTab(GregTech_API.TAB_GREGTECH); + this.isBlockContainer = true; + } + + public String getHarvestTool(int aMeta) { + switch (aMeta / 4) { + case 0 : + return "wrench"; + case 1 : + return "wrench"; + case 2 : + return "cutter"; + case 3 : + return "axe"; + default : + return "wrench"; + } + } + + public int getHarvestLevel(int aMeta) { + return aMeta % 4; + } + + protected boolean canSilkHarvest() { + return false; + } + + public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int aTileX, int aTileY, int aTileZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof BaseTileEntity) { + ((BaseTileEntity) tTileEntity).onAdjacentBlockChange(aTileX, aTileY, aTileZ); + } + + } + + public void onBlockAdded(World aWorld, int aX, int aY, int aZ) { + super.onBlockAdded(aWorld, aX, aY, aZ); + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + + } + + public String getUnlocalizedName() { + int tDamage = 0; + String aUnlocalName = (tDamage >= 0 && tDamage < GregTech_API.METATILEENTITIES.length) + ? (GregTech_API.METATILEENTITIES[tDamage] != null + ? ("gtpp.blockmachines.name" + "." + GregTech_API.METATILEENTITIES[tDamage].getMetaName()) + : ("gtpp.blockmachines.name")) : ""; + + Logger.INFO("Unlocal Name: "+aUnlocalName); + return aUnlocalName; + } + + public String getLocalizedName() { + String aName = StatCollector.translateToLocal(this.getUnlocalizedName() + ".name");; + if (aName.toLowerCase().contains(".name")) { + aName = StatCollector.translateToLocal(getUnlocalizedName() + ".name"); + } + if (aName.toLowerCase().contains(".name")) { + aName = StatCollector.translateToLocal("gt.blockmachines" + ".name"); + } + if (aName.toLowerCase().contains(".name")) { + aName = "BAD"; + } + Logger.INFO("Name: "+aName); + return aName; + } + + public int getFlammability(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) { + return 0; + } + + public int getFireSpreadSpeed(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) { + return GregTech_API.sMachineFlammable && aWorld.getBlockMetadata(aX, aY, aZ) == 0 ? 100 : 0; + } + + public int getRenderType() { + return GTPP_Render_MachineBlock.INSTANCE == null ? super.getRenderType() : GTPP_Render_MachineBlock.INSTANCE.mRenderID; + } + + public boolean isFireSource(World aWorld, int aX, int aY, int aZ, ForgeDirection side) { + return GregTech_API.sMachineFlammable && aWorld.getBlockMetadata(aX, aY, aZ) == 0; + } + + public boolean isFlammable(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection face) { + return GregTech_API.sMachineFlammable && aWorld.getBlockMetadata(aX, aY, aZ) == 0; + } + + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess aWorld, int aX, int aY, int aZ) { + return false; + } + + public boolean canConnectRedstone(IBlockAccess var1, int var2, int var3, int var4, int var5) { + return true; + } + + public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) { + return false; + } + + public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { + return false; + } + + public boolean hasTileEntity(int aMeta) { + return true; + } + + public boolean hasComparatorInputOverride() { + return true; + } + + public boolean renderAsNormalBlock() { + return false; + } + + public boolean canProvidePower() { + return true; + } + + public boolean isOpaqueCube() { + return false; + } + + public TileEntity createNewTileEntity(World aWorld, int aMeta) { + return this.createTileEntity(aWorld, aMeta); + } + + public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) { + return BlockIcons.MACHINE_LV_SIDE.getIcon(); + } + + public IIcon getIcon(int aSide, int aMeta) { + return BlockIcons.MACHINE_LV_SIDE.getIcon(); + } + + public boolean onBlockEventReceived(World aWorld, int aX, int aY, int aZ, int aData1, int aData2) { + super.onBlockEventReceived(aWorld, aX, aY, aZ, aData1, aData2); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + return tTileEntity != null ? tTileEntity.receiveClientEvent(aData1, aData2) : false; + } + + public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, + Entity collider) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof IGregTechTileEntity + && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { + ((IGregTechTileEntity) tTileEntity).addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, + collider); + } else { + super.addCollisionBoxesToList(aWorld, aX, aY, aZ, inputAABB, outputAABB, collider); + } + } + + public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + return tTileEntity instanceof IGregTechTileEntity + && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null + ? ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) + : super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); + } + + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + return tTileEntity instanceof IGregTechTileEntity + && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null + ? ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) + : super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ); + } + + public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int aX, int aY, int aZ) { + TileEntity tTileEntity = blockAccess.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof IGregTechTileEntity + && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { + AxisAlignedBB bbb = ((IGregTechTileEntity) tTileEntity) + .getCollisionBoundingBoxFromPool(((IGregTechTileEntity) tTileEntity).getWorld(), 0, 0, 0); + this.minX = bbb.minX; + this.minY = bbb.minY; + this.minZ = bbb.minZ; + this.maxX = bbb.maxX; + this.maxY = bbb.maxY; + this.maxZ = bbb.maxZ; + } else { + super.setBlockBoundsBasedOnState(blockAccess, aX, aY, aZ); + } + } + + public void setBlockBoundsForItemRender() { + super.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void onEntityCollidedWithBlock(World aWorld, int aX, int aY, int aZ, Entity collider) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof IGregTechTileEntity + && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { + ((IGregTechTileEntity) tTileEntity).onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider); + } else { + super.onEntityCollidedWithBlock(aWorld, aX, aY, aZ, collider); + } + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister aIconRegister) { + + } + + public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { + return super.getBlockHardness(aWorld, aX, aY, aZ); + } + + public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + return tTileEntity instanceof BaseMetaTileEntity && ((BaseMetaTileEntity) tTileEntity).privateAccess() + && !((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true) + ? -1.0F + : super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ); + } + + public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float par1, + float par2, float par3) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity == null) { + return false; + } else { + if (aPlayer.isSneaking()) { + ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); + if (tCurrentItem == null) { + return false; + } + + if (!GT_Utility.isStackInList(tCurrentItem, GregTech_API.sScrewdriverList) + && !GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) { + return false; + } + } + + return tTileEntity instanceof IGregTechTileEntity + ? (((IGregTechTileEntity) tTileEntity).getTimer() < 50L + ? false + : (!aWorld.isRemote && !((IGregTechTileEntity) tTileEntity).isUseableByPlayer(aPlayer) + ? true + : ((IGregTechTileEntity) tTileEntity).onRightclick(aPlayer, (byte) aSide, par1, + par2, par3))) + : false; + } + } + + public void onBlockClicked(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof IGregTechTileEntity) { + ((IGregTechTileEntity) tTileEntity).onLeftclick(aPlayer); + } + + } + + public int getDamageValue(World aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + return tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity).getMetaTileID() : 0; + } + + public void onBlockExploded(World aWorld, int aX, int aY, int aZ, Explosion aExplosion) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof BaseMetaTileEntity) { + ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion(); + } + + super.onBlockExploded(aWorld, aX, aY, aZ, aExplosion); + } + + public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par6) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof IGregTechTileEntity) { + IGregTechTileEntity tGregTechTileEntity = (IGregTechTileEntity) tTileEntity; + XSTR tRandom = new XSTR(); + mTemporaryTileEntity.set(tGregTechTileEntity); + + for (int i = 0; i < tGregTechTileEntity.getSizeInventory(); ++i) { + ItemStack tItem = tGregTechTileEntity.getStackInSlot(i); + if (tItem != null && tItem.stackSize > 0 && tGregTechTileEntity.isValidSlot(i)) { + EntityItem tItemEntity = new EntityItem(aWorld, + (double) ((float) aX + tRandom.nextFloat() * 0.8F + 0.1F), + (double) ((float) aY + tRandom.nextFloat() * 0.8F + 0.1F), + (double) ((float) aZ + tRandom.nextFloat() * 0.8F + 0.1F), + new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); + if (tItem.hasTagCompound()) { + tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy()); + } + + tItemEntity.motionX = tRandom.nextGaussian() * 0.0500000007450581D; + tItemEntity.motionY = tRandom.nextGaussian() * 0.0500000007450581D + 0.2000000029802322D; + tItemEntity.motionZ = tRandom.nextGaussian() * 0.0500000007450581D; + aWorld.spawnEntityInWorld(tItemEntity); + tItem.stackSize = 0; + tGregTechTileEntity.setInventorySlotContents(i, (ItemStack) null); + } + } + } + + super.breakBlock(aWorld, aX, aY, aZ, par5, par6); + aWorld.removeTileEntity(aX, aY, aZ); + } + + public ArrayList getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + return tTileEntity instanceof IGregTechTileEntity + ? ((IGregTechTileEntity) tTileEntity).getDrops() + : (mTemporaryTileEntity.get() == null + ? new ArrayList() + : ((IGregTechTileEntity) mTemporaryTileEntity.get()).getDrops()); + } + + public int getComparatorInputOverride(World aWorld, int aX, int aY, int aZ, int aSide) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + return tTileEntity instanceof IGregTechTileEntity + ? ((IGregTechTileEntity) tTileEntity).getComparatorValue((byte) aSide) + : 0; + } + + public int isProvidingWeakPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { + if (aSide >= 0 && aSide <= 5) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + return tTileEntity instanceof IGregTechTileEntity + ? ((IGregTechTileEntity) tTileEntity).getOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide)) + : 0; + } else { + return 0; + } + } + + public int isProvidingStrongPower(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { + if (aSide >= 0 && aSide <= 5) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + return tTileEntity instanceof IGregTechTileEntity + ? ((IGregTechTileEntity) tTileEntity) + .getStrongOutputRedstoneSignal(GT_Utility.getOppositeSide(aSide)) + : 0; + } else { + return 0; + } + } + + public void dropBlockAsItemWithChance(World aWorld, int aX, int aY, int aZ, int par5, float chance, int par7) { + if (!aWorld.isRemote) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity != null && chance < 1.0F) { + if (tTileEntity instanceof BaseMetaTileEntity && GregTech_API.sMachineNonWrenchExplosions) { + ((BaseMetaTileEntity) tTileEntity).doEnergyExplosion(); + } + } else { + super.dropBlockAsItemWithChance(aWorld, aX, aY, aZ, par5, chance, par7); + } + } + + } + + public boolean isSideSolid(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection aSide) { + if (aWorld.getBlockMetadata(aX, aY, aZ) == 0) { + return true; + } else { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity != null) { + if (tTileEntity instanceof BaseMetaTileEntity) { + return true; + } + + if (tTileEntity instanceof BaseMetaPipeEntity + && (((BaseMetaPipeEntity) tTileEntity).mConnections & -64) != 0) { + return true; + } + + if (tTileEntity instanceof ICoverable + && ((ICoverable) tTileEntity).getCoverIDAtSide((byte) aSide.ordinal()) != 0) { + return true; + } + } + + return false; + } + } + + public int getLightOpacity(IBlockAccess aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + return tTileEntity == null + ? 0 + : (tTileEntity instanceof IGregTechTileEntity + ? ((IGregTechTileEntity) tTileEntity).getLightOpacity() + : (aWorld.getBlockMetadata(aX, aY, aZ) == 0 ? 255 : 0)); + } + + public int getLightValue(IBlockAccess aWorld, int aX, int aY, int aZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + return tTileEntity instanceof BaseMetaTileEntity ? ((BaseMetaTileEntity) tTileEntity).getLightValue() : 0; + } + + public TileEntity createTileEntity(World aWorld, int aMeta) { + return (TileEntity) (aMeta >= 4 ? Meta_GT_Proxy.constructBaseMetaTileEntity() : Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower()); + } + + public float getExplosionResistance(Entity par1Entity, World aWorld, int aX, int aY, int aZ, double explosionX, + double explosionY, double explosionZ) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + return tTileEntity instanceof IGregTechTileEntity + ? ((IGregTechTileEntity) tTileEntity).getBlastResistance((byte) 6) + : 10.0F; + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { + for (int i = 0; i < 100; ++i) { + if (GregTech_API.METATILEENTITIES[(30400 + i)] != null) { + par3List.add(new ItemStack(par1, 1, i)); + } + } + + } + + public void onBlockPlacedBy(World aWorld, int aX, int aY, int aZ, EntityLivingBase aPlayer, ItemStack aStack) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity != null) { + if (tTileEntity instanceof IGregTechTileEntity) { + IGregTechTileEntity var6 = (IGregTechTileEntity) tTileEntity; + if (aPlayer == null) { + var6.setFrontFacing((byte) 1); + } else { + int var7 = MathHelper.floor_double((double) (aPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int var8 = Math.round(aPlayer.rotationPitch); + if (var8 >= 65 && var6.isValidFacing((byte) 1)) { + var6.setFrontFacing((byte) 1); + } else if (var8 <= -65 && var6.isValidFacing((byte) 0)) { + var6.setFrontFacing((byte) 0); + } else { + switch (var7) { + case 0 : + var6.setFrontFacing((byte) 2); + break; + case 1 : + var6.setFrontFacing((byte) 5); + break; + case 2 : + var6.setFrontFacing((byte) 3); + break; + case 3 : + var6.setFrontFacing((byte) 4); + } + } + } + } + + } + } + + public ArrayList getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel) { + TileEntity tTileEntity = aPlayer.worldObj.getTileEntity(aX, aY, aZ); + return tTileEntity instanceof BaseMetaTileEntity + ? ((BaseMetaTileEntity) tTileEntity).getDebugInfo(aPlayer, aLogLevel) + : (tTileEntity instanceof BaseMetaPipeEntity + ? ((BaseMetaPipeEntity) tTileEntity).getDebugInfo(aPlayer, aLogLevel) + : null); + } + + public boolean recolourBlock(World aWorld, int aX, int aY, int aZ, ForgeDirection aSide, int aColor) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity instanceof IGregTechTileEntity) { + if (((IGregTechTileEntity) tTileEntity).getColorization() == (byte) (~aColor & 15)) { + return false; + } else { + ((IGregTechTileEntity) tTileEntity).setColorization((byte) (~aColor & 15)); + return true; + } + } else { + return false; + } + } +} \ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java new file mode 100644 index 0000000000..ba3b05ff8e --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java @@ -0,0 +1,229 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_ItsNotMyFaultException; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; + +import java.util.List; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + +public class GTPP_Item_Machines extends ItemBlock { + public GTPP_Item_Machines(Block par1) { + super(par1); + this.setMaxDamage(0); + this.setHasSubtypes(true); + this.setCreativeTab(GregTech_API.TAB_GREGTECH); + } + + @SuppressWarnings("unchecked") + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean par4) { + try { + int e = this.getDamage(aStack) + 30400; //Add Offset + if (e <= 0 || e >= GregTech_API.METATILEENTITIES.length) { + return; + } + + if (GregTech_API.METATILEENTITIES[e] != null) { + + IGregTechTileEntity aNBT = GregTech_API.METATILEENTITIES[e].getBaseMetaTileEntity(); + + final long tVoltage = aNBT.getInputVoltage(); + byte tTier = (byte) ((byte) Math.max(1, GT_Utility.getTier(tVoltage))); + + /*if (aNBT.getDescription() != null) { + int tAmount = 0; + String[] arg7 = aNBT.getDescription(); + int arg8 = arg7.length-1; + + if (arg7 != null && arg7.length > 0) { + for (String t : arg7) { + aList.add(t); + } + + } + else { + aList.add("ERROR"); + } + + for (int y = 0; y < arg8; y++) { + String tDescription = arg7[y]; + + if (tDescription != null) { + aList.add(tDescription+"|"+arg8); + continue; + } + else { + continue; + } + } + }*/ + + if (aNBT.getEUCapacity() > 0L) { + + //Custom handling + if ((e - 30400) <= 100) { + + + if ((e - 30400) <= 10) { + tTier -= 2; + aList.add(EnumChatFormatting.BOLD+"16"+" Fuse Slots"+EnumChatFormatting.GRAY); + aList.add("Per each fuse, you may insert "+EnumChatFormatting.YELLOW+(GT_Values.V[tTier])+EnumChatFormatting.GRAY+" EU/t"); + aList.add("However this "+EnumChatFormatting.ITALIC+EnumChatFormatting.RED+"MUST"+EnumChatFormatting.GRAY+" be in a single Amp"); + aList.add("This machine can accept upto a single amp of "+GT_Values.VN[Math.min(tTier+2, 12)]+" as a result"); + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Breaker_Loss", "Breaker Loss: "+EnumChatFormatting.RED+""+(GT_Values.V[Math.max(tTier-1, 0)]/10)+EnumChatFormatting.GRAY+" EU/t", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); + } + + + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Special_Power_1", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); + //aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_2", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); + //aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_3", EnumChatFormatting.RED+"Special Power Handling, please read manual", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); + } + + + if (aNBT.getInputVoltage() > 0L) { + String inA = "0"; + if (aNBT.getInputAmperage() >= 1L) { + inA = " at " + EnumChatFormatting.YELLOW + aNBT.getInputAmperage() + EnumChatFormatting.GRAY +" Amps"; + } + else { + inA = " at " + EnumChatFormatting.WHITE + aNBT.getInputAmperage() + EnumChatFormatting.GRAY +" Amps"; + } + String a1 = "Voltage IN: "+EnumChatFormatting.GREEN + aNBT.getInputVoltage() + + " (" + GT_Values.VN[GT_Utility.getTier(aNBT.getInputVoltage())] + ")" + + EnumChatFormatting.GRAY + inA; + aList.add(a1); + } + + if (aNBT.getOutputVoltage() > 0L) { + String outA = "0"; + if (aNBT.getOutputAmperage() >= 1L) { + outA = " at " + EnumChatFormatting.YELLOW + aNBT.getOutputAmperage() + EnumChatFormatting.GRAY +" Amps"; + } + else { + outA = " at " + EnumChatFormatting.WHITE + aNBT.getOutputAmperage() + EnumChatFormatting.GRAY +" Amps"; + } + String a1 = "Voltage OUT: "+EnumChatFormatting.GREEN + aNBT.getOutputVoltage() + + " (" + GT_Values.VN[GT_Utility.getTier(aNBT.getOutputVoltage())] + ")" + + EnumChatFormatting.GRAY + outA; + aList.add(a1); + } + + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_Lossess_EU", "Transmission Loss: "+EnumChatFormatting.DARK_BLUE+"0", !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); + + aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE2", "Internal Capacity: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.BLUE + aNBT.getEUCapacity() + + EnumChatFormatting.GRAY + " EU"); + } + } + + NBTTagCompound arg16 = aStack.getTagCompound(); + if (arg16 != null) { + if (arg16.getBoolean("mMuffler")) { + aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_MUFFLER", "has Muffler Upgrade", + !GregTech_API.sPostloadFinished)); + } + + if (arg16.getBoolean("mSteamConverter")) { + aList.add(GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMCONVERTER", + "has Steam Upgrade", !GregTech_API.sPostloadFinished)); + } + + boolean arg17 = false; + byte arg18; + if ((arg18 = arg16.getByte("mSteamTanks")) > 0) { + aList.add(arg18 + " " + GT_LanguageManager.addStringLocalization("GT_TileEntity_STEAMTANKS", + "Steam Tank Upgrades", !GregTech_API.sPostloadFinished)); + } + } + + + aList.add(EnumChatFormatting.UNDERLINE+"Special GT++ Machine"); + + } catch (Throwable arg15) { + arg15.printStackTrace(GT_Log.err); + } + + } + + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, + float hitX, float hitY, float hitZ) { + return false; + } + + public String getUnlocalizedName(ItemStack aStack) { + short tDamage = (short) (this.getDamage(aStack) + 30400); //Add Offset; + return tDamage >= 0 && tDamage < GregTech_API.METATILEENTITIES.length + ? (GregTech_API.METATILEENTITIES[tDamage] != null + ? "gtpp.blockmachines" + "." + GregTech_API.METATILEENTITIES[tDamage].getMetaName() + : "") + : ""; + } + + public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { + super.onCreated(aStack, aWorld, aPlayer); + short tDamage = (short) ((short) this.getDamage(aStack) + 30400); //Add Offset; + if (tDamage < 0 + || tDamage >= GregTech_API.METATILEENTITIES.length && GregTech_API.METATILEENTITIES[tDamage] != null) { + GregTech_API.METATILEENTITIES[tDamage].onCreated(aStack, aWorld, aPlayer); + } + + } + + public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, + float hitX, float hitY, float hitZ, int aMeta) { + short tDamage = (short) ((short) this.getDamage(aStack) + 30400); //Add Offset; + if (tDamage > 0) { + if (GregTech_API.METATILEENTITIES[tDamage] == null) { + return false; + } + + byte tMetaData = 32; + //byte tMetaData = GregTech_API.METATILEENTITIES[tDamage].getTileEntityBaseType(); + Logger.INFO("Using Meta: "+tMetaData+" for ID "+tDamage+" | "+GregTech_API.METATILEENTITIES[tDamage].getInventoryName()); + if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tMetaData, 3)) { + return false; + } + + if (aWorld.getBlock(aX, aY, aZ) != this.field_150939_a) { + throw new GT_ItsNotMyFaultException( + "Failed to place Block even though World.setBlock returned true. It COULD be MCPC/Bukkit causing that. In case you really have that installed, don\'t report this Bug to me, I don\'t know how to fix it."); + } + + if (aWorld.getBlockMetadata(aX, aY, aZ) != tMetaData) { + throw new GT_ItsNotMyFaultException( + "Failed to set the MetaValue of the Block even though World.setBlock returned true. It COULD be MCPC/Bukkit causing that. In case you really have that installed, don\'t report this Bug to me, I don\'t know how to fix it."); + } + + IGregTechTileEntity tTileEntity = (IGregTechTileEntity) aWorld.getTileEntity(aX, aY, aZ); + if (tTileEntity != null) { + tTileEntity.setInitialValuesAsNBT(tTileEntity.isServerSide() ? aStack.getTagCompound() : null, tDamage); + if (aPlayer != null) { + tTileEntity.setOwnerName(aPlayer.getDisplayName()); + } + + tTileEntity.getMetaTileEntity().initDefaultModes(aStack.getTagCompound()); + } + } else if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tDamage, 3)) { + return false; + } + + if (aWorld.getBlock(aX, aY, aZ) == this.field_150939_a) { + this.field_150939_a.onBlockPlacedBy(aWorld, aX, aY, aZ, aPlayer, aStack); + this.field_150939_a.onPostBlockPlaced(aWorld, aX, aY, aZ, tDamage); + } + + return true; + } +} \ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java new file mode 100644 index 0000000000..c4b2e4f738 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java @@ -0,0 +1,78 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +import gregtech.api.enums.TAE; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Material_Casings; + +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler; + +public class GregtechMetaCasingBlocks +extends GregtechMetaCasingBlocksAbstract { + + CasingTextureHandler TextureHandler = new CasingTextureHandler(); + + public GregtechMetaCasingBlocks() { + super(GregtechMetaCasingItems.class, "miscutils.blockcasings", GT_Material_Casings.INSTANCE); + for (byte i = 0; i < 16; i = (byte) (i + 1)) { + if (i == 2 || i == 3 || i == 4) { + continue; + } + TAE.registerTexture(0, i, new GT_CopiedBlockTexture(this, 6, i)); + } + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Centrifuge Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Structural Coke Oven Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Heat Resistant Coke Oven Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Heat Proof Coke Oven Casing"); //60 + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Material Press Machine Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Electrolyzer Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Wire Factory Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Maceration Stack Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Matter Generation Coil"); //65 + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Matter Fabricator Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Iron Plated Bricks"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Multitank Exterior Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Hastelloy-N Reactor Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Zeron-100 Reactor Shielding"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Blast Smelter Heat Containment Coil "); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Blast Smelter Casing Block"); + GregtechItemList.Casing_Centrifuge1.set(new ItemStack(this, 1, 0)); + GregtechItemList.Casing_CokeOven.set(new ItemStack(this, 1, 1)); + GregtechItemList.Casing_CokeOven_Coil1.set(new ItemStack(this, 1, 2)); + GregtechItemList.Casing_CokeOven_Coil2.set(new ItemStack(this, 1, 3)); + GregtechItemList.Casing_MaterialPress.set(new ItemStack(this, 1, 4)); + GregtechItemList.Casing_Electrolyzer.set(new ItemStack(this, 1, 5)); + GregtechItemList.Casing_WireFactory.set(new ItemStack(this, 1, 6)); + GregtechItemList.Casing_MacerationStack.set(new ItemStack(this, 1, 7)); + GregtechItemList.Casing_MatterGen.set(new ItemStack(this, 1, 8)); + GregtechItemList.Casing_MatterFab.set(new ItemStack(this, 1, 9)); + GregtechItemList.Casing_IronPlatedBricks.set(new ItemStack(this, 1, 10)); + GregtechItemList.Casing_MultitankExterior.set(new ItemStack(this, 1, 11)); + GregtechItemList.Casing_Reactor_I.set(new ItemStack(this, 1, 12)); + GregtechItemList.Casing_Reactor_II.set(new ItemStack(this, 1, 13)); + GregtechItemList.Casing_Coil_BlastSmelter.set(new ItemStack(this, 1, 14)); + GregtechItemList.Casing_BlastSmelter.set(new ItemStack(this, 1, 15)); + } + + @Override + public IIcon getIcon(final int aSide, final int aMeta) { //Texture ID's. case 0 == ID[57] + return CasingTextureHandler.getIcon(aSide, aMeta); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) { + final GregtechMetaCasingBlocks i = this; + return CasingTextureHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i); + } + + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java new file mode 100644 index 0000000000..596643e06c --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java @@ -0,0 +1,89 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import gregtech.api.util.GT_Utility; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import gregtech.api.enums.TAE; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Material_Casings; + +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler2; + +import java.util.List; + +public class GregtechMetaCasingBlocks2 +extends GregtechMetaCasingBlocksAbstract { + + CasingTextureHandler2 TextureHandler = new CasingTextureHandler2(); + + public static class GregtechMetaCasingItemBlocks2 extends GregtechMetaCasingItems { + + public GregtechMetaCasingItemBlocks2(Block par1) { + super(par1); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + int meta = aStack.getItemDamage(); + int tier = GregtechMetaTileEntity_PowerSubStationController.getCellTier(field_150939_a, meta); + if (meta == 7 && tier > 0) { + long capacity = GregtechMetaTileEntity_PowerSubStationController.getCapacityFromCellTier(tier); + aList.add("Energy Storage: " + GT_Utility.formatNumbers(capacity)); + } + super.addInformation(aStack, aPlayer, aList, aF3_H); + } + } + + public GregtechMetaCasingBlocks2() { + super(GregtechMetaCasingItemBlocks2.class, "gtplusplus.blockcasings.2", GT_Material_Casings.INSTANCE); + for (byte i = 0; i < 16; i = (byte) (i + 1)) { + if (i == 4 || i == 10 || i == 11 || i == 12 || i == 14) { + continue; + } + TAE.registerTexture(1, i, new GT_CopiedBlockTexture(this, 6, i)); + } + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Thermal Processing Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Hastelloy-N Sealant Block"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Hastelloy-X Structural Block"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Incoloy-DS Fluid Containment Block"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Wash Plant Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Industrial Sieve Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Large Sieve Grate"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (EV)"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Sub-Station External Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Cyclotron Coil"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Cyclotron Outer Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Thermal Containment Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Autocrafter Frame"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Cutting Factory Frame"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Sterile Farm Casing"); //Tree Farmer Textures + GregtechItemList.Casing_ThermalCentrifuge.set(new ItemStack(this, 1, 0)); + GregtechItemList.Casing_Refinery_External.set(new ItemStack(this, 1, 1)); + GregtechItemList.Casing_Refinery_Structural.set(new ItemStack(this, 1, 2)); + GregtechItemList.Casing_Refinery_Internal.set(new ItemStack(this, 1, 3)); + GregtechItemList.Casing_WashPlant.set(new ItemStack(this, 1, 4)); + GregtechItemList.Casing_Sifter.set(new ItemStack(this, 1, 5)); + GregtechItemList.Casing_SifterGrate.set(new ItemStack(this, 1, 6)); + GregtechItemList.Casing_Vanadium_Redox.set(new ItemStack(this, 1, 7)); + GregtechItemList.Casing_Power_SubStation.set(new ItemStack(this, 1, 8)); + GregtechItemList.Casing_Cyclotron_Coil.set(new ItemStack(this, 1, 9)); + GregtechItemList.Casing_Cyclotron_External.set(new ItemStack(this, 1, 10)); + GregtechItemList.Casing_ThermalContainment.set(new ItemStack(this, 1, 11)); + GregtechItemList.Casing_Autocrafter.set(new ItemStack(this, 1, 12)); + GregtechItemList.Casing_CuttingFactoryFrame.set(new ItemStack(this, 1, 13)); + //GregtechItemList.Casing_TeslaTower.set(new ItemStack(this, 1, 14)); + GregtechItemList.Casing_PLACEHOLDER_TreeFarmer.set(new ItemStack(this, 1, 15)); //Tree Farmer Textures + } + + @Override + public IIcon getIcon(final int aSide, final int aMeta) { + return CasingTextureHandler2.getIcon(aSide, aMeta); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java new file mode 100644 index 0000000000..8cd6dd0ca8 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java @@ -0,0 +1,366 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.TAE; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Material_Casings; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler3; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +public class GregtechMetaCasingBlocks3 +extends GregtechMetaCasingBlocksAbstract { + + public static boolean mConnectedMachineTextures = false; + CasingTextureHandler3 TextureHandler = new CasingTextureHandler3(); + + public static class GregtechMetaCasingItemBlocks3 extends GregtechMetaCasingItems { + + public GregtechMetaCasingItemBlocks3(Block par1) { + super(par1); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + int meta = aStack.getItemDamage(); + int tier = GregtechMetaTileEntity_PowerSubStationController.getCellTier(field_150939_a, meta); + if (tier > 0) { + long capacity = GregtechMetaTileEntity_PowerSubStationController.getCapacityFromCellTier(tier); + aList.add("Energy Storage: " + GT_Utility.formatNumbers(capacity)); + } + super.addInformation(aStack, aPlayer, aList, aF3_H); + } + } + + public GregtechMetaCasingBlocks3() { + super(GregtechMetaCasingItemBlocks3.class, "gtplusplus.blockcasings.3", GT_Material_Casings.INSTANCE); + for (byte i = 0; i < 16; i = (byte) (i + 1)) { + TAE.registerTexture(2, i, new GT_CopiedBlockTexture(this, 6, i)); + } + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Aquatic Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Inconel Reinforced Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Multi-Use Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Trinium Plated Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Vanadium Redox Power Cell (IV)"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Vanadium Redox Power Cell (LuV)"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Vanadium Redox Power Cell (ZPM)"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (UV)"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Vanadium Redox Power Cell (MAX)"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Supply Depot Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Advanced Cryogenic Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Volcanus Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Fusion Machine Casing MK III"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Advanced Fusion Coil"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Unnamed"); // Can Use, don't change texture (Used for Fusion MK4) + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Containment Casing"); + GregtechItemList.Casing_FishPond.set(new ItemStack(this, 1, 0)); + GregtechItemList.Casing_Extruder.set(new ItemStack(this, 1, 1)); + GregtechItemList.Casing_Multi_Use.set(new ItemStack(this, 1, 2)); + GregtechItemList.Casing_BedrockMiner.set(new ItemStack(this, 1, 3)); + GregtechItemList.Casing_Vanadium_Redox_IV.set(new ItemStack(this, 1, 4)); + GregtechItemList.Casing_Vanadium_Redox_LuV.set(new ItemStack(this, 1, 5)); + GregtechItemList.Casing_Vanadium_Redox_ZPM.set(new ItemStack(this, 1, 6)); + GregtechItemList.Casing_Vanadium_Redox_UV.set(new ItemStack(this, 1, 7)); + GregtechItemList.Casing_Vanadium_Redox_MAX.set(new ItemStack(this, 1, 8)); + GregtechItemList.Casing_AmazonWarehouse.set(new ItemStack(this, 1, 9)); + GregtechItemList.Casing_AdvancedVacuum.set(new ItemStack(this, 1, 10)); + GregtechItemList.Casing_Adv_BlastFurnace.set(new ItemStack(this, 1, 11)); + GregtechItemList.Casing_Fusion_External.set(new ItemStack(this, 1, 12)); + GregtechItemList.Casing_Fusion_Internal.set(new ItemStack(this, 1, 13)); + GregtechItemList.Casing_Containment.set(new ItemStack(this, 1, 15)); + } + + @Override + public IIcon getIcon(final int aSide, final int aMeta) { + return CasingTextureHandler3.getIcon(aSide, aMeta); + } + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide) { + final Block thisBlock = aWorld.getBlock(xCoord, yCoord, zCoord); + final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); + if ((tMeta != 12)|| !GregtechMetaCasingBlocks3.mConnectedMachineTextures) { + return getIcon(aSide, tMeta); + } + final int tStartIndex = 0; + if (tMeta == 12) { + 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 (aSide) { + case 0 : { + if (tConnectedSides[0]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon(); + } + if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon(); + } + if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon(); + } + if (tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon(); + } + if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon(); + } + if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon(); + } + if (!tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon(); + } + if (tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon(); + } + if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon(); + } + if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon(); + } + if (!tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon(); + } + if (!tConnectedSides[4] && !tConnectedSides[2]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon(); + } + if (!tConnectedSides[5] && !tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon(); + } + } + case 1 : { + if (tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon(); + } + if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon(); + } + if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon(); + } + if (tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon(); + } + if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon(); + } + if (tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon(); + } + if (!tConnectedSides[4] && !tConnectedSides[5] && tConnectedSides[2] && tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon(); + } + if (tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon(); + } + if (tConnectedSides[4] && tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon(); + } + if (!tConnectedSides[4] && tConnectedSides[5] && tConnectedSides[2] && !tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon(); + } + if (!tConnectedSides[4] && !tConnectedSides[5] && !tConnectedSides[2] && !tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon(); + } + if (!tConnectedSides[2] && !tConnectedSides[4]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon(); + } + if (!tConnectedSides[3] && !tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon(); + } + } + case 2 : { + if (tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon(); + } + if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon(); + } + if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon(); + } + if (tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon(); + } + if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon(); + } + if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon(); + } + if (!tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon(); + } + if (tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon(); + } + if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon(); + } + if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon(); + } + if (!tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon(); + } + if (!tConnectedSides[2] && !tConnectedSides[4]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon(); + } + if (!tConnectedSides[0] && !tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon(); + } + } + case 3 : { + if (tConnectedSides[3]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon(); + } + if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon(); + } + if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon(); + } + if (tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon(); + } + if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon(); + } + if (tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon(); + } + if (!tConnectedSides[2] && !tConnectedSides[0] && tConnectedSides[4] && tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon(); + } + if (tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon(); + } + if (tConnectedSides[2] && tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon(); + } + if (!tConnectedSides[2] && tConnectedSides[0] && tConnectedSides[4] && !tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon(); + } + if (!tConnectedSides[2] && !tConnectedSides[0] && !tConnectedSides[4] && !tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon(); + } + if (!tConnectedSides[2] && !tConnectedSides[4]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon(); + } + if (!tConnectedSides[0] && !tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon(); + } + } + case 4 : { + if (tConnectedSides[4]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon(); + } + if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon(); + } + if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon(); + } + if (tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon(); + } + if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon(); + } + if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon(); + } + if (!tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon(); + } + if (tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon(); + } + if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon(); + } + if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon(); + } + if (!tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon(); + } + if (!tConnectedSides[0] && !tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon(); + } + if (!tConnectedSides[3] && !tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon(); + } + } + case 5 : { + if (tConnectedSides[2]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon(); + } + if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 6].getIcon(); + } + if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 5].getIcon(); + } + if (tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 2].getIcon(); + } + if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 3].getIcon(); + } + if (tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 4].getIcon(); + } + if (!tConnectedSides[0] && !tConnectedSides[3] && tConnectedSides[1] && tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 11].getIcon(); + } + if (tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 8].getIcon(); + } + if (tConnectedSides[0] && tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 9].getIcon(); + } + if (!tConnectedSides[0] && tConnectedSides[3] && tConnectedSides[1] && !tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 10].getIcon(); + } + if (!tConnectedSides[0] && !tConnectedSides[3] && !tConnectedSides[1] && !tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon(); + } + if (!tConnectedSides[0] && !tConnectedSides[1]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 0].getIcon(); + } + if (!tConnectedSides[3] && !tConnectedSides[5]) { + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 1].getIcon(); + } + break; + } + } + return TexturesGtBlock.CONNECTED_FUSION_HULLS[tStartIndex + 7].getIcon(); + } + return CasingTextureHandler3.getIcon(aSide, tMeta); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java new file mode 100644 index 0000000000..419b5f3d30 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java @@ -0,0 +1,115 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Material_Casings; + +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; + + +public class GregtechMetaCasingBlocks4 +extends GregtechMetaCasingBlocksAbstract { + + public GregtechMetaCasingBlocks4() { + super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.4", GT_Material_Casings.INSTANCE); + for (byte i = 0; i < 16; i = (byte) (i + 1)) { + if (i == 2 || i == 4 || i == 5 || i == 6 || i == 7 || i == 8 || i == 9 || i == 12 || i == 13 || i == 14 || i == 15) { + continue; + } + TAE.registerTexture(3, i, new GT_CopiedBlockTexture(this, 6, i)); + } + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Naquadah Reactor Base"); //48 + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Reactor Piping"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Naquadah Containment Chamber"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Tempered Arc Furnace Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Vacuum Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Turbodyne Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused + GregtechItemList.Casing_Naq_Reactor_A.set(new ItemStack(this, 1, 0)); + GregtechItemList.Casing_Naq_Reactor_B.set(new ItemStack(this, 1, 1)); + GregtechItemList.Casing_Naq_Reactor_C.set(new ItemStack(this, 1, 2)); + GregtechItemList.Casing_Industrial_Arc_Furnace.set(new ItemStack(this, 1, 3)); + GregtechItemList.Casing_Vacuum_Furnace.set(new ItemStack(this, 1, 10)); + GregtechItemList.Casing_RocketEngine.set(new ItemStack(this, 1, 11)); + } + + //private static final LargeTurbineTextureHandler mTurbineTextures = new LargeTurbineTextureHandler(); + + /*@Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) { + final GregtechMetaCasingBlocks4 i = this; + return mTurbineTextures.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i); + }*/ + + @Override + public IIcon getIcon(final int aSide, final int aMeta) { + return getStaticIcon((byte) aSide, (byte) aMeta); + } + + public static IIcon getStaticIcon(final byte aSide, final byte aMeta) { + //Texture ID's. case 0 == ID[57] + if ((aMeta >= 0) && (aMeta < 16)) { + switch (aMeta) { + case 0: + return TexturesGtBlock.Casing_Trinium_Titanium.getIcon(); + case 1: + return TexturesGtBlock.TEXTURE_TECH_C.getIcon(); + case 2: + return TexturesGtBlock.TEXTURE_ORGANIC_PANEL_A_GLOWING.getIcon(); + case 3: + return TexturesGtBlock.TEXTURE_METAL_PANEL_A.getIcon(); + case 4: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 5: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 6: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 7: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 8: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 9: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 10: + if (aSide <2) { + return TexturesGtBlock.TEXTURE_STONE_RED_B.getIcon(); + } + else { + return TexturesGtBlock.TEXTURE_STONE_RED_A.getIcon(); + } + case 11: + return TexturesGtBlock.TEXTURE_CASING_ROCKETDYNE.getIcon(); + case 12: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 13: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 14: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 15: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + default: + return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); + + } + } + return TexturesGtBlock._PlaceHolder.getIcon(); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java new file mode 100644 index 0000000000..c594ee0e5d --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java @@ -0,0 +1,83 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Material_Casings; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGrinderMultiblock; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + + +public class GregtechMetaCasingBlocks5 +extends GregtechMetaCasingBlocksAbstract { + + //Free Indexes within TAE: 90, 91, 92, 94, 114, 116, 117, 118, 119, 120, 121, 124, 125, 126, 127 + private static final TexturesGrinderMultiblock mGrinderOverlayHandler = new TexturesGrinderMultiblock(); + + public GregtechMetaCasingBlocks5() { + super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.5", GT_Material_Casings.INSTANCE); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "IsaMill Exterior Casing"); // IsaMill Casing + TAE.registerTexture(0, 2, new GT_CopiedBlockTexture(this, 6, 0)); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "IsaMill Piping"); // IsaMill Pipe + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "IsaMill Gearbox"); // IsaMill Gearbox + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Elemental Confinement Shell"); // Duplicator Casing + TAE.registerTexture(0, 3, new GT_CopiedBlockTexture(this, 6, 3)); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Sparge Tower Exterior Casing"); // Sparge Tower Casing + TAE.registerTexture(0, 4, new GT_CopiedBlockTexture(this, 6, 4)); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused + + GregtechItemList.Casing_IsaMill_Casing.set(new ItemStack(this, 1, 0)); + GregtechItemList.Casing_IsaMill_Pipe.set(new ItemStack(this, 1, 1)); + GregtechItemList.Casing_IsaMill_Gearbox.set(new ItemStack(this, 1, 2)); + GregtechItemList.Casing_ElementalDuplicator.set(new ItemStack(this, 1, 3)); + GregtechItemList.Casing_Sparge_Tower_Exterior.set(new ItemStack(this, 1, 4)); + } + + @Override + public IIcon getIcon(final int aSide, final int aMeta) { + return getStaticIcon(aSide, aMeta); + } + + + public static IIcon getStaticIcon(final int aSide, final int aMeta) { + if ((aMeta >= 0) && (aMeta < 16)) { + switch (aMeta) { + case 0: + return TexturesGtBlock.TEXTURE_CASING_GRINDING_MILL.getIcon(); + case 1: + return TexturesGtBlock.TEXTURE_PIPE_GRINDING_MILL.getIcon(); + case 2: + return TexturesGtBlock.TEXTURE_GEARBOX_GRINDING_MILL.getIcon(); + case 3: + return TexturesGtBlock.TEXTURE_TECH_PANEL_D.getIcon(); + case 4: + return TexturesGtBlock.Casing_Machine_Metal_Sheet_H.getIcon(); + } + } + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) { + final GregtechMetaCasingBlocks5 i = this; + return mGrinderOverlayHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java new file mode 100644 index 0000000000..ea59eb50ba --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java @@ -0,0 +1,150 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import java.util.List; +import java.util.Random; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import gregtech.api.GregTech_API; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Block_Casings_Abstract; + +import gtPlusPlus.core.creative.AddToCreativeTab; + +public abstract class GregtechMetaCasingBlocksAbstract +extends GT_Block_Casings_Abstract { + public GregtechMetaCasingBlocksAbstract(final Class aItemClass, final String aName, final Material aMaterial) { + super(aItemClass, aName, aMaterial); + this.setStepSound(soundTypeMetal); + this.setCreativeTab(AddToCreativeTab.tabMachines); + GregTech_API.registerMachineBlock(this, -1); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this"); + } + + @Override + public String getHarvestTool(final int aMeta) { + return "wrench"; + } + + @Override + public int getHarvestLevel(final int aMeta) { + return 2; + } + + @Override + public float getBlockHardness(final World aWorld, final int aX, final int aY, final int aZ) { + return Blocks.iron_block.getBlockHardness(aWorld, aX, aY, aZ); + } + + @Override + public float getExplosionResistance(final Entity aTNT) { + return Blocks.iron_block.getExplosionResistance(aTNT); + } + + @Override + protected boolean canSilkHarvest() { + return false; + } + + @Override + public void onBlockAdded(final World aWorld, final int aX, final int aY, final int aZ) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } + + @Override + public String getUnlocalizedName() { + return this.mUnlocalizedName; + } + + @Override + public String getLocalizedName() { + return StatCollector.translateToLocal(this.mUnlocalizedName + ".name"); + } + + @Override + public boolean canBeReplacedByLeaves(final IBlockAccess aWorld, final int aX, final int aY, final int aZ) { + return false; + } + + @Override + public boolean isNormalCube(final IBlockAccess aWorld, final int aX, final int aY, final int aZ) { + return true; + } + + @Override + public boolean renderAsNormalBlock() { + return true; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getRenderBlockPass() { + return 0; + } + + @Override + public void breakBlock(final World aWorld, final int aX, final int aY, final int aZ, final Block aBlock, final int aMetaData) { + if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { + GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); + } + } + + @Override + public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) { + return false; + } + + @Override + public int damageDropped(final int par1) { + return par1; + } + + @Override + public int getDamageValue(final World par1World, final int par2, final int par3, final int par4) { + return par1World.getBlockMetadata(par2, par3, par4); + } + + @Override + public int quantityDropped(final Random par1Random) { + return 1; + } + + @Override + public Item getItemDropped(final int par1, final Random par2Random, final int par3) { + return Item.getItemFromBlock(this); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister aIconRegister) { + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(final Item aItem, final CreativeTabs par2CreativeTabs, final List aList) { + for (int i = 0; i < 16; i++) { + aList.add(new ItemStack(aItem, 1, i)); + } + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java new file mode 100644 index 0000000000..de51cb164b --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java @@ -0,0 +1,10 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import net.minecraft.block.Block; + +public class GregtechMetaCasingItems +extends GregtechMetaItemCasingsAbstract { + public GregtechMetaCasingItems(final Block par1) { + super(par1); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java new file mode 100644 index 0000000000..7fb344a4ec --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java @@ -0,0 +1,36 @@ +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/GregtechMetaItemCasingsAbstract.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java new file mode 100644 index 0000000000..62e0f0acdf --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java @@ -0,0 +1,61 @@ +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.ItemBlock; +import net.minecraft.item.ItemStack; + +import gregtech.api.util.GT_LanguageManager; + +public abstract class GregtechMetaItemCasingsAbstract +extends ItemBlock { + + protected final String mCasing_Centrifuge = GT_LanguageManager.addStringLocalization("mu.centrifugecasing", "Warning! Standing in the Centrifuge not recommended"); + protected final String mCasing_CokeOven = GT_LanguageManager.addStringLocalization("mu.cokeoven", "Sturdy and Strong"); + protected final String mCasing_CokeCoil1 = GT_LanguageManager.addStringLocalization("mu.coil01tooltip", "Base Heating Capacity = 1350 Kelvin"); + protected final String mCasing_CokeCoil2 = GT_LanguageManager.addStringLocalization("mu.coil02tooltip", "Base Heating Capacity = 2275 Kelvin"); + protected final String mNoMobsToolTip = GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + protected final String mNoTileEntityToolTip = GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + + public GregtechMetaItemCasingsAbstract(final Block par1) { + super(par1); + this.setMaxDamage(0); + this.setHasSubtypes(true); + //setCreativeTab(AddToCreativeTab.tabMachines); + } + + @Override + public int getMetadata(final int aMeta) { + return aMeta; + } + + @Override + public String getUnlocalizedName(final ItemStack aStack) { + return this.field_150939_a.getUnlocalizedName() + "." + this.getDamage(aStack); + } + + @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: + break; + } + aList.add(this.mNoMobsToolTip); + aList.add(this.mNoTileEntityToolTip); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java new file mode 100644 index 0000000000..8f5dff592a --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java @@ -0,0 +1,81 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import java.util.List; + +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Material_Casings; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + + +public class GregtechMetaSpecialMachineCasings extends GregtechMetaCasingBlocksAbstract { + + + public static class SpecialCasingItemBlock extends GregtechMetaCasingItems { + + public SpecialCasingItemBlock(Block par1) { + super(par1); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + int aMeta = aStack.getItemDamage(); + if (aMeta < 10) { + //aList.add("Tier: "+GT_Values.VN[aMeta]); + } + super.addInformation(aStack, aPlayer, aList, aF3_H); + } + } + + public GregtechMetaSpecialMachineCasings() { + super(SpecialCasingItemBlock.class, "gtplusplus.blockspecialcasings.2", GT_Material_Casings.INSTANCE); + for (byte i = 0; i < 16; i = (byte) (i + 1)) { + //TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i)); + // Don't register these Textures, They already exist within vanilla GT. (May not exist in 5.08) + } + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Strong Bronze Machine Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Sturdy Aluminium Machine Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Vigorous Laurenium Machine Casing"); + TAE.registerTexture(84, new GT_CopiedBlockTexture(this, 6, 2)); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Rugged Botmium Machine Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused + + GregtechItemList.Casing_Machine_Custom_1.set(new ItemStack(this, 1, 0)); + GregtechItemList.Casing_Machine_Custom_2.set(new ItemStack(this, 1, 1)); + GregtechItemList.Casing_Machine_Custom_3.set(new ItemStack(this, 1, 2)); + GregtechItemList.Casing_Machine_Custom_4.set(new ItemStack(this, 1, 3)); + } + + public IIcon getIcon(int aSide, int aMeta) { + switch (aMeta) { + case 0: + return Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS.getIcon(); + case 1: + return Textures.BlockIcons.MACHINE_CASING_FROST_PROOF.getIcon(); + case 2: + return TexturesGtBlock.Casing_Material_Laurenium.getIcon(); + case 3: + return Textures.BlockIcons.MACHINE_HEATPROOFCASING.getIcon(); + } + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java new file mode 100644 index 0000000000..5a5c923d10 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java @@ -0,0 +1,103 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import java.util.List; + +import gregtech.api.enums.Textures; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Material_Casings; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + + +public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbstract { + + + public static class SpecialCasingItemBlock extends GregtechMetaCasingItems { + + public SpecialCasingItemBlock(Block par1) { + super(par1); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + int aMeta = aStack.getItemDamage(); + if (aMeta < 10) { + //aList.add("Tier: "+GT_Values.VN[aMeta]); + } + super.addInformation(aStack, aPlayer, aList, aF3_H); + } + } + + public GregtechMetaSpecialMultiCasings() { + super(SpecialCasingItemBlock.class, "gtplusplus.blockspecialcasings.1", GT_Material_Casings.INSTANCE); + for (byte i = 0; i < 16; i = (byte) (i + 1)) { + //TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i)); + // Don't register these Textures, They already exist within vanilla GT. (May not exist in 5.08) + } + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Turbine Shaft"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Reinforced Steam Turbine Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Reinforced HP Steam Turbine Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Reinforced Gas Turbine Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Reinforced Plasma Turbine Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Tesla Containment Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Structural Solar Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Salt Containment Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Thermally Insulated Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Flotation Cell Casings"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Reinforced Engine Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused + + GregtechItemList.Casing_Turbine_Shaft.set(new ItemStack(this, 1, 0)); + GregtechItemList.Casing_Turbine_LP.set(new ItemStack(this, 1, 1)); + GregtechItemList.Casing_Turbine_HP.set(new ItemStack(this, 1, 2)); + GregtechItemList.Casing_Turbine_Gas.set(new ItemStack(this, 1, 3)); + GregtechItemList.Casing_Turbine_Plasma.set(new ItemStack(this, 1, 4)); + GregtechItemList.Casing_TeslaTower.set(new ItemStack(this, 1, 5)); + GregtechItemList.Casing_SolarTower_Structural.set(new ItemStack(this, 1, 6)); + GregtechItemList.Casing_SolarTower_SaltContainment.set(new ItemStack(this, 1, 7)); + GregtechItemList.Casing_SolarTower_HeatContainment.set(new ItemStack(this, 1, 8)); + GregtechItemList.Casing_Flotation_Cell.set(new ItemStack(this, 1, 9)); + GregtechItemList.Casing_Reinforced_Engine_Casing.set(new ItemStack(this, 1, 10)); + } + + public IIcon getIcon(int aSide, int aMeta) { + + switch (aMeta) { + + case 0: + return TexturesGtBlock.Casing_Redox_1.getIcon(); + case 1: + return Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon(); + case 2: + return Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon(); + case 3: + return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); + case 4: + return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + case 5: + return TexturesGtBlock.Casing_Material_RedSteel.getIcon(); + case 6: + return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); + case 7: + return TexturesGtBlock.Casing_Material_Stellite.getIcon(); + case 8: + return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); + case 9: + return TexturesGtBlock.TEXTURE_CASING_FLOTATION.getIcon(); + case 10: + return TexturesGtBlock.Casing_Material_Talonite.getIcon(); + + } + + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java new file mode 100644 index 0000000000..cbd585e50d --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java @@ -0,0 +1,110 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Material_Casings; + +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController; + + +public class GregtechMetaTieredCasingBlocks1 extends GregtechMetaCasingBlocksAbstract { + + + public static class TieredCasingItemBlock extends GregtechMetaCasingItems { + + public TieredCasingItemBlock(Block par1) { + super(par1); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + int aMeta = aStack.getItemDamage(); + if (aMeta < 10) { + aList.add("Tier: "+GT_Values.VN[aMeta]); + } + super.addInformation(aStack, aPlayer, aList, aF3_H); + } + } + + public GregtechMetaTieredCasingBlocks1() { + super(TieredCasingItemBlock.class, "gtplusplus.blocktieredcasings.1", GT_Material_Casings.INSTANCE); + for (byte i = 0; i < 16; i = (byte) (i + 1)) { + //TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i)); + // Don't register these Textures, Hatches should never need to use their Textures. + } + int aIndex = 0; + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Integral Encasement I"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Integral Encasement II"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Integral Encasement III"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Integral Encasement IV"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Integral Encasement V"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Integral Framework I"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Integral Framework II"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Integral Framework III"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Integral Framework IV"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Integral Framework V"); + //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Vacuum Casing"); + //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Turbodyne Casing"); + //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); + //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); + //GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Placeholder Block"); + + GregtechItemList.GTPP_Casing_ULV.set(new ItemStack(this, 1, 0)); + GregtechItemList.GTPP_Casing_LV.set(new ItemStack(this, 1, 1)); + GregtechItemList.GTPP_Casing_MV.set(new ItemStack(this, 1, 2)); + GregtechItemList.GTPP_Casing_HV.set(new ItemStack(this, 1, 3)); + GregtechItemList.GTPP_Casing_EV.set(new ItemStack(this, 1, 4)); + GregtechItemList.GTPP_Casing_IV.set(new ItemStack(this, 1, 5)); + GregtechItemList.GTPP_Casing_LuV.set(new ItemStack(this, 1, 6)); + GregtechItemList.GTPP_Casing_ZPM.set(new ItemStack(this, 1, 7)); + GregtechItemList.GTPP_Casing_UV.set(new ItemStack(this, 1, 8)); + GregtechItemList.GTPP_Casing_MAX.set(new ItemStack(this, 1, 9)); + + //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 10)); + //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 11)); + //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 12)); + //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 13)); + //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 14)); + //GregtechItemList.Casing_LV.set(new ItemStack(this, 1, 15)); + } + + public IIcon getIcon(int aSide, int aMeta) { + if (aMeta < 10) { + return TexturesGtBlock.TIERED_MACHINE_HULLS[aMeta].getIcon(); + } + switch (aMeta) { + case 10: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 11: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 12: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 13: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 14: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 15: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + } + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java new file mode 100644 index 0000000000..3e4b9a3fee --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java @@ -0,0 +1,111 @@ +package gtPlusPlus.xmod.gregtech.common.blocks.fluid; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; + +public class GregtechFluidHandler { + + protected static int cellID = 0; + + public static void run(){ + start(); + } + + private static void start(){ + + /* Meta_GT_Proxy.addFluid("lubricant", "Lubricant", Materials.Lubricant, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 1L), ItemUtils.getEmptyCell(), 1000); + Meta_GT_Proxy.addFluid("creosote", "Creosote Oil", Materials.Creosote, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Creosote, 1L), ItemUtils.getEmptyCell(), 1000); + Meta_GT_Proxy.addFluid("seedoil", "Seed Oil", Materials.SeedOil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SeedOil, 1L), ItemUtils.getEmptyCell(), 1000); + Meta_GT_Proxy.addFluid("fishoil", "Fish Oil", Materials.FishOil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.FishOil, 1L), ItemUtils.getEmptyCell(), 1000); + Meta_GT_Proxy.addFluid("oil", "Oil", Materials.Oil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Oil, 1L), ItemUtils.getEmptyCell(), 1000); + Meta_GT_Proxy.addFluid("fuel", "Diesel", Materials.Fuel, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fuel, 1L), ItemUtils.getEmptyCell(), 1000); + Meta_GT_Proxy.addFluid("for.honey", "Honey", Materials.Honey, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Honey, 1L), ItemUtils.getEmptyCell(), 1000); + Meta_GT_Proxy.addFluid("biomass", "Biomass", Materials.Biomass, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Biomass, 1L), ItemUtils.getEmptyCell(), 1000); + Meta_GT_Proxy.addFluid("bioethanol", "Bio Ethanol", Materials.Ethanol, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Ethanol, 1L), ItemUtils.getEmptyCell(), 1000); + Meta_GT_Proxy.addFluid("sulfuricacid", "Sulfuric Acid", Materials.SulfuricAcid, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SulfuricAcid, 1L), ItemUtils.getEmptyCell(), 1000); + Meta_GT_Proxy.addFluid("milk", "Milk", Materials.Milk, 1, 290, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Milk, 1L), ItemUtils.getEmptyCell(), 1000); + Meta_GT_Proxy.addFluid("mcguffium", "Mc Guffium 239", Materials.McGuffium239, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.McGuffium239, 1L), ItemUtils.getEmptyCell(), 1000); + Meta_GT_Proxy.addFluid("glue", "Glue", Materials.Glue, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Glue, 1L), ItemUtils.getEmptyCell(), 1000); + */ + + if (!LoadedMods.ThermalFoundation){ + + Logger.INFO("Adding in our own GT versions of Thermal Foundation Fluids if they do not already exist."); + if (!FluidRegistry.isFluidRegistered("cryotheum")) { + FluidUtils.addGtFluid("cryotheum", "Gelid Cryotheum", GT_Materials.Cryotheum, 4, -1200, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Cryotheum, 1L), ItemUtils.getEmptyCell(), 1000); + } + if (!FluidRegistry.isFluidRegistered("pyrotheum")) { + FluidUtils.addGtFluid("pyrotheum", "Blazing Pyrotheum", GT_Materials.Pyrotheum, 4, 4000, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Pyrotheum, 1L), ItemUtils.getEmptyCell(), 1000); + } + if (!FluidRegistry.isFluidRegistered("ender")) { + FluidUtils.addGtFluid("ender", "Resonant Ender", GT_Materials.Ender, 4, 4000, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.Ender, 1L), ItemUtils.getEmptyCell(), 1000); + } + + } + + if (LoadedMods.IndustrialCraft2){ + Logger.INFO("Adding in GT Fluids for various nuclear related content."); + + FluidUtils.addGtFluid("hydrofluoricAcid", "Industrial Strength Hydrofluoric Acid", GT_Materials.HydrofluoricAcid, 1, 120, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrofluoricAcid, 1L), ItemUtils.getEmptyCell(), 1000, false); + generateIC2FluidCell("HydrofluoricAcid"); + + FluidUtils.generateFluidNoPrefix("SulfurDioxide", "High Quality Sulfur Dioxide", 263, GT_Materials.SulfurDioxide.mRGBa); + + FluidUtils.addGtFluid("sulfurousAcid", "Sulfurous Acid", GT_Materials.SulfurousAcid, 4, 75, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfurousAcid, 1L), ItemUtils.getEmptyCell(), 1000, false); + generateIC2FluidCell("SulfurousAcid"); + + FluidUtils.addGtFluid("sulfuricApatite", "Sulfuric Apatite Mix", GT_Materials.SulfuricApatite, 4, 500, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricApatite, 1L), ItemUtils.getEmptyCell(), 1000, false); + generateIC2FluidCell("SulfuricApatite"); + + + //Check for IHL Hydrogen Chloride + if (!LoadedMods.IHL || (ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 1) == null)){ + if (FluidUtils.getFluidStack("hydrogenchloride", 1) == null){ + if (LoadedMods.IHL){ + Logger.INFO("IHL Loaded but hydrogen chloride could not be found for some reason. How about we add our own."); + } + else { + Logger.INFO("No Suitable versions of Hydrogen Chloride available, adding our own."); + } + FluidUtils.addGtFluid("hydrogenChloride", "Industrial Strength Hydrogen Chloride", GT_Materials.HydrogenChloride, 4, 75, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.HydrogenChloride, 1L), ItemUtils.getEmptyCell(), 1000, false); + generateIC2FluidCell("HydrogenChloride"); + } + } + + + FluidUtils.addGtFluid("sulfuricLithium", "Sulfuric Lithium Mix", GT_Materials.SulfuricLithium, 4, 280, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.SulfuricLithium, 1L), ItemUtils.getEmptyCell(), 1000, false); + generateIC2FluidCell("SulfuricLithium"); + + FluidUtils.addGtFluid("lithiumHydroxide", "Lithium Hydroxide", GT_Materials.LithiumHydroxide, 4, 500, GT_OreDictUnificator.get(OrePrefixes.cell, GT_Materials.LithiumHydroxide, 1L), ItemUtils.getEmptyCell(), 1000, false); + generateIC2FluidCell("LithiumHydroxide"); + + + } + } + + private static ItemStack generateIC2FluidCell(final String fluidNameWithCaps){ + Logger.INFO("Adding a Cell for "+fluidNameWithCaps); + if (LoadedMods.IndustrialCraft2 && !LoadedMods.IndustrialCraft2Classic){ + return Utils.createInternalNameAndFluidCell(fluidNameWithCaps); + } + return null; + } + + private static ItemStack generateIC2FluidCellNoOreDict(final String fluidNameWithCaps){ + Logger.INFO("Adding a Cell for "+fluidNameWithCaps); + if (LoadedMods.IndustrialCraft2 && !LoadedMods.IndustrialCraft2Classic){ + return Utils.createInternalNameAndFluidCellNoOreDict(fluidNameWithCaps); + } + return null; + } + +} 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 new file mode 100644 index 0000000000..123df8fe0f --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java @@ -0,0 +1,82 @@ +package gtPlusPlus.xmod.gregtech.common.blocks.textures; + +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +import gregtech.api.enums.Textures; + +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 aSide, final int aMeta) { //Texture ID's. case 0 == ID[57] + if ((aMeta >= 0) && (aMeta < 16)) { + switch (aMeta) { + //Centrifuge + case 0: + return TexturesGtBlock.Casing_Material_Centrifuge.getIcon(); + //Coke Oven Frame + case 1: + return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon(); + //Coke Oven Casing Tier 1 + case 2: + return Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon(); + //Coke Oven Casing Tier 2 + case 3: + return Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon(); + //Material Press Casings + case 4: + return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); + //Electrolyzer Casings + case 5: + return TexturesGtBlock.Casing_Material_Potin.getIcon(); + //Broken Blue Fusion Casings + case 6: + return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); + //Maceration Stack Casings + case 7: + return TexturesGtBlock.Casing_Material_Tumbaga.getIcon(); + //Broken Pink Fusion Casings + case 8: + return TexturesGtBlock.TEXTURE_ORGANIC_PANEL_A_GLOWING.getIcon(); + //Matter Fabricator Casings + case 9: + return TexturesGtBlock.TEXTURE_METAL_PANEL_F.getIcon(); + //Iron Blast Fuance Textures + case 10: + return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); + //Multitank Exterior Casing + case 11: + return TexturesGtBlock.Casing_Material_Grisium.getIcon(); + //Reactor Casing I + case 12: + return TexturesGtBlock.Casing_Material_Stellite.getIcon(); + //Reactor Casing II + case 13: + return TexturesGtBlock.Casing_Material_Zeron100.getIcon(); + case 14: + return TexturesGtBlock.Casing_Staballoy_Firebox.getIcon(); + case 15: + return TexturesGtBlock.Casing_Material_ZirconiumCarbide.getIcon(); + + default: + return Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon(); + + } + } + return Textures.BlockIcons.MACHINE_CASING_GEARBOX_TUNGSTENSTEEL.getIcon(); + } + + + public static IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks thisBlock) { + /*if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ + return gregtech59.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); + } + return gregtech58.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);*/ + return gregtechX.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); + } +} \ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java new file mode 100644 index 0000000000..c980997c64 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java @@ -0,0 +1,57 @@ +package gtPlusPlus.xmod.gregtech.common.blocks.textures; + +import net.minecraft.util.IIcon; + +import gregtech.api.enums.Textures; + +public class CasingTextureHandler2 { + + public static IIcon getIcon(final int aSide, final int aMeta) { //Texture ID's. case 0 == ID[57] + if ((aMeta >= 0) && (aMeta < 16)) { + switch (aMeta) { + case 0: + return TexturesGtBlock.Casing_Material_RedSteel.getIcon(); + case 1: + return TexturesGtBlock.Casing_Material_HastelloyX.getIcon(); + case 2: + return TexturesGtBlock.Casing_Material_HastelloyN.getIcon(); + case 3: + return TexturesGtBlock.Casing_Material_Fluid_IncoloyDS.getIcon(); + case 4: + return TexturesGtBlock.Casing_Material_Grisium.getIcon(); + case 5: + return TexturesGtBlock.Casing_Machine_Metal_Panel_A.getIcon(); + case 6: + return TexturesGtBlock.Casing_Machine_Metal_Grate_A.getIcon(); + case 7: + return TexturesGtBlock.Casing_Redox_1.getIcon(); + case 8: + return TexturesGtBlock.Casing_Machine_Metal_Sheet_A.getIcon(); + case 9: + return TexturesGtBlock.Overlay_Machine_Cyber_A.getIcon(); + case 10: + return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon(); + case 11: + return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon(); + case 12: + return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); + case 13: + if (aSide <2) { + return TexturesGtBlock.TEXTURE_TECH_A.getIcon(); + } + else { + return TexturesGtBlock.TEXTURE_TECH_B.getIcon(); + } + case 14: + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 15: + return TexturesGtBlock.Casing_Machine_Acacia_Log.getIcon(); + default: + return TexturesGtBlock.Overlay_UU_Matter.getIcon(); + + } + } + return TexturesGtBlock._PlaceHolder.getIcon(); + } + +} \ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java new file mode 100644 index 0000000000..019a432013 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java @@ -0,0 +1,68 @@ +package gtPlusPlus.xmod.gregtech.common.blocks.textures; + +import net.minecraft.util.IIcon; +import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks3; + +public class CasingTextureHandler3 { + + public static IIcon getIcon(final int aSide, final int aMeta) { //Texture ID's. case 0 == ID[57] + if ((aMeta >= 0) && (aMeta < 16)) { + switch (aMeta) { + case 0: + //Aquatic Casing + return TexturesGtBlock.TEXTURE_METAL_PANEL_B.getIcon(); + case 1: + //Inconel Reinforced Casing + return TexturesGtBlock.TEXTURE_METAL_PANEL_D.getIcon(); + case 2: + //Multi-Use Casing + return TexturesGtBlock.TEXTURE_METAL_PANEL_C.getIcon(); + case 3: + //Trinium Plated Mining Platform Casing + return TexturesGtBlock.Casing_Trinium_Naquadah_Vent.getIcon(); + case 4: + //Vanadium Redox IV + return TexturesGtBlock.Casing_Redox_2.getIcon(); + case 5: + //Vanadium Redox LuV + return TexturesGtBlock.Casing_Redox_3.getIcon(); + case 6: + //Vanadium Redox ZPM + return TexturesGtBlock.Casing_Redox_4.getIcon(); + case 7: + //Vanadium Redox UV + return TexturesGtBlock.Casing_Redox_5.getIcon(); + case 8: + //Vanadium Redox MAX + return TexturesGtBlock.Casing_Redox_6.getIcon(); + case 9: + //Amazon Warehouse Casing + return TexturesGtBlock.TEXTURE_CASING_AMAZON.getIcon(); + case 10: + //Adv. Vac. Freezer + return TexturesGtBlock.TEXTURE_CASING_ADVANCED_CRYOGENIC.getIcon(); + case 11: + //Adv. EBF + return TexturesGtBlock.TEXTURE_CASING_ADVANCED_VOLCNUS.getIcon(); + case 12: + return TexturesGtBlock.TEXTURE_CASING_FUSION_COIL_II.getIcon(); + case 13: + return TexturesGtBlock.TEXTURE_CASING_FUSION_COIL_II_INNER.getIcon(); + case 14: + return TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA.getIcon(); + case 15: + return TexturesGtBlock.TEXTURE_MAGIC_PANEL_A.getIcon(); + + default: + return TexturesGtBlock._PlaceHolder.getIcon(); + + } + } + return TexturesGtBlock._PlaceHolder.getIcon(); + } + + static { + GregtechMetaCasingBlocks3.mConnectedMachineTextures = true; + } + +} \ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java new file mode 100644 index 0000000000..6326dd2c29 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java @@ -0,0 +1,166 @@ +package gtPlusPlus.xmod.gregtech.common.blocks.textures; + +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.blocks.textures.TexturesGtBlock.CustomIcon; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialCentrifuge; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +public class TexturesCentrifugeMultiblock { + + private static CustomIcon GT8_1_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE1"); + private static CustomIcon GT8_1 = new CustomIcon("iconsets/LARGECENTRIFUGE1"); + private static CustomIcon GT8_2_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE2"); + private static CustomIcon GT8_2 = new CustomIcon("iconsets/LARGECENTRIFUGE2"); + private static CustomIcon GT8_3_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE3"); + private static CustomIcon GT8_3 = new CustomIcon("iconsets/LARGECENTRIFUGE3"); + private static CustomIcon GT8_4_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE4"); + private static CustomIcon GT8_4 = new CustomIcon("iconsets/LARGECENTRIFUGE4"); + private static CustomIcon GT8_5_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5"); + private static CustomIcon GT8_5 = new CustomIcon("iconsets/LARGECENTRIFUGE5"); + private static CustomIcon GT8_6_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE6"); + private static CustomIcon GT8_6 = new CustomIcon("iconsets/LARGECENTRIFUGE6"); + private static CustomIcon GT8_7_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE7"); + private static CustomIcon GT8_7 = new CustomIcon("iconsets/LARGECENTRIFUGE7"); + private static CustomIcon GT8_8_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE8"); + private static CustomIcon GT8_8 = new CustomIcon("iconsets/LARGECENTRIFUGE8"); + private static CustomIcon GT8_9_Active = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE9"); + private static CustomIcon GT8_9 = new CustomIcon("iconsets/LARGECENTRIFUGE9"); + + private static CustomIcon frontFace_0 = (GT8_1); + private static CustomIcon frontFaceActive_0 = (GT8_1_Active); + private static CustomIcon frontFace_1 = (GT8_2); + private static CustomIcon frontFaceActive_1 = (GT8_2_Active); + private static CustomIcon frontFace_2 = (GT8_3); + private static CustomIcon frontFaceActive_2 = (GT8_3_Active); + private static CustomIcon frontFace_3 = (GT8_4); + private static CustomIcon frontFaceActive_3 = (GT8_4_Active); + private static CustomIcon frontFace_4 = (GT8_5); + private static CustomIcon frontFaceActive_4 = (GT8_5_Active); + private static CustomIcon frontFace_5 = (GT8_6); + private static CustomIcon frontFaceActive_5 = (GT8_6_Active); + private static CustomIcon frontFace_6 = (GT8_7); + private static CustomIcon frontFaceActive_6 = (GT8_7_Active); + private static CustomIcon frontFace_7 = (GT8_8); + private static CustomIcon frontFaceActive_7 = (GT8_8_Active); + private static CustomIcon frontFace_8 = (GT8_9); + private static CustomIcon frontFaceActive_8 = (GT8_9_Active); + + CustomIcon[] CENTRIFUGE = new CustomIcon[]{ + frontFace_0, + frontFace_1, + frontFace_2, + frontFace_3, + frontFace_4, + frontFace_5, + frontFace_6, + frontFace_7, + frontFace_8 + }; + + CustomIcon[] CENTRIFUGE_ACTIVE = new 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 int aSide, final GregtechMetaCasingBlocks thisBlock) { + return this.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); + } + + private static int isCentrifugeControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (!(tTileEntity instanceof IGregTechTileEntity)) return 0; + IGregTechTileEntity tTile = (IGregTechTileEntity) tTileEntity; + if (tTile.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialCentrifuge && tTile.getFrontFacing() == aSide) + return tTile.isActive() ? 1 : 2; + return 0; + } + + public IIcon handleCasingsGT58(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks thisBlock) { + final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); + if (tMeta != 0) { + return CasingTextureHandler.getIcon(aSide, tMeta); + } + int tInvertLeftRightMod = aSide % 2 * 2 - 1; + switch (aSide / 2) { + case 0: + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if (i == 0 && j == 0) + continue; + if (isCentrifugeControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, aSide) != 0) { + IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld.getTileEntity(xCoord + j, yCoord, zCoord + i)).getMetaTileEntity(); + return getIconByIndex(tMetaTileEntity, 4 - i * 3 - j); + } + } + } + break; + case 1: + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if (i == 0 && j == 0) + continue; + if (isCentrifugeControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide) != 0) { + IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld.getTileEntity(xCoord + j, yCoord + i, zCoord)).getMetaTileEntity(); + return getIconByIndex(tMetaTileEntity, 4 + i * 3 - j * tInvertLeftRightMod); + } + } + } + break; + case 2: + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if (i == 0 && j == 0) + continue; + if (isCentrifugeControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide) != 0) { + IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld.getTileEntity(xCoord, yCoord + i, zCoord + j)).getMetaTileEntity(); + return getIconByIndex(tMetaTileEntity, 4 + i * 3 + j * tInvertLeftRightMod); + } + } + } + break; + } + return TexturesGtBlock.Casing_Material_Centrifuge.getIcon(); + } + + public boolean isCentrifugeRunning(IMetaTileEntity aTile) { + if (aTile == null) { + return false; + } + else { + return aTile.getBaseMetaTileEntity().isActive(); + } + + + } + + public boolean isUsingAnimatedTexture(IMetaTileEntity aMetaTileEntity) { + if (aMetaTileEntity != null) { + if (aMetaTileEntity instanceof GregtechMetaTileEntity_IndustrialCentrifuge) { + return ((GregtechMetaTileEntity_IndustrialCentrifuge) aMetaTileEntity).usingAnimations(); + } + } + return false; + } + + public IIcon getIconByIndex(IMetaTileEntity aMetaTileEntity, int aIndex) { + if (isUsingAnimatedTexture(aMetaTileEntity)) { + if (isCentrifugeRunning(aMetaTileEntity)) { + return this.CENTRIFUGE_ACTIVE[aIndex].getIcon(); + } + } + return this.CENTRIFUGE[aIndex].getIcon(); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java new file mode 100644 index 0000000000..e772f0f48c --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java @@ -0,0 +1,443 @@ +package gtPlusPlus.xmod.gregtech.common.blocks.textures; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +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 TexturesGregtech58 { + + private static Textures.BlockIcons.CustomIcon GT8_1_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE1"); + private static Textures.BlockIcons.CustomIcon GT8_1 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE1"); + private static Textures.BlockIcons.CustomIcon GT8_2_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE2"); + private static Textures.BlockIcons.CustomIcon GT8_2 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE2"); + private static Textures.BlockIcons.CustomIcon GT8_3_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE3"); + private static Textures.BlockIcons.CustomIcon GT8_3 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE3"); + private static Textures.BlockIcons.CustomIcon GT8_4_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE4"); + private static Textures.BlockIcons.CustomIcon GT8_4 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE4"); + private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE5"); + private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE5"); + private static Textures.BlockIcons.CustomIcon GT8_6_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE6"); + private static Textures.BlockIcons.CustomIcon GT8_6 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE6"); + private static Textures.BlockIcons.CustomIcon GT8_7_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE7"); + private static Textures.BlockIcons.CustomIcon GT8_7 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE7"); + private static Textures.BlockIcons.CustomIcon GT8_8_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE8"); + private static Textures.BlockIcons.CustomIcon GT8_8 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE8"); + private static Textures.BlockIcons.CustomIcon GT8_9_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE9"); + private static Textures.BlockIcons.CustomIcon GT8_9 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE9"); + + 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 int aSide, final GregtechMetaCasingBlocks thisBlock) { + return this.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); + } + + + public IIcon handleCasingsGT58(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks thisBlock) { + final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); + if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) { + return CasingTextureHandler.getIcon(aSide, tMeta); + } + final int tStartIndex = tMeta == 6 ? 1 : 13; + if (tMeta == 0) { + if ((aSide == 2) || (aSide == 3)) { + TileEntity tTileEntity; + IMetaTileEntity tMetaTileEntity; + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 3 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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() == aSide) && (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() == aSide) && (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 + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 2 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 ((aSide == 4) || (aSide == 5)) { + TileEntity tTileEntity; + Object tMetaTileEntity; + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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() == aSide) && (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() == aSide) && (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 + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 (aSide) { + case 0: + 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 1: + 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 2: + 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 3: + 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 4: + 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 5: + 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/blocks/textures/TexturesGregtech59.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java new file mode 100644 index 0000000000..ac721d81c3 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java @@ -0,0 +1,444 @@ +package gtPlusPlus.xmod.gregtech.common.blocks.textures; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +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 int aSide, final GregtechMetaCasingBlocks thisBlock) { + return this.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); + } + + + public IIcon handleCasingsGT59(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks thisBlock) { + final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); + if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) { + return CasingTextureHandler.getIcon(aSide, tMeta); + } + final int tStartIndex = tMeta == 6 ? 1 : 13; + if (tMeta == 0) { + if ((aSide == 2) || (aSide == 3)) { + TileEntity tTileEntity; + IMetaTileEntity tMetaTileEntity; + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 3 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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() == aSide) && (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() == aSide) && (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 + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 2 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 ((aSide == 4) || (aSide == 5)) { + TileEntity tTileEntity; + Object tMetaTileEntity; + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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() == aSide) && (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() == aSide) && (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 + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (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 (aSide) { + case 0: + 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 1: + 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 2: + 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 3: + 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 4: + 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 5: + 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/blocks/textures/TexturesGrinderMultiblock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java new file mode 100644 index 0000000000..962f981d3b --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java @@ -0,0 +1,150 @@ +package gtPlusPlus.xmod.gregtech.common.blocks.textures; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks5; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IsaMill; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +public class TexturesGrinderMultiblock { + + private static CustomIcon GT8_1_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE1"); + private static CustomIcon GT8_1 = new CustomIcon("iconsets/Grinder/GRINDER1"); + private static CustomIcon GT8_2_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE2"); + private static CustomIcon GT8_2 = new CustomIcon("iconsets/Grinder/GRINDER2"); + private static CustomIcon GT8_3_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE3"); + private static CustomIcon GT8_3 = new CustomIcon("iconsets/Grinder/GRINDER3"); + private static CustomIcon GT8_4_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE4"); + private static CustomIcon GT8_4 = new CustomIcon("iconsets/Grinder/GRINDER4"); + private static CustomIcon GT8_5_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE5"); + private static CustomIcon GT8_5 = new CustomIcon("iconsets/Grinder/GRINDER5"); + private static CustomIcon GT8_6_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE6"); + private static CustomIcon GT8_6 = new CustomIcon("iconsets/Grinder/GRINDER6"); + private static CustomIcon GT8_7_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE7"); + private static CustomIcon GT8_7 = new CustomIcon("iconsets/Grinder/GRINDER7"); + private static CustomIcon GT8_8_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE8"); + private static CustomIcon GT8_8 = new CustomIcon("iconsets/Grinder/GRINDER8"); + private static CustomIcon GT8_9_Active = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE9"); + private static CustomIcon GT8_9 = new CustomIcon("iconsets/Grinder/GRINDER9"); + + private static CustomIcon frontFace_0 = (GT8_1); + private static CustomIcon frontFaceActive_0 = (GT8_1_Active); + private static CustomIcon frontFace_1 = (GT8_2); + private static CustomIcon frontFaceActive_1 = (GT8_2_Active); + private static CustomIcon frontFace_2 = (GT8_3); + private static CustomIcon frontFaceActive_2 = (GT8_3_Active); + private static CustomIcon frontFace_3 = (GT8_4); + private static CustomIcon frontFaceActive_3 = (GT8_4_Active); + private static CustomIcon frontFace_4 = (GT8_5); + private static CustomIcon frontFaceActive_4 = (GT8_5_Active); + private static CustomIcon frontFace_5 = (GT8_6); + private static CustomIcon frontFaceActive_5 = (GT8_6_Active); + private static CustomIcon frontFace_6 = (GT8_7); + private static CustomIcon frontFaceActive_6 = (GT8_7_Active); + private static CustomIcon frontFace_7 = (GT8_8); + private static CustomIcon frontFaceActive_7 = (GT8_8_Active); + private static CustomIcon frontFace_8 = (GT8_9); + private static CustomIcon frontFaceActive_8 = (GT8_9_Active); + + CustomIcon[] GRINDER = new CustomIcon[]{ + frontFace_0, + frontFace_1, + frontFace_2, + frontFace_3, + frontFace_4, + frontFace_5, + frontFace_6, + frontFace_7, + frontFace_8 + }; + + CustomIcon[] GRINDER_ACTIVE = new CustomIcon[]{ + frontFaceActive_0, + frontFaceActive_1, + frontFaceActive_2, + frontFaceActive_3, + frontFaceActive_4, + frontFaceActive_5, + frontFaceActive_6, + frontFaceActive_7, + frontFaceActive_8 + }; + + private static int isIsaControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { + TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); + if (!(tTileEntity instanceof IGregTechTileEntity)) return 0; + IGregTechTileEntity tTile = (IGregTechTileEntity) tTileEntity; + if (tTile.getMetaTileEntity() instanceof GregtechMetaTileEntity_IsaMill && tTile.getFrontFacing() == aSide) + return tTile.isActive() ? 1 : 2; + return 0; + } + + public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks5 ii) { + final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); + if (tMeta != 0) { + return GregtechMetaCasingBlocks5.getStaticIcon(aSide, tMeta); + } + int tInvertLeftRightMod = aSide % 2 * 2 - 1; + switch (aSide / 2) { + case 0: + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if (i == 0 && j == 0) + continue; + if (isIsaControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, aSide) != 0) { + IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld.getTileEntity(xCoord + j, yCoord, zCoord + i)).getMetaTileEntity(); + return getIconByIndex(tMetaTileEntity, 4 - i * 3 - j); + } + } + } + break; + case 1: + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if (i == 0 && j == 0) + continue; + if (isIsaControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide) != 0) { + IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld.getTileEntity(xCoord + j, yCoord + i, zCoord)).getMetaTileEntity(); + return getIconByIndex(tMetaTileEntity, 4 + i * 3 - j * tInvertLeftRightMod); + } + } + } + break; + case 2: + for (int i = -1; i < 2; i++) { + for (int j = -1; j < 2; j++) { + if (i == 0 && j == 0) + continue; + if (isIsaControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide) != 0) { + IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld.getTileEntity(xCoord, yCoord + i, zCoord + j)).getMetaTileEntity(); + return getIconByIndex(tMetaTileEntity, 4 + i * 3 + j * tInvertLeftRightMod); + } + } + } + break; + } + return TexturesGtBlock.TEXTURE_CASING_GRINDING_MILL.getIcon(); + } + + public boolean isCentrifugeRunning(IMetaTileEntity aTile) { + if (aTile == null) { + return false; + } + else { + return aTile.getBaseMetaTileEntity().isActive(); + } + } + + public IIcon getIconByIndex(IMetaTileEntity aMetaTileEntity, int aIndex) { + if (isCentrifugeRunning(aMetaTileEntity)) { + return this.GRINDER_ACTIVE[aIndex].getIcon(); + } + + return this.GRINDER[aIndex].getIcon(); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java new file mode 100644 index 0000000000..518ffe0eae --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -0,0 +1,652 @@ +package gtPlusPlus.xmod.gregtech.common.blocks.textures; + +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.objects.GT_RenderedTexture; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.lib.CORE; + +public class TexturesGtBlock { + + private static AutoMap mCustomiconMap = new AutoMap(); + + static { + + } + + //public static ITexture[] CASING_BLOCKS_GTPP = new ITexture[256]; + + /* + * Handles Custom Textures. + */ + + public static class CustomIcon implements IIconContainer, Runnable { + protected IIcon mIcon; + protected String mIconName; + protected String mModID; + + public CustomIcon(final String aIconName) { + this(CORE.MODID, aIconName); + } + + public CustomIcon(final String aModID, final String aIconName) { + this.mIconName = aIconName; + this.mModID = aModID; + mCustomiconMap.put(this); + Logger.WARNING("Constructing a Custom Texture. " + this.mIconName); + GregTech_API.sGTBlockIconload.add(this); + } + + @Override + public IIcon getIcon() { + return this.mIcon; + } + + @Override + public IIcon getOverlayIcon() { + return null; + } + + @Override + public void run() { + this.mIcon = GregTech_API.sBlockIcons.registerIcon(this.mModID + ":" + this.mIconName); + Logger.WARNING("FIND ME _ Processing texture: "+this.getTextureFile().getResourcePath()); + } + + @Override + public ResourceLocation getTextureFile() { + return TextureMap.locationBlocksTexture; + } + } + + + public static class VanillaIcon implements IIconContainer, Runnable { + protected IIcon mIcon; + protected String mIconName; + + public VanillaIcon(final String aIconName) { + this.mIconName = aIconName; + mCustomiconMap.put(this); + Logger.WARNING("Constructing a Custom Texture. " + this.mIconName); + GregTech_API.sGTBlockIconload.add(this); + } + + @Override + public IIcon getIcon() { + return this.mIcon; + } + + @Override + public IIcon getOverlayIcon() { + return null; + } + + @Override + public void run() { + this.mIcon = GregTech_API.sBlockIcons.registerIcon("minecraft" + ":" + this.mIconName); + } + + @Override + public ResourceLocation getTextureFile() { + return TextureMap.locationBlocksTexture; + } + } + + public static GT_RenderedTexture getTextureFromIcon(CustomIcon aIcon, short[] aRGB) { + return new GT_RenderedTexture(aIcon, aRGB); + } + + /* + * Add Some Custom Textures below. + * I am not sure whether or not I need to declare them as such, but better to be safe than sorry. + * Right? + */ + + //Vanilla Textures + public static final VanillaIcon VanillaIcon_OakPlanks = new VanillaIcon("planks_oak"); + + + + //PlaceHolder Texture + private static final CustomIcon Internal_PlaceHolder = new CustomIcon("TileEntities/_PlaceHolder"); + public static final CustomIcon _PlaceHolder = Internal_PlaceHolder; + + //Energy overlays + public static final CustomIcon OVERLAY_ENERGY_OUT_BUFFER = new CustomIcon("iconsets/OVERLAY_ENERGY_OUT_BUFFER"); + public static final CustomIcon OVERLAY_ENERGY_OUT_MULTI_BUFFER = new CustomIcon("iconsets/OVERLAY_ENERGY_OUT_MULTI_BUFFER"); + + //Wooden Shelf and Compartment Overlays + public static final CustomIcon OVERLAY_WOODEN_SHELF_FRONT = new CustomIcon("TileEntities/Compartment/wood_shelf"); + public static final CustomIcon OVERLAY_WOODEN_SHELF_CANS_FRONT = new CustomIcon("TileEntities/Compartment/wood_shelf_cans"); + public static final CustomIcon OVERLAY_WOODEN_SHELF_PAPER_FRONT = new CustomIcon("TileEntities/Compartment/wood_shelf_paper"); + public static final CustomIcon OVERLAY_CABINET_1 = new CustomIcon("TileEntities/Compartment/0"); + public static final CustomIcon OVERLAY_CABINET_2 = new CustomIcon("TileEntities/Compartment/1"); + public static final CustomIcon OVERLAY_CABINET_3 = new CustomIcon("TileEntities/Compartment/2"); + public static final CustomIcon OVERLAY_CABINET_4 = new CustomIcon("TileEntities/Compartment/3"); + public static final CustomIcon OVERLAY_CABINET_5 = new CustomIcon("TileEntities/Compartment/4"); + public static final CustomIcon OVERLAY_CABINET_6 = new CustomIcon("TileEntities/Compartment/5"); + public static final CustomIcon OVERLAY_CABINET_7 = new CustomIcon("TileEntities/Compartment/6"); + public static final CustomIcon OVERLAY_CABINET_8 = new CustomIcon("TileEntities/Compartment/7"); + public static final CustomIcon OVERLAY_CABINET_9 = new CustomIcon("TileEntities/Compartment/8"); + public static final CustomIcon OVERLAY_CABINET_10 = new CustomIcon("TileEntities/Compartment/9"); + public static final CustomIcon OVERLAY_CABINET_11 = new CustomIcon("TileEntities/Compartment/10"); + public static final CustomIcon OVERLAY_CABINET_12 = new CustomIcon("TileEntities/Compartment/11"); + public static final CustomIcon OVERLAY_CABINET_13 = new CustomIcon("TileEntities/Compartment/12"); + public static final CustomIcon OVERLAY_CABINET_14 = new CustomIcon("TileEntities/Compartment/13"); + public static final CustomIcon OVERLAY_CABINET_15 = new CustomIcon("TileEntities/Compartment/14"); + public static final CustomIcon OVERLAY_CABINET_16 = new CustomIcon("TileEntities/Compartment/15"); + public static final CustomIcon OVERLAY_COMPARTMENT_1 = new CustomIcon("TileEntities/Compartment/16"); + public static final CustomIcon OVERLAY_COMPARTMENT_2 = new CustomIcon("TileEntities/Compartment/17"); + public static final CustomIcon OVERLAY_COMPARTMENT_3 = new CustomIcon("TileEntities/Compartment/18"); + public static final CustomIcon OVERLAY_COMPARTMENT_4 = new CustomIcon("TileEntities/Compartment/19"); + public static final CustomIcon OVERLAY_COMPARTMENT_5 = new CustomIcon("TileEntities/Compartment/20"); + public static final CustomIcon OVERLAY_COMPARTMENT_6 = new CustomIcon("TileEntities/Compartment/21"); + public static final CustomIcon OVERLAY_COMPARTMENT_7 = new CustomIcon("TileEntities/Compartment/22"); + public static final CustomIcon OVERLAY_COMPARTMENT_8 = new CustomIcon("TileEntities/Compartment/23"); + public static final CustomIcon OVERLAY_COMPARTMENT_9 = new CustomIcon("TileEntities/Compartment/24"); + public static final CustomIcon OVERLAY_COMPARTMENT_10 = new CustomIcon("TileEntities/Compartment/25"); + public static final CustomIcon OVERLAY_COMPARTMENT_11 = new CustomIcon("TileEntities/Compartment/26"); + public static final CustomIcon OVERLAY_COMPARTMENT_12 = new CustomIcon("TileEntities/Compartment/27"); + public static final CustomIcon OVERLAY_COMPARTMENT_13 = new CustomIcon("TileEntities/Compartment/28"); + public static final CustomIcon OVERLAY_COMPARTMENT_14 = new CustomIcon("TileEntities/Compartment/29"); + public static final CustomIcon OVERLAY_COMPARTMENT_15 = new CustomIcon("TileEntities/Compartment/30"); + public static final CustomIcon OVERLAY_COMPARTMENT_16 = new CustomIcon("TileEntities/Compartment/31"); + + //Controllers + private static final CustomIcon Internal_Casing_Fusion_Simple_Front = new CustomIcon("TileEntities/MACHINE_CASING_FUSION_FRONT"); + public static final CustomIcon Casing_Fusion_Simple_Front = Internal_Casing_Fusion_Simple_Front; + private static final CustomIcon Internal_Casing_Fusion_Simple_Front_Active = new CustomIcon("TileEntities/MACHINE_CASING_FUSION_FRONT_ACTIVE"); + public static final CustomIcon Casing_Fusion_Simple_Front_Active = Internal_Casing_Fusion_Simple_Front_Active; + + //Machine Casings + //Simple + private static final CustomIcon Internal_Casing_Machine_Simple_Top = new CustomIcon("TileEntities/machine_top"); + public static final CustomIcon Casing_Machine_Simple_Top = Internal_Casing_Machine_Simple_Top; + private static final CustomIcon Internal_Casing_Machine_Simple_Bottom = new CustomIcon("TileEntities/machine_bottom"); + public static final CustomIcon Casing_Machine_Simple_Bottom = Internal_Casing_Machine_Simple_Bottom; + //Advanced and Ultra + private static final CustomIcon Internal_Casing_Machine_Advanced = new CustomIcon("TileEntities/high_adv_machine"); + public static final CustomIcon Casing_Machine_Advanced = Internal_Casing_Machine_Advanced; + private static final CustomIcon Internal_Casing_Machine_Ultra = new CustomIcon("TileEntities/adv_machine_lesu"); + public static final CustomIcon Casing_Machine_Ultra = Internal_Casing_Machine_Ultra; + //Dimensional - Non Overlay + private static final CustomIcon Internal_Casing_Machine_Dimensional = new CustomIcon("TileEntities/adv_machine_dimensional"); + public static final CustomIcon Casing_Machine_Dimensional = Internal_Casing_Machine_Dimensional; + private static final CustomIcon Internal_Casing_Machine_Dimensional_Adv = new CustomIcon("TileEntities/high_adv_machine_dimensional"); + public static final CustomIcon Casing_Machine_Dimensional_Adv = Internal_Casing_Machine_Dimensional_Adv; + + //Material Casings + private static final CustomIcon Internal_Casing_Tantalloy61 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TANTALLOY61"); + public static final CustomIcon Casing_Material_Tantalloy61 = Internal_Casing_Tantalloy61; + private static final CustomIcon Internal_Casing_MaragingSteel = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_MARAGINGSTEEL"); + public static final CustomIcon Casing_Material_MaragingSteel = Internal_Casing_MaragingSteel; + private static final CustomIcon Internal_Casing_Stellite = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_STELLITE"); + public static final CustomIcon Casing_Material_Stellite = Internal_Casing_Stellite; + private static final CustomIcon Internal_Casing_Talonite = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TALONITE"); + public static final CustomIcon Casing_Material_Talonite = Internal_Casing_Talonite; + private static final CustomIcon Internal_Casing_Tumbaga = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TUMBAGA"); + public static final CustomIcon Casing_Material_Tumbaga = Internal_Casing_Tumbaga; + private static final CustomIcon Internal_Casing_Zeron100 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_ZERON100"); + public static final CustomIcon Casing_Material_Zeron100 = Internal_Casing_Zeron100; + private static final CustomIcon Internal_Casing_Potin = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_POTIN"); + public static final CustomIcon Casing_Material_Potin = Internal_Casing_Potin; + + private static final CustomIcon Internal_Casing_Grisium = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_GRISIUM"); + public static final CustomIcon Casing_Material_Grisium = Internal_Casing_Grisium; + private static final CustomIcon Internal_Casing_RedSteel = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_RED_STEEL"); + public static final CustomIcon Casing_Material_RedSteel = Internal_Casing_RedSteel; + private static final CustomIcon Internal_Casing_Incoloy020 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_020"); + public static final CustomIcon Casing_Material_Incoloy020 = Internal_Casing_Incoloy020; + private static final CustomIcon Internal_Casing_IncoloyDS = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_DS"); + public static final CustomIcon Casing_Material_IncoloyDS = Internal_Casing_IncoloyDS; + private static final CustomIcon Internal_Casing_IncoloyMA956 = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_MA956"); + public static final CustomIcon Casing_Material_IncoloyMA956 = Internal_Casing_IncoloyMA956; + private static final CustomIcon Internal_Casing_ZirconiumCarbide = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_ZIRCONIUM_CARBIDE"); + public static final CustomIcon Casing_Material_ZirconiumCarbide = Internal_Casing_ZirconiumCarbide; + + + private static final CustomIcon Internal_Casing_HastelloyX = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_HASTELLOY_X"); + public static final CustomIcon Casing_Material_HastelloyX = Internal_Casing_HastelloyX; + private static final CustomIcon Internal_Casing_HastelloyN = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_HASTELLOY_N"); + public static final CustomIcon Casing_Material_HastelloyN = Internal_Casing_HastelloyN; + private static final CustomIcon Internal_Casing_Fluid_IncoloyDS = new CustomIcon("TileEntities/MACHINE_CASING_FLUID_INCOLOY_DS"); + public static final CustomIcon Casing_Material_Fluid_IncoloyDS = Internal_Casing_Fluid_IncoloyDS; + + private static final CustomIcon Internal_Casing_Laurenium = new CustomIcon("TileEntities/MACHINE_CASING_LAURENIUM"); + public static final CustomIcon Casing_Material_Laurenium = Internal_Casing_Laurenium; + + //Trinium Alloys + public static final CustomIcon Casing_Trinium_Titanium = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_TITANIUM"); + public static final CustomIcon Casing_Trinium_Naquadah = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH"); + public static final CustomIcon Casing_Trinium_Naquadah_Vent = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH_VENT"); + public static final CustomIcon Casing_Trinium_Naquadah_Carbon = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH_CARBON"); + + //Material Machine/Firebox Casings + private static final CustomIcon Internal_Casing_Staballoy_Firebox = new CustomIcon("TileEntities/MACHINE_CASING_FIREBOX_STABALLOY"); + public static final CustomIcon Casing_Staballoy_Firebox = Internal_Casing_Staballoy_Firebox; + + //Misc Casings + private static final CustomIcon Internal_Casing_Machine_Redstone_Off = new CustomIcon("TileEntities/cover_redstone_conductor"); + public static final CustomIcon Casing_Machine_Redstone_Off = Internal_Casing_Machine_Redstone_Off; + private static final CustomIcon Internal_Casing_Machine_Redstone_On = new CustomIcon("TileEntities/cover_redstone_emitter"); + public static final CustomIcon Casing_Machine_Redstone_On = Internal_Casing_Machine_Redstone_On; + + //Redox Cells + public static final CustomIcon Casing_Redox_1 = new CustomIcon("redox/redox1"); + public static final CustomIcon Casing_Redox_2 = new CustomIcon("redox/redox2"); + public static final CustomIcon Casing_Redox_3 = new CustomIcon("redox/redox3"); + public static final CustomIcon Casing_Redox_4 = new CustomIcon("redox/redox4"); + public static final CustomIcon Casing_Redox_5 = new CustomIcon("redox/redox5"); + public static final CustomIcon Casing_Redox_6 = new CustomIcon("redox/redox6"); + //public static final CustomIcon Casing_Redox_7 = new CustomIcon("redox/redox7"); + //public static final CustomIcon Casing_Redox_8 = new CustomIcon("redox/redox8"); + + //Centrifuge Casing + private static final CustomIcon Internal_Casing_Centrifuge = new CustomIcon("TileEntities/MACHINE_CASING_CENTRIFUGE"); + public static final CustomIcon Casing_Material_Centrifuge = Internal_Casing_Centrifuge; + + //MACHINE_CASING_FARM_MANAGER_STRUCTURAL + //Farm Manager Casings + private static final CustomIcon Internal_Casing_Machine_Farm_Manager = new CustomIcon("TileEntities/MACHINE_CASING_FARM_MANAGER_STRUCTURAL"); + public static final CustomIcon Casing_Machine_Farm_Manager = Internal_Casing_Machine_Farm_Manager; + //Acacia_Log + private static final CustomIcon Internal_Casing_Machine_Acacia_Log = new CustomIcon("TileEntities/log_acacia_top"); + public static final CustomIcon Casing_Machine_Acacia_Log = Internal_Casing_Machine_Acacia_Log; + //Podzol Top + private static final CustomIcon Internal_Casing_Machine_Podzol = new CustomIcon("TileEntities/dirt_podzol_top"); + public static final CustomIcon Casing_Machine_Podzol = Internal_Casing_Machine_Podzol; + + //Structural Blocks + private static final CustomIcon Internal_Casing_Machine_Metal_Grate_A = new CustomIcon("chrono/MetalGrate"); + public static final CustomIcon Casing_Machine_Metal_Grate_A = Internal_Casing_Machine_Metal_Grate_A; + private static final CustomIcon Internal_Casing_Machine_Metal_Grate_A_Solid = new CustomIcon("chrono/MetalGrateA_Solid"); + public static final CustomIcon Casing_Machine_Metal_Grate_A_Solid = Internal_Casing_Machine_Metal_Grate_A_Solid; + private static final CustomIcon Internal_Casing_Machine_Metal_Grate_B = new CustomIcon("chrono/MetalGrate2"); + public static final CustomIcon Casing_Machine_Metal_Grate_B = Internal_Casing_Machine_Metal_Grate_B; + private static final CustomIcon Internal_Casing_Machine_Metal_Panel_A = new CustomIcon("chrono/MetalPanel"); + public static final CustomIcon Casing_Machine_Metal_Panel_A = Internal_Casing_Machine_Metal_Panel_A; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_A = new CustomIcon("chrono/MetalSheet"); + public static final CustomIcon Casing_Machine_Metal_Sheet_A = Internal_Casing_Machine_Metal_Sheet_A; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_B = new CustomIcon("chrono/MetalSheet2"); + public static final CustomIcon Casing_Machine_Metal_Sheet_B = Internal_Casing_Machine_Metal_Sheet_B; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_C = new CustomIcon("chrono/MetalSheet3"); + public static final CustomIcon Casing_Machine_Metal_Sheet_C = Internal_Casing_Machine_Metal_Sheet_C; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_D = new CustomIcon("chrono/MetalSheet4"); + public static final CustomIcon Casing_Machine_Metal_Sheet_D = Internal_Casing_Machine_Metal_Sheet_D; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_E = new CustomIcon("chrono/MetalSheet5"); + public static final CustomIcon Casing_Machine_Metal_Sheet_E = Internal_Casing_Machine_Metal_Sheet_E; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_F = new CustomIcon("chrono/MetalSheet6"); + public static final CustomIcon Casing_Machine_Metal_Sheet_F = Internal_Casing_Machine_Metal_Sheet_F; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_G = new CustomIcon("chrono/MetalSheet7"); + public static final CustomIcon Casing_Machine_Metal_Sheet_G = Internal_Casing_Machine_Metal_Sheet_G; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_H = new CustomIcon("chrono/MetalSheet8"); + public static final CustomIcon Casing_Machine_Metal_Sheet_H = Internal_Casing_Machine_Metal_Sheet_H; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_I = new CustomIcon("chrono/MetalSheet9"); + public static final CustomIcon Casing_Machine_Metal_Sheet_I = Internal_Casing_Machine_Metal_Sheet_I; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_J = new CustomIcon("chrono/MetalSheet10"); + public static final CustomIcon Casing_Machine_Metal_Sheet_J = Internal_Casing_Machine_Metal_Sheet_J; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_K = new CustomIcon("chrono/MetalSheet11"); + public static final CustomIcon Casing_Machine_Metal_Sheet_K = Internal_Casing_Machine_Metal_Sheet_K; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_L = new CustomIcon("chrono/MetalSheet12"); + public static final CustomIcon Casing_Machine_Metal_Sheet_L = Internal_Casing_Machine_Metal_Sheet_L; + private static final CustomIcon Internal_Overlay_Machine_Cyber_A = new CustomIcon("chrono/CyberPanel"); + public static final CustomIcon Overlay_Machine_Cyber_A = Internal_Overlay_Machine_Cyber_A; + private static final CustomIcon Internal_Overlay_Machine_Cyber_B = new CustomIcon("chrono/CyberPanel2"); + public static final CustomIcon Overlay_Machine_Cyber_B = Internal_Overlay_Machine_Cyber_B; + + + public static final CustomIcon TEXTURE_CASING_AMAZON = new CustomIcon("TileEntities/CASING_AMAZON"); + public static final CustomIcon TEXTURE_CASING_ADVANCED_CRYOGENIC = new CustomIcon("TileEntities/MACHINE_CASING_ADVANCED_CRYOGENIC"); + public static final CustomIcon TEXTURE_CASING_ADVANCED_VOLCNUS = new CustomIcon("TileEntities/MACHINE_CASING_ADVANCED_VOLCANUS"); + public static final CustomIcon TEXTURE_CASING_ROCKETDYNE = new CustomIcon("TileEntities/MACHINE_CASING_ROCKETDYNE"); + public static final CustomIcon TEXTURE_CASING_GRINDING_MILL = new CustomIcon("TileEntities/MACHINE_CASING_GRINDING_FACTORY"); + public static final CustomIcon TEXTURE_CASING_FLOTATION = new CustomIcon("TileEntities/MACHINE_CASING_FLOTATION"); + + // Custom Pipes + public static final CustomIcon TEXTURE_PIPE_GRINDING_MILL = new CustomIcon("TileEntities/MACHINE_CASING_PIPE_T1"); + + // Custom Gearboxes + public static final CustomIcon TEXTURE_GEARBOX_GRINDING_MILL = new CustomIcon("TileEntities/MACHINE_CASING_GEARBOX_T1"); + + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II = new CustomIcon("iconsets/MACHINE_CASING_FUSION_3"); + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_INNER = new CustomIcon("iconsets/MACHINE_CASING_FUSION_COIL_II"); + public static final CustomIcon TEXTURE_CASING_FUSION_CASING_ULTRA = new CustomIcon("iconsets/MACHINE_CASING_FUSION_GLASS_ULTRA"); + // + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_1 = new CustomIcon("iconsets/FUSIONIII_1"); + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_2 = new CustomIcon("iconsets/FUSIONIII_2"); + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_3 = new CustomIcon("iconsets/FUSIONIII_3"); + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_4 = new CustomIcon("iconsets/FUSIONIII_4"); + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_5 = new CustomIcon("iconsets/FUSIONIII_5"); + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_6 = new CustomIcon("iconsets/FUSIONIII_6"); + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_7 = new CustomIcon("iconsets/FUSIONIII_7"); + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_8 = new CustomIcon("iconsets/FUSIONIII_8"); + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_9 = new CustomIcon("iconsets/FUSIONIII_9"); + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_10 = new CustomIcon("iconsets/FUSIONIII_10"); + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_11 = new CustomIcon("iconsets/FUSIONIII_11"); + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_12 = new CustomIcon("iconsets/FUSIONIII_12"); + + //Overlays + //Fan Textures + private static final CustomIcon Internal_Overlay_Machine_Vent = new CustomIcon("TileEntities/machine_top_vent_rotating"); + public static final CustomIcon Overlay_Machine_Vent = Internal_Overlay_Machine_Vent; + private static final CustomIcon Internal_Overlay_Machine_Vent_Fast = new CustomIcon("TileEntities/machine_top_vent_rotating_fast"); + public static final CustomIcon Overlay_Machine_Vent_Fast = Internal_Overlay_Machine_Vent_Fast; + private static final CustomIcon Internal_Overlay_Machine_Vent_Adv = new CustomIcon("TileEntities/adv_machine_vent_rotating"); + public static final CustomIcon Overlay_Machine_Vent_Adv = Internal_Overlay_Machine_Vent_Adv; + private static final CustomIcon Internal_Overlay_Machine_Turbine_Active = new CustomIcon("TileEntities/STEAM_TURBINE_SIDE_ACTIVE"); + public static final CustomIcon Overlay_Machine_Turbine_Active = Internal_Overlay_Machine_Turbine_Active; + //Grate Texture + public static final CustomIcon OVERLAY_GRATE_A = new CustomIcon("metro/OVERLAY_GRATE_A"); + //Speaker Texture + private static final CustomIcon Internal_Overlay_Machine_Sound = new CustomIcon("TileEntities/audio_out"); + public static final CustomIcon Overlay_Machine_Sound = Internal_Overlay_Machine_Sound; + private static final CustomIcon Internal_Overlay_Machine_Sound_Active = new CustomIcon("TileEntities/audio_out_active"); + public static final CustomIcon Overlay_Machine_Sound_Active = Internal_Overlay_Machine_Sound_Active; + //Diesel Engines + private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical = new CustomIcon("TileEntities/machine_top_dieselmotor"); + public static final CustomIcon Overlay_Machine_Diesel_Vertical = Internal_Overlay_Machine_Diesel_Vertical; + private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal = new CustomIcon("TileEntities/machine_top_dieselmotor2"); + public static final CustomIcon Overlay_Machine_Diesel_Horizontal = Internal_Overlay_Machine_Diesel_Horizontal; + private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical_Active = new CustomIcon("TileEntities/machine_top_dieselmotor_active"); + public static final CustomIcon Overlay_Machine_Diesel_Vertical_Active = Internal_Overlay_Machine_Diesel_Vertical_Active; + private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal_Active = new CustomIcon("TileEntities/machine_top_dieselmotor2_active"); + public static final CustomIcon Overlay_Machine_Diesel_Horizontal_Active = Internal_Overlay_Machine_Diesel_Horizontal_Active; + //Computer Screens + private static final CustomIcon Internal_Casing_Machine_Screen_1 = new CustomIcon("TileEntities/adv_machine_screen_random1"); + public static final CustomIcon Casing_Machine_Screen_1 = Internal_Casing_Machine_Screen_1; + private static final CustomIcon Internal_Casing_Machine_Screen_2 = new CustomIcon("TileEntities/adv_machine_screen_random2"); + public static final CustomIcon Casing_Machine_Screen_2 = Internal_Casing_Machine_Screen_2; + private static final CustomIcon Internal_Casing_Machine_Screen_3 = new CustomIcon("TileEntities/adv_machine_screen_random3"); + public static final CustomIcon Casing_Machine_Screen_3 = Internal_Casing_Machine_Screen_3; + private static final CustomIcon Internal_Casing_Machine_Screen_Frequency = new CustomIcon("TileEntities/adv_machine_screen_frequency"); + public static final CustomIcon Casing_Machine_Screen_Frequency = Internal_Casing_Machine_Screen_Frequency; + private static final CustomIcon Internal_Overlay_Machine_Screen_Logo = new CustomIcon("TileEntities/adv_machine_screen_logo"); + public static final CustomIcon Overlay_Machine_Screen_Logo = Internal_Overlay_Machine_Screen_Logo; + private static final CustomIcon Internal_Overlay_Machine_Cyber_Interface = new CustomIcon("chrono/Overlay_Cyber"); + public static final CustomIcon Overlay_Machine_Cyber_Interface = Internal_Overlay_Machine_Cyber_Interface; + + //Machine Controller Overlays + private static final CustomIcon Internal_Overlay_Machine_Controller_Default = new CustomIcon("iconsets/OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ANIMATED"); + public static final CustomIcon Overlay_Machine_Controller_Default = Internal_Overlay_Machine_Controller_Default; + private static final CustomIcon Internal_Overlay_Machine_Controller_Default_Active = new CustomIcon("iconsets/OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ANIMATED_ACTIVE"); + public static final CustomIcon Overlay_Machine_Controller_Default_Active = Internal_Overlay_Machine_Controller_Default_Active; + + private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced = new CustomIcon("iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED"); + public static final CustomIcon Overlay_Machine_Controller_Advanced = Internal_Overlay_Machine_Controller_Advanced; + private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced_Active = new CustomIcon("iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED_ACTIVE"); + public static final CustomIcon Overlay_Machine_Controller_Advanced_Active = Internal_Overlay_Machine_Controller_Advanced_Active; + + //Fluid Reactor Overlays + public static final CustomIcon Overlay_FluidReactor_Front = new CustomIcon("TileEntities/FluidReactor/OVERLAY_FRONT"); + public static final CustomIcon Overlay_FluidReactor_Side = new CustomIcon("TileEntities/FluidReactor/OVERLAY_SIDE"); + public static final CustomIcon Overlay_FluidReactor_Top = new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP"); + public static final CustomIcon Overlay_FluidReactor_Front_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE"); + public static final CustomIcon Overlay_FluidReactor_Side_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE"); + public static final CustomIcon Overlay_FluidReactor_Top_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE"); + + //Crafting Overlays + private static final CustomIcon Internal_Overlay_Crafting_Bronze = new CustomIcon("TileEntities/bronze_top_crafting"); + public static final CustomIcon Overlay_Crafting_Bronze = Internal_Overlay_Crafting_Bronze; + private static final CustomIcon Internal_Overlay_Crafting_Steel = new CustomIcon("TileEntities/cover_crafting"); + public static final CustomIcon Overlay_Crafting_Steel = Internal_Overlay_Crafting_Steel; + + //Covers + private static final CustomIcon Internal_Overlay_Overflow_Valve = new CustomIcon("iconsets/OVERLAY_OVERFLOW_VALVE"); + public static final CustomIcon Overlay_Overflow_Valve = Internal_Overlay_Overflow_Valve; + + + //Hatch Overlays + //Charger Texture + private static final CustomIcon Internal_Overlay_Hatch_Charger = new CustomIcon("TileEntities/cover_charger"); + public static final CustomIcon Overlay_Hatch_Charger = Internal_Overlay_Hatch_Charger; + //Discharger Texture + private static final CustomIcon Internal_Overlay_Hatch_Discharger = new CustomIcon("TileEntities/cover_discharge"); + public static final CustomIcon Overlay_Hatch_Discharger = Internal_Overlay_Hatch_Discharger; + //Advanced Muffler + private static final CustomIcon Internal_Overlay_Hatch_Muffler_Adv = new CustomIcon("iconsets/OVERLAY_MUFFLER_ADV"); + public static final CustomIcon Overlay_Hatch_Muffler_Adv = Internal_Overlay_Hatch_Muffler_Adv; + //Control Core Bus + private static final CustomIcon Internal_Overlay_Hatch_Control_Core = new CustomIcon("iconsets/OVERLAY_CONTROL_CORE_BUS"); + public static final CustomIcon Overlay_Hatch_Control_Core = Internal_Overlay_Hatch_Control_Core; + // Milling Ball Bus + private static final CustomIcon Internal_Overlay_Bus_Milling_Balls = new CustomIcon("iconsets/OVERLAY_MILLING_BALL_BUS"); + public static final CustomIcon Overlay_Bus_Milling_Balls = Internal_Overlay_Bus_Milling_Balls; + // Catalyst Bus + private static final CustomIcon Internal_Overlay_Bus_Catalyst = new CustomIcon("iconsets/OVERLAY_CATALYSTS"); + public static final CustomIcon Overlay_Bus_Catalyst = Internal_Overlay_Bus_Catalyst; + // RTG Hatch + private static final CustomIcon Internal_Overlay_Hatch_RTG_Off = new CustomIcon("iconsets/OVERLAY_ENERGY_RTG_OFF"); + public static final CustomIcon Overlay_Hatch_RTG_Off = Internal_Overlay_Hatch_RTG_Off; + private static final CustomIcon Internal_Overlay_Hatch_RTG_On = new CustomIcon("iconsets/OVERLAY_ENERGY_RTG_ON"); + public static final CustomIcon Overlay_Hatch_RTG_On = Internal_Overlay_Hatch_RTG_On; + + //Dimensional + private static final CustomIcon Internal_Overlay_Machine_Dimensional_Blue = new CustomIcon("TileEntities/adv_machine_dimensional_cover_blue"); + public static final CustomIcon Overlay_Machine_Dimensional_Blue = Internal_Overlay_Machine_Dimensional_Blue; + private static final CustomIcon Internal_Overlay_Machine_Dimensional_Orange = new CustomIcon("TileEntities/adv_machine_dimensional_cover_orange"); + public static final CustomIcon Overlay_Machine_Dimensional_Orange = Internal_Overlay_Machine_Dimensional_Orange; + //Icons + private static final CustomIcon Internal_Overlay_MatterFab = new CustomIcon("TileEntities/adv_machine_matterfab"); + public static final CustomIcon Overlay_MatterFab = Internal_Overlay_MatterFab; + private static final CustomIcon Internal_Overlay_MatterFab_Active = new CustomIcon("TileEntities/adv_machine_matterfab_active"); + public static final CustomIcon Overlay_MatterFab_Active = Internal_Overlay_MatterFab_Active; + + private static final CustomIcon Internal_Overlay_MatterFab_Animated = new CustomIcon("TileEntities/adv_machine_matterfab_animated"); + public static final CustomIcon Overlay_MatterFab_Animated = Internal_Overlay_MatterFab_Animated; + private static final CustomIcon Internal_Overlay_MatterFab_Active_Animated = new CustomIcon("TileEntities/adv_machine_matterfab_active_animated"); + public static final CustomIcon Overlay_MatterFab_Active_Animated = Internal_Overlay_MatterFab_Active_Animated; + + private static final CustomIcon Internal_Overlay_Oil = new CustomIcon("TileEntities/adv_machine_oil"); + public static final CustomIcon Overlay_Oil = Internal_Overlay_Oil; + private static final CustomIcon Internal_Overlay_UU_Matter = new CustomIcon("TileEntities/adv_machine_uum"); + public static final CustomIcon Overlay_UU_Matter = Internal_Overlay_UU_Matter; + + // GT++ Tiered Hulls + public static final CustomIcon TEXTURE_CASING_TIERED_ULV = new CustomIcon("iconsets/TieredHulls/CASING_ULV"); + public static final CustomIcon TEXTURE_CASING_TIERED_LV = new CustomIcon("iconsets/TieredHulls/CASING_LV"); + public static final CustomIcon TEXTURE_CASING_TIERED_MV = new CustomIcon("iconsets/TieredHulls/CASING_MV"); + public static final CustomIcon TEXTURE_CASING_TIERED_HV = new CustomIcon("iconsets/TieredHulls/CASING_HV"); + public static final CustomIcon TEXTURE_CASING_TIERED_EV = new CustomIcon("iconsets/TieredHulls/CASING_EV"); + public static final CustomIcon TEXTURE_CASING_TIERED_IV = new CustomIcon("iconsets/TieredHulls/CASING_IV"); + public static final CustomIcon TEXTURE_CASING_TIERED_LuV = new CustomIcon("iconsets/TieredHulls/CASING_LuV"); + public static final CustomIcon TEXTURE_CASING_TIERED_ZPM = new CustomIcon("iconsets/TieredHulls/CASING_ZPM"); + public static final CustomIcon TEXTURE_CASING_TIERED_UV = new CustomIcon("iconsets/TieredHulls/CASING_UV"); + public static final CustomIcon TEXTURE_CASING_TIERED_MAX = new CustomIcon("iconsets/TieredHulls/CASING_MAX"); + + //Metroid related + public static final CustomIcon TEXTURE_METAL_PANEL_A = new CustomIcon("metro/TEXTURE_METAL_PANEL_A"); + public static final CustomIcon TEXTURE_METAL_PANEL_B = new CustomIcon("metro/TEXTURE_METAL_PANEL_B"); + public static final CustomIcon TEXTURE_METAL_PANEL_C = new CustomIcon("metro/TEXTURE_METAL_PANEL_C"); + public static final CustomIcon TEXTURE_METAL_PANEL_D = new CustomIcon("metro/TEXTURE_METAL_PANEL_D"); + public static final CustomIcon TEXTURE_METAL_PANEL_E = new CustomIcon("metro/TEXTURE_METAL_PANEL_E"); + public static final CustomIcon TEXTURE_METAL_PANEL_F = new CustomIcon("metro/TEXTURE_METAL_PANEL_F"); + public static final CustomIcon TEXTURE_METAL_PANEL_G = new CustomIcon("metro/TEXTURE_METAL_PANEL_G"); + public static final CustomIcon TEXTURE_METAL_PANEL_H = new CustomIcon("metro/TEXTURE_METAL_PANEL_H"); + public static final CustomIcon TEXTURE_METAL_PANEL_I = new CustomIcon("metro/TEXTURE_METAL_PANEL_I"); + + public static final CustomIcon TEXTURE_MAGIC_PANEL_A = new CustomIcon("metro/TEXTURE_MAGIC_A"); + + public static final CustomIcon TEXTURE_ORGANIC_PANEL_A = new CustomIcon("metro/TEXTURE_ORGANIC_PANEL_A"); + public static final CustomIcon TEXTURE_ORGANIC_PANEL_A_GLOWING = new CustomIcon("metro/TEXTURE_ORGANIC_PANEL_A_GLOWING"); + + public static final CustomIcon TEXTURE_STONE_BIRD_A = new CustomIcon("metro/TEXTURE_STONE_BIRD_A"); + public static final CustomIcon TEXTURE_STONE_BIRD_A_LEFT = new CustomIcon("metro/TEXTURE_STONE_BIRD_A_LEFT"); + public static final CustomIcon TEXTURE_STONE_BIRD_A_RIGHT = new CustomIcon("metro/TEXTURE_STONE_BIRD_A_RIGHT"); + public static final CustomIcon TEXTURE_STONE_RED_A = new CustomIcon("metro/TEXTURE_STONE_RED_A"); + public static final CustomIcon TEXTURE_STONE_RED_B = new CustomIcon("metro/TEXTURE_STONE_RED_B"); + public static final CustomIcon TEXTURE_STONE_BLUE_A = new CustomIcon("metro/TEXTURE_STONE_BLUE_A"); + public static final CustomIcon TEXTURE_STONE_GREEN_A = new CustomIcon("metro/TEXTURE_STONE_GREEN_A"); + public static final CustomIcon TEXTURE_STONE_TABLET_A = new CustomIcon("metro/TEXTURE_STONE_TABLET_A"); + public static final CustomIcon TEXTURE_STONE_TABLET_B = new CustomIcon("metro/TEXTURE_STONE_TABLET_B"); + + public static final CustomIcon TEXTURE_TECH_A = new CustomIcon("metro/TEXTURE_TECH_A"); + public static final CustomIcon TEXTURE_TECH_B = new CustomIcon("metro/TEXTURE_TECH_B"); + public static final CustomIcon TEXTURE_TECH_C = new CustomIcon("metro/TEXTURE_TECH_C"); + + public static final CustomIcon TEXTURE_TECH_PANEL_A = new CustomIcon("metro/TEXTURE_TECH_PANEL_A"); + public static final CustomIcon TEXTURE_TECH_PANEL_B = new CustomIcon("metro/TEXTURE_TECH_PANEL_B"); + public static final CustomIcon TEXTURE_TECH_PANEL_C = new CustomIcon("metro/TEXTURE_TECH_PANEL_C"); + public static final CustomIcon TEXTURE_TECH_PANEL_D = new CustomIcon("metro/TEXTURE_TECH_PANEL_D"); + + public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE = new CustomIcon("TileEntities/DecayablesChest_bottom"); + public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE_ALT = new CustomIcon("TileEntities/DecayablesChest_top"); + + // LFTR Single blocks + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_FRONT = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_FRONT"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_FRONT_ACTIVE = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_FRONT_ACTIVE"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_SIDE = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_SIDE"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_SIDE_ACTIVE = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_SIDE_ACTIVE"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_TOP = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_TOP"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE = new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_TOP_ACTIVE"); + + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_FRONT = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_FRONT"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_FRONT_ACTIVE = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_SIDE = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_SIDE"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_SIDE_ACTIVE = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_TOP = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_TOP"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE = new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_TOP_ACTIVE"); + + + //Overlay Arrays + public static ITexture[] OVERLAYS_ENERGY_OUT_BUFFER = new ITexture[]{ + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, + new short[]{220, 220, 220, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, + new short[]{220, 220, 220, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, + new short[]{255, 100, 0, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, + new short[]{255, 255, 30, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, + new short[]{128, 128, 128, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, + new short[]{240, 240, 245, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, + new short[]{240, 240, 245, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, + new short[]{240, 240, 245, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, + new short[]{240, 240, 245, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, + new short[]{240, 240, 245, 0})}; + + public static ITexture[] OVERLAYS_ENERGY_OUT_MULTI_BUFFER = new ITexture[]{ + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, + new short[]{220, 220, 220, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, + new short[]{220, 220, 220, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, + new short[]{255, 100, 0, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, + new short[]{255, 255, 30, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, + new short[]{128, 128, 128, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, + new short[]{240, 240, 245, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, + new short[]{240, 240, 245, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, + new short[]{240, 240, 245, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, + new short[]{240, 240, 245, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, + new short[]{240, 240, 245, 0})}; + + public static ITexture[] OVERLAYS_CABINET_FRONT = new ITexture[]{ + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_1, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_2, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_3, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_4, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_5, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_6, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_7, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_8, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_9, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_10, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_11, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_12, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_13, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_14, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_15, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_16, + new short[]{255, 255, 255, 0}),}; + + public static ITexture[] OVERLAYS_COMPARTMENT_FRONT = new ITexture[]{ + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_1, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_2, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_3, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_4, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_5, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_6, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_7, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_8, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_9, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_10, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_11, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_12, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_13, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_14, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_15, + new short[]{255, 255, 255, 0}), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_16, + new short[]{255, 255, 255, 0}),}; + + public static IIconContainer[] CONNECTED_FUSION_HULLS = new IIconContainer[]{ + TEXTURE_CASING_FUSION_COIL_II_1, TEXTURE_CASING_FUSION_COIL_II_2, TEXTURE_CASING_FUSION_COIL_II_3, + TEXTURE_CASING_FUSION_COIL_II_4, TEXTURE_CASING_FUSION_COIL_II_5, TEXTURE_CASING_FUSION_COIL_II_6, + TEXTURE_CASING_FUSION_COIL_II_7, TEXTURE_CASING_FUSION_COIL_II_8, TEXTURE_CASING_FUSION_COIL_II_9, + TEXTURE_CASING_FUSION_COIL_II_10, TEXTURE_CASING_FUSION_COIL_II_11, TEXTURE_CASING_FUSION_COIL_II_12}; + + public static IIconContainer[] TIERED_MACHINE_HULLS = new IIconContainer[]{ + TEXTURE_CASING_TIERED_ULV, + TEXTURE_CASING_TIERED_LV, + TEXTURE_CASING_TIERED_MV, + TEXTURE_CASING_TIERED_HV, + TEXTURE_CASING_TIERED_EV, + TEXTURE_CASING_TIERED_IV, + TEXTURE_CASING_TIERED_LuV, + TEXTURE_CASING_TIERED_ZPM, + TEXTURE_CASING_TIERED_UV, + TEXTURE_CASING_TIERED_MAX}; + + + public static Object Casing_Material_Turbine; + + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java new file mode 100644 index 0000000000..cc5cf3d55e --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java @@ -0,0 +1,32 @@ +package gtPlusPlus.xmod.gregtech.common.blocks.textures; + +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; + +public class TexturesGtCutomCovers { + + public static final CustomIcon[] TEXTURE_ZTONES_AGON = new CustomIcon[16]; + public static final CustomIcon[] TEXTURE_ZTONES_ISZM = new CustomIcon[16]; + public static final CustomIcon[] TEXTURE_ZTONES_KORP = new CustomIcon[16]; + public static final CustomIcon[] TEXTURE_ZTONES_JELT = new CustomIcon[16]; + public static final CustomIcon[] TEXTURE_ZTONES_BITT = new CustomIcon[16]; + + public static void init() { + generateZTones(); + } + + private static void generateZTones() { + // ZTONES + String[] aZtoneCoverTextureNames = new String[] { "agon", "iszm", "korp", "jelt", "bitt" }; + int aArrayIndex = 0; + CustomIcon[][] aArrays = new CustomIcon[][] { TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP, + TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT }; + + for (CustomIcon[] t : aArrays) { + for (int s = 0; s < 16; s++) { + t[s] = new CustomIcon("Ztones", "sets/" + aZtoneCoverTextureNames[aArrayIndex] + "/"+aZtoneCoverTextureNames[aArrayIndex]+"_ (" + s + ")"); + } + aArrayIndex++; + } + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java new file mode 100644 index 0000000000..ee104eaca3 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java @@ -0,0 +1,61 @@ +package gtPlusPlus.xmod.gregtech.common.blocks.textures; + +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.IIconContainer; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; + +public final class TexturesGtTools { + + public final static CustomIcon SKOOKUM_CHOOCHER = new CustomIcon("iconsets/SKOOKUMCHOOCHER"); + public final static CustomIcon ANGLE_GRINDER = new CustomIcon("iconsets/ANGLE_GRINDER"); + public final static CustomIcon ELECTRIC_SNIPS = new CustomIcon("iconsets/ELECTRIC_SNIPS"); + public final static CustomIcon ELECTRIC_LIGHTER = new CustomIcon("iconsets/ELECTRIC_LIGHTER"); + public final static CustomIcon ELECTRIC_BUTCHER_KNIFE = new CustomIcon("iconsets/ELECTRIC_BUTCHER_KNIFE"); + + + + + + + + + public final static class CustomIcon implements IIconContainer, Runnable { + protected IIcon mIcon, mOverlay; + protected final String mIconName; + + public CustomIcon(final String aIconName) { + this.mIconName = aIconName; + Logger.INFO("Constructing a Custom Texture. " + this.mIconName); + GregTech_API.sGTItemIconload.add(this); + } + + @Override + public IIcon getIcon() { + return this.mIcon; + } + + @Override + public IIcon getOverlayIcon() { + return this.mOverlay; + } + + @Override + public void run() { + this.mIcon = GregTech_API.sItemIcons.registerIcon(CORE.MODID + ":" + this.mIconName); + //Utils.LOG_INFO("Registering a Custom Texture. "+mIcon.g); + this.mOverlay = GregTech_API.sItemIcons.registerIcon(CORE.MODID + ":" + this.mIconName + "_OVERLAY"); + } + + @Override + public ResourceLocation getTextureFile() { + return TextureMap.locationItemsTexture; + } + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java new file mode 100644 index 0000000000..c3d6a655c3 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java @@ -0,0 +1,318 @@ +/* +package gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine; +import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks4; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; + +public class LargeTurbineTextureHandler { + + */ +/** + * LP Turbines + *//* + + private static CustomIcon aTex1_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_1"); + private static CustomIcon aTex1 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_1"); + private static CustomIcon aTex2_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_2"); + private static CustomIcon aTex2 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_2"); + private static CustomIcon aTex3_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_3"); + private static CustomIcon aTex3 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_3"); + private static CustomIcon aTex4_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_4"); + private static CustomIcon aTex4 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_4"); + private static CustomIcon aTex5_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_5"); + private static CustomIcon aTex5 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_5"); + private static CustomIcon aTex6_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_6"); + private static CustomIcon aTex6 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_6"); + private static CustomIcon aTex7_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_7"); + private static CustomIcon aTex7 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_7"); + private static CustomIcon aTex8_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_8"); + private static CustomIcon aTex8 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_8"); + private static CustomIcon aTex9_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_9"); + private static CustomIcon aTex9 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_9"); + + private static CustomIcon frontFace_0 = (aTex1); + private static CustomIcon frontFaceActive_0 = (aTex1_Active); + private static CustomIcon frontFace_1 = (aTex2); + private static CustomIcon frontFaceActive_1 = (aTex2_Active); + private static CustomIcon frontFace_2 = (aTex3); + private static CustomIcon frontFaceActive_2 = (aTex3_Active); + private static CustomIcon frontFace_3 = (aTex4); + private static CustomIcon frontFaceActive_3 = (aTex4_Active); + public static CustomIcon frontFace_4 = (aTex5); + public static CustomIcon frontFaceActive_4 = (aTex5_Active); + private static CustomIcon frontFace_5 = (aTex6); + private static CustomIcon frontFaceActive_5 = (aTex6_Active); + private static CustomIcon frontFace_6 = (aTex7); + private static CustomIcon frontFaceActive_6 = (aTex7_Active); + private static CustomIcon frontFace_7 = (aTex8); + private static CustomIcon frontFaceActive_7 = (aTex8_Active); + private static CustomIcon frontFace_8 = (aTex9); + private static CustomIcon frontFaceActive_8 = (aTex9_Active); + + CustomIcon[] OVERLAY_LP_TURBINE = new CustomIcon[]{ + frontFace_0, + frontFace_1, + frontFace_2, + frontFace_3, + frontFace_4, + frontFace_5, + frontFace_6, + frontFace_7, + frontFace_8 + }; + + CustomIcon[] OVERLAY_LP_TURBINE_ACTIVE = new CustomIcon[]{ + frontFaceActive_0, + frontFaceActive_1, + frontFaceActive_2, + frontFaceActive_3, + frontFaceActive_4, + frontFaceActive_5, + frontFaceActive_6, + frontFaceActive_7, + frontFaceActive_8 + }; + + + */ +/** + * HP Turbines + *//* + + private static CustomIcon aTexHP1_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_1"); + private static CustomIcon aTexHP1 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_1"); + private static CustomIcon aTexHP2_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_2"); + private static CustomIcon aTexHP2 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_2"); + private static CustomIcon aTexHP3_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_3"); + private static CustomIcon aTexHP3 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_3"); + private static CustomIcon aTexHP4_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_4"); + private static CustomIcon aTexHP4 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_4"); + private static CustomIcon aTexHP5_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_5"); + private static CustomIcon aTexHP5 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_5"); + private static CustomIcon aTexHP6_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_6"); + private static CustomIcon aTexHP6 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_6"); + private static CustomIcon aTexHP7_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_7"); + private static CustomIcon aTexHP7 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_7"); + private static CustomIcon aTexHP8_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_8"); + private static CustomIcon aTexHP8 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_8"); + private static CustomIcon aTexHP9_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_9"); + private static CustomIcon aTexHP9 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_9"); + + private static CustomIcon frontFaceHP_0 = (aTexHP1); + private static CustomIcon frontFaceHPActive_0 = (aTexHP1_Active); + private static CustomIcon frontFaceHP_1 = (aTexHP2); + private static CustomIcon frontFaceHPActive_1 = (aTexHP2_Active); + private static CustomIcon frontFaceHP_2 = (aTexHP3); + private static CustomIcon frontFaceHPActive_2 = (aTexHP3_Active); + private static CustomIcon frontFaceHP_3 = (aTexHP4); + private static CustomIcon frontFaceHPActive_3 = (aTexHP4_Active); + public static CustomIcon frontFaceHP_4 = (aTexHP5); + public static CustomIcon frontFaceHPActive_4 = (aTexHP5_Active); + private static CustomIcon frontFaceHP_5 = (aTexHP6); + private static CustomIcon frontFaceHPActive_5 = (aTexHP6_Active); + private static CustomIcon frontFaceHP_6 = (aTexHP7); + private static CustomIcon frontFaceHPActive_6 = (aTexHP7_Active); + private static CustomIcon frontFaceHP_7 = (aTexHP8); + private static CustomIcon frontFaceHPActive_7 = (aTexHP8_Active); + private static CustomIcon frontFaceHP_8 = (aTexHP9); + private static CustomIcon frontFaceHPActive_8 = (aTexHP9_Active); + + CustomIcon[] OVERLAY_HP_TURBINE = new CustomIcon[]{ + frontFaceHP_0, + frontFaceHP_1, + frontFaceHP_2, + frontFaceHP_3, + frontFaceHP_4, + frontFaceHP_5, + frontFaceHP_6, + frontFaceHP_7, + frontFaceHP_8 + }; + + CustomIcon[] OVERLAY_HP_TURBINE_ACTIVE = new CustomIcon[]{ + frontFaceHPActive_0, + frontFaceHPActive_1, + frontFaceHPActive_2, + frontFaceHPActive_3, + frontFaceHPActive_4, + frontFaceHPActive_5, + frontFaceHPActive_6, + frontFaceHPActive_7, + frontFaceHPActive_8 + }; + + + + public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks4 thisBlock) { + final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); + + //7 - shaft + //8 LP + //9 HP + + CustomIcon[] mGetCurrentTextureSet = null, mGetCurrentTextureSet_ACTIVE = null; + + + if (tMeta <= 6 || tMeta >= 10) { + return GregtechMetaCasingBlocks4.getStaticIcon((byte) aSide, (byte) tMeta); + } + else { + if (tMeta == 8) { + mGetCurrentTextureSet = OVERLAY_LP_TURBINE; + mGetCurrentTextureSet_ACTIVE = OVERLAY_LP_TURBINE_ACTIVE; + } + else if (tMeta == 9) { + mGetCurrentTextureSet = OVERLAY_HP_TURBINE; + mGetCurrentTextureSet_ACTIVE = OVERLAY_HP_TURBINE_ACTIVE; + } + if (mGetCurrentTextureSet == null || mGetCurrentTextureSet_ACTIVE == null) { + return GregtechMetaCasingBlocks4.getStaticIcon((byte) aSide, (byte) tMeta); + } + + + + if ((aSide == 2) || (aSide == 3)) { + TileEntity tTileEntity; + IMetaTileEntity tMetaTileEntity; + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[0].getIcon(); + } + return mGetCurrentTextureSet[0].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[3].getIcon(); + } + return mGetCurrentTextureSet[3].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 3 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[6].getIcon(); + } + return mGetCurrentTextureSet[6].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[1].getIcon(); + } + return mGetCurrentTextureSet[1].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[7].getIcon(); + } + return mGetCurrentTextureSet[7].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[8].getIcon(); + } + return mGetCurrentTextureSet[8].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[5].getIcon(); + } + return mGetCurrentTextureSet[5].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord + (aSide == 2 ? 1 : -1), yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[2].getIcon(); + } + return mGetCurrentTextureSet[2].getIcon(); + } + } else if ((aSide == 4) || (aSide == 5)) { + TileEntity tTileEntity; + Object tMetaTileEntity; + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[0].getIcon(); + } + return mGetCurrentTextureSet[0].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[3].getIcon(); + } + return mGetCurrentTextureSet[3].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 4 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[6].getIcon(); + } + return mGetCurrentTextureSet[6].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[1].getIcon(); + } + return mGetCurrentTextureSet[1].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[7].getIcon(); + } + return mGetCurrentTextureSet[7].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord + 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[8].getIcon(); + } + return mGetCurrentTextureSet[8].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[5].getIcon(); + } + return mGetCurrentTextureSet[5].getIcon(); + } + if ((null != (tTileEntity = aWorld.getTileEntity(xCoord, yCoord - 1, zCoord + (aSide == 5 ? 1 : -1)))) && ((tTileEntity instanceof IGregTechTileEntity)) && (((IGregTechTileEntity) tTileEntity).getFrontFacing() == aSide) && (null != (tMetaTileEntity = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity())) && ((tMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine))) { + if (isUsingAnimatedTexture(tTileEntity)) { + return mGetCurrentTextureSet_ACTIVE[2].getIcon(); + } + return mGetCurrentTextureSet[2].getIcon(); + } + } + } + return GregtechMetaCasingBlocks4.getStaticIcon((byte) aSide, (byte) tMeta); + } + + public boolean isUsingAnimatedTexture(TileEntity tTileEntity) { + boolean aVal = true; + */ +/*IGregTechTileEntity aTile; + if (tTileEntity instanceof IGregTechTileEntity) { + aTile = (IGregTechTileEntity) tTileEntity; + if (aTile != null) { + final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity(); + if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) { + aVal = ((GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity).isControllerActive(); + Logger.INFO("Returning "+aVal+" as Rotor Assembly controller status"); + } + } + } *//* + + return aVal; + } + + public GT_MetaTileEntity_Hatch_Turbine isTurbineHatch(final IGregTechTileEntity aTileEntity) { + if (aTileEntity != null) { + final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) { + return (GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity; + } + } + return null; + } + +} +*/ -- cgit From 41d303266edf21f9f0daf753c22bc82e3033869d Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 19 Dec 2021 14:10:52 +0000 Subject: Added Logger to check free Meta IDs in dev. Freed up some indexes in TAE. Finished work on Chisel single blocks. Finished work on Chisel multiblock. Finished work on Rock Breaker multiblock. --- src/main/java/gtPlusPlus/GTplusplus.java | 16 + .../xmod/gregtech/api/enums/GregtechItemList.java | 1 + .../common/blocks/GregtechMetaCasingBlocks3.java | 4 + .../common/blocks/GregtechMetaCasingBlocks5.java | 6 +- .../basic/GregtechMetaTileEntity_AutoChisel.java | 128 +++++- .../GregtechMetaTileEntity_IndustrialChisel.java | 437 ++++++++++++++++++++- ...egtechMetaTileEntity_IndustrialRockBreaker.java | 166 ++++---- .../gregtech/GregtechIndustrialChisel.java | 21 +- .../gregtech/GregtechIndustrialRockBreaker.java | 2 +- 9 files changed, 704 insertions(+), 77 deletions(-) (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common/blocks') diff --git a/src/main/java/gtPlusPlus/GTplusplus.java b/src/main/java/gtPlusPlus/GTplusplus.java index 9787a38504..1513a0999c 100644 --- a/src/main/java/gtPlusPlus/GTplusplus.java +++ b/src/main/java/gtPlusPlus/GTplusplus.java @@ -228,6 +228,22 @@ public class GTplusplus implements ActionListener { Logger.INFO( "Finally, we are finished. Have some cripsy bacon as a reward." ); + + // Log free GT++ Meta IDs + if (CORE.DEVENV) { + // 750 - 999 are reserved for Alkalus. + for (int i=750; i<1000;i++) { + if (gregtech.api.GregTech_API.METATILEENTITIES[i] == null) { + Logger.INFO("MetaID "+i+" is free."); + } + } + // 30000 - 31999 are reserved for Alkalus. + for (int i=30000; i<32000;i++) { + if (gregtech.api.GregTech_API.METATILEENTITIES[i] == null) { + Logger.INFO("MetaID "+i+" is free."); + } + } + } } @EventHandler diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 71d6ae1d68..d3caf99af6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -415,6 +415,7 @@ public enum GregtechItemList implements GregtechItemContainer { // Industrial Chisel Controller_IndustrialAutoChisel, + Casing_IndustrialAutoChisel, // Custom Machine Casings Casing_Machine_Custom_1, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java index 8cd6dd0ca8..76bd57b3fa 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java @@ -46,6 +46,10 @@ extends GregtechMetaCasingBlocksAbstract { public GregtechMetaCasingBlocks3() { super(GregtechMetaCasingItemBlocks3.class, "gtplusplus.blockcasings.3", GT_Material_Casings.INSTANCE); for (byte i = 0; i < 16; i = (byte) (i + 1)) { + // Free up Redox casing in TAE + if (i >= 4 && i <= 8) { + continue; + } TAE.registerTexture(2, i, new GT_CopiedBlockTexture(this, 6, i)); } GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Aquatic Casing"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java index 61c71ba552..4f84a3daca 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java @@ -31,7 +31,8 @@ extends GregtechMetaCasingBlocksAbstract { TAE.registerTexture(0, 3, new GT_CopiedBlockTexture(this, 6, 3)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Sparge Tower Exterior Casing"); // Sparge Tower Casing TAE.registerTexture(0, 4, new GT_CopiedBlockTexture(this, 6, 4)); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Sturdy Printer Casing"); // Unused + TAE.registerTexture(1, 10, new GT_CopiedBlockTexture(this, 6, 5)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); // Unused @@ -48,6 +49,7 @@ extends GregtechMetaCasingBlocksAbstract { GregtechItemList.Casing_IsaMill_Gearbox.set(new ItemStack(this, 1, 2)); GregtechItemList.Casing_ElementalDuplicator.set(new ItemStack(this, 1, 3)); GregtechItemList.Casing_Sparge_Tower_Exterior.set(new ItemStack(this, 1, 4)); + GregtechItemList.Casing_IndustrialAutoChisel.set(new ItemStack(this, 1, 5)); } @Override @@ -69,6 +71,8 @@ extends GregtechMetaCasingBlocksAbstract { return TexturesGtBlock.TEXTURE_TECH_PANEL_D.getIcon(); case 4: return TexturesGtBlock.Casing_Machine_Metal_Sheet_H.getIcon(); + case 5: + return TexturesGtBlock.Casing_Machine_Metal_Sheet_I.getIcon(); } } return Textures.BlockIcons.RENDERING_ERROR.getIcon(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java index 39545daec1..ea99f8d52a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java @@ -1,5 +1,129 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; -public class GregtechMetaTileEntity_AutoChisel { +import java.util.List; -} +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.item.ItemStack; +import team.chisel.carving.Carving; + +public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMachine { + + public GregtechMetaTileEntity_AutoChisel(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, "Chisels things, Gregtech style", 1, 1, "Compressor.png", "", + new ITexture[]{ + new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), + new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB), + new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE), + new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab), + new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), + new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB) + }); + } + + public GregtechMetaTileEntity_AutoChisel(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_AutoChisel(this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + } + + @Override + public String[] getDescription() { + String[] A = new String[]{ + this.mDescription, + "What you want to chisel goes in slot 1", + "What you want to get goes in the special slot (bottom right)", + "If special slot is empty, first chisel result is used" + }; + return A; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeList() { + return null; + } + + @Override + protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && hasChiselResults(aStack); + } + + // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target + private static boolean canBeMadeFrom(ItemStack from, ItemStack to) { + List results = getItemsForChiseling(from); + for (ItemStack s : results) { + if (s.getItem() == to.getItem() && s.getItemDamage() == to.getItemDamage()) { + return true; + } + } + return false; + } + + // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target + private static boolean hasChiselResults(ItemStack from) { + List results = getItemsForChiseling(from); + return results.size() > 0; + } + + private static List getItemsForChiseling(ItemStack aStack){ + return Carving.chisel.getItemsForChiseling(aStack); + } + + @Override + public int checkRecipe() { + ItemStack tOutput = null; + ItemStack aInput = getInputAt(0); + ItemStack aTarget = getSpecialSlot(); + if (aInput != null && hasChiselResults(aInput) && aInput.stackSize > 0) { + Logger.INFO("Has Valid Input."); + if (aTarget != null && canBeMadeFrom(aInput, aTarget)) { + tOutput = aTarget; + Logger.INFO("Has Valid Target."); + } + else { + tOutput = getItemsForChiseling(aInput).get(0); + Logger.INFO("Using target(0)"); + } + if (tOutput != null) { + Logger.INFO("Has Valid Output. "+tOutput.getDisplayName()); + // We can chisel this + if (canOutput(tOutput)) { + Logger.INFO("Can Output"); + getInputAt(0).stackSize -= 1; + Logger.INFO("Consuming 1 input"); + calculateOverclockedNess(16, 20); + Logger.INFO("Did Overclock"); + //In case recipe is too OP for that machine + if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) { + Logger.INFO("Brrrrr"); + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + } + Logger.INFO("Setting Output"); + this.mOutputItems[0] = tOutput; + Logger.INFO("Recipe good."); + return FOUND_AND_SUCCESSFULLY_USED_RECIPE; + } + else { + Logger.INFO("Cannot Output"); + mOutputBlocked++; + return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + } + } + } + Logger.INFO("Recipe bad."); + return DID_NOT_FIND_RECIPE; + } + +} \ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java index 871b863b22..51775791f4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java @@ -1,5 +1,438 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; -public class GregtechMetaTileEntity_IndustrialChisel { +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; -} +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.ArrayUtils; + +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import team.chisel.carving.Carving; + +public class GregtechMetaTileEntity_IndustrialChisel extends GregtechMeta_MultiBlockBase { + + private int mCasing; + private IStructureDefinition STRUCTURE_DEFINITION = null; + + public GregtechMetaTileEntity_IndustrialChisel(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMetaTileEntity_IndustrialChisel(String aName) { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_IndustrialChisel(this.mName); + } + + @Override + public String getMachineType() { + return "Chisel"; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Factory Grade Auto Chisel") + .addInfo("Target block goes in GUI slot") + .addInfo("If no target provided, firdt chisel result is used") + .addInfo("Speed: 200% | Eu Usage: 75% | Parallel: Tier x 16") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfo("Sturdy Printer Casing", 10) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addMufflerHatch("Any casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } + + @Override + public IStructureDefinition getStructureDefinition() { + if (STRUCTURE_DEFINITION == null) { + STRUCTURE_DEFINITION = StructureDefinition.builder() + .addShape(mName, transpose(new String[][]{ + {"CCC", "CCC", "CCC"}, + {"C~C", "C-C", "CCC"}, + {"CCC", "CCC", "CCC"}, + })) + .addElement( + 'C', + ofChain( + ofHatchAdder( + GregtechMetaTileEntity_IndustrialChisel::addAdvChiselList, 90, 1 + ), + onElementPass( + x -> ++x.mCasing, + ofBlock( + ModBlocks.blockCasings5Misc, 5 + ) + ) + ) + ) + .build(); + } + return STRUCTURE_DEFINITION; + } + + public final boolean addAdvChiselList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + } + return false; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(mName, stackSize, hintsOnly, 1, 1, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mCasing = 0; + return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch(); + } + + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(90), new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(90)}; + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + + @Override + public String getCustomGUIResourceName() { + return "ImplosionCompressor"; + } + + @Override + public boolean requiresVanillaGtGUI() { + return true; + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return null; + } + + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target + private static boolean canBeMadeFrom(ItemStack from, ItemStack to) { + List results = getItemsForChiseling(from); + for (ItemStack s : results) { + if (s.getItem() == to.getItem() && s.getItemDamage() == to.getItemDamage()) { + return true; + } + } + return false; + } + + // lets make sure the user isn't trying to make something from a block that doesn't have this as a valid target + private static boolean hasChiselResults(ItemStack from) { + List results = getItemsForChiseling(from); + return results.size() > 0; + } + + private static List getItemsForChiseling(ItemStack aStack){ + return Carving.chisel.getItemsForChiseling(aStack); + } + + private GTPP_Recipe generateChiselRecipe(ItemStack aInput, ItemStack aTarget) { + if (aInput != null && hasChiselResults(aInput) && aInput.stackSize > 0) { + ItemStack tOutput = null; + if (aTarget != null && canBeMadeFrom(aInput, aTarget)) { + tOutput = aTarget; + } + else { + tOutput = getItemsForChiseling(aInput).get(0); + } + if (tOutput != null) { + // We can chisel this + log("Generated Chisel recipe good."); + GTPP_Recipe aRecipe = new GTPP_Recipe( + false, + new ItemStack[] {ItemUtils.getSimpleStack(aInput, 1)}, + new ItemStack[] {ItemUtils.getSimpleStack(tOutput, 1)}, + null, + new int[] {10000}, + new FluidStack[] {}, + new FluidStack[] {}, + 20, + 16, + 0); + return aRecipe; + } + } + Logger.INFO("Recipe bad."); + return null; + } + + public boolean checkRecipe(final ItemStack aStack) { + ArrayList aItems = this.getStoredInputs(); + if (!aItems.isEmpty()) { + + GT_Recipe tRecipe = generateChiselRecipe(aItems.get(0), this.getGUIItemStack()); + + if (tRecipe == null) { + log("BAD RETURN - 0"); + return false; + } + + // Based on the Processing Array. A bit overkill, but very flexible. + ItemStack[] aItemInputs = aItems.toArray(new ItemStack[aItems.size()]); + FluidStack[] aFluidInputs = new FluidStack[] {}; + + // Reset outputs and progress stats + this.mEUt = 0; + this.mMaxProgresstime = 0; + this.mOutputItems = new ItemStack[]{}; + this.mOutputFluids = new FluidStack[]{}; + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + long tEnergy = getMaxInputEnergy(); + log("Running checkRecipeGeneric(0)"); + + log("Running checkRecipeGeneric(1)"); + // Remember last recipe - an optimization for findRecipe() + this.mLastRecipe = tRecipe; + + int aMaxParallelRecipes = getMaxParallelRecipes(); + int aEUPercent = getEuDiscountForParallelism(); + int aSpeedBonusPercent = 200; + + aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { + log("BAD RETURN - 2"); + return false; + } + + // EU discount + float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; + float tTotalEUt = 0.0f; + + int parallelRecipes = 0; + + log("parallelRecipes: "+parallelRecipes); + log("aMaxParallelRecipes: "+aMaxParallelRecipes); + log("tTotalEUt: "+tTotalEUt); + log("tVoltage: "+tVoltage); + log("tRecipeEUt: "+tRecipeEUt); + // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { + if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { + log("Broke at "+parallelRecipes+"."); + break; + } + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); + tTotalEUt += tRecipeEUt; + } + + if (parallelRecipes == 0) { + log("BAD RETURN - 3"); + return false; + } + + // -- Try not to fail after this point - inputs have already been consumed! -- + log("parallelRecipes: "+parallelRecipes); + log("aMaxParallelRecipes: "+aMaxParallelRecipes); + log("tTotalEUt: "+tTotalEUt); + log("tVoltage: "+tVoltage); + log("tRecipeEUt: "+tRecipeEUt); + + + // Convert speed bonus to duration multiplier + // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. + aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); + float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent); + this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor); + + this.mEUt = (int)Math.ceil(tTotalEUt); + + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + // Overclock + if (this.mEUt <= 16) { + this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1)); + } else { + 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); + + // Collect fluid outputs + FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length]; + for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) { + if (tRecipe.getFluidOutput(h) != null) { + tOutputFluids[h] = tRecipe.getFluidOutput(h).copy(); + tOutputFluids[h].amount *= parallelRecipes; + } + } + + // Collect output item types + ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length]; + for (int h = 0; h < tRecipe.mOutputs.length; h++) { + if (tRecipe.getOutput(h) != null) { + tOutputItems[h] = tRecipe.getOutput(h).copy(); + tOutputItems[h].stackSize = 0; + } + } + + // Set output item stack sizes (taking output chance into account) + for (int f = 0; f < tOutputItems.length; f++) { + if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) { + for (int g = 0; g < parallelRecipes; g++) { + if (getBaseMetaTileEntity().getRandomNumber(10000) <= tRecipe.getOutputChance(f)) + tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize; + } + } + } + + tOutputItems = removeNulls(tOutputItems); + + // Sanitize item stack size, splitting any stacks greater than max stack size + List splitStacks = new ArrayList(); + for (ItemStack tItem : tOutputItems) { + while (tItem.getMaxStackSize() < tItem.stackSize) { + ItemStack tmp = tItem.copy(); + tmp.stackSize = tmp.getMaxStackSize(); + tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize(); + splitStacks.add(tmp); + } + } + + if (splitStacks.size() > 0) { + ItemStack[] tmp = new ItemStack[splitStacks.size()]; + tmp = splitStacks.toArray(tmp); + tOutputItems = ArrayUtils.addAll(tOutputItems, tmp); + } + + // Strip empty stacks + List tSList = new ArrayList(); + for (ItemStack tS : tOutputItems) { + if (tS.stackSize > 0) tSList.add(tS); + } + tOutputItems = tSList.toArray(new ItemStack[tSList.size()]); + + // Commit outputs + this.mOutputItems = tOutputItems; + this.mOutputFluids = tOutputFluids; + updateSlots(); + + // Play sounds (GT++ addition - GT multiblocks play no sounds) + startProcess(); + + log("GOOD RETURN - 1"); + return true; + } + + return false; + } + + @Override + public int getMaxParallelRecipes() { + return (16 * GT_Utility.getTier(this.getMaxInputVoltage())); + } + + @Override + public int getEuDiscountForParallelism() { + return 75; + } + + private static String sChiselSound = null; + + private static final String getChiselSound() { + if (sChiselSound == null) { + sChiselSound = Carving.chisel.getVariationSound(Blocks.stone, 0); + } + return sChiselSound; + } + + @Override + public String getSound() { + return getChiselSound(); + } + + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + public int getPollutionPerSecond(ItemStack aStack) { + return CORE.ConfigSwitches.pollutionPerSecondMultiAdvImplosion; + } + + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + +} \ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java index e681069078..885aa05716 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java @@ -4,10 +4,13 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.enums.GT_Values.E; +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import org.apache.commons.lang3.ArrayUtils; @@ -35,10 +38,12 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map_Microwave; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -50,7 +55,6 @@ import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_IndustrialRockBreaker extends GregtechMeta_MultiBlockBase { - private static Item circuit; private int mCasing; private IStructureDefinition STRUCTURE_DEFINITION = null; @@ -88,7 +92,7 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends GregtechMeta_M .addSeparator() .beginStructureBlock(3, 4, 3, true) .addController("Bottom Center") - .addCasingInfo("Thermal Processing Casing", 10) + .addCasingInfo("Thermal Processing Casing", 9) .addCasingInfo("Thermal Containment Casing", 16) .addInputBus("Any Casing", 1) .addInputHatch("Any Casing", 1) @@ -143,7 +147,11 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends GregtechMeta_M @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mCasing = 0; - return checkPiece(mName, 1, 3, 0) && mCasing >= 10 && mEnergyHatches.size() == 1 && checkHatch(); + boolean aCheckPiece = checkPiece(mName, 1, 3, 0); + boolean aCasingCount = mCasing >= 9; + boolean aCheckHatch = checkHatch(); + log(""+aCheckPiece+", "+aCasingCount+", "+aCheckHatch); + return aCheckPiece && aCasingCount && aCheckHatch; } public final boolean addRockBreakerList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { @@ -196,10 +204,31 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends GregtechMeta_M public String getCustomGUIResourceName() { return "ElectricBlastFurnace"; } + + private static final GT_Recipe_Map sFakeRecipeMap = new GT_Recipe_Map(new HashSet<>(0), "gt.recipe.fakerockbreaker", "Rock Breaker", "smelting", RES_PATH_GUI + "basicmachines/E_Furnace", 1, 1, 0, 0, 1, E, 1, E, true, false); + private static void generateRecipeMap() { + if (sRecipe_Cobblestone == null || sRecipe_SmoothStone == null || sRecipe_Redstone == null) { + generateRecipes(); + } + FluidStack[] aInputFluids = new FluidStack[] {FluidUtils.getWater(1000), FluidUtils.getLava(1000)}; + GT_Recipe aTemp = sRecipe_Cobblestone.copy(); + aTemp.mFluidInputs = aInputFluids; + sFakeRecipeMap.add(aTemp); + aTemp = sRecipe_SmoothStone.copy(); + aTemp.mFluidInputs = aInputFluids; + sFakeRecipeMap.add(aTemp); + aTemp = sRecipe_Redstone.copy(); + aTemp.mFluidInputs = aInputFluids; + sFakeRecipeMap.add(aTemp); + } + @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe_Map.sRockBreakerFakeRecipes; + if (sFakeRecipeMap.mRecipeList.isEmpty()) { + generateRecipeMap(); + } + return sFakeRecipeMap; } @Override @@ -212,58 +241,52 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends GregtechMeta_M private static GT_Recipe sRecipe_Redstone; private static final void generateRecipes() { - if (sRecipe_Cobblestone == null) { - sRecipe_Cobblestone = new GTPP_Recipe( - false, - new ItemStack[] { - CI.getNumberedCircuit(1) - }, - new ItemStack[] { - ItemUtils.getSimpleStack(Blocks.cobblestone) - }, - null, - new int[] {10000}, - null, - null, - 16, - 32, - 0); - } - if (sRecipe_SmoothStone == null) { - sRecipe_SmoothStone = new GTPP_Recipe( - false, - new ItemStack[] { - CI.getNumberedCircuit(2) - }, - new ItemStack[] { - ItemUtils.getSimpleStack(Blocks.stone) - }, - null, - new int[] {10000}, - null, - null, - 16, - 32, - 0); - } - if (sRecipe_Redstone == null) { - sRecipe_Redstone = new GTPP_Recipe( - false, - new ItemStack[] { - CI.getNumberedCircuit(3), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L) - }, - new ItemStack[] { - ItemUtils.getSimpleStack(Blocks.obsidian) - }, - null, - new int[] {10000}, - null, - null, - 128, - 32, - 0); - } + sRecipe_Cobblestone = new GTPP_Recipe( + false, + new ItemStack[] { + CI.getNumberedCircuit(1) + }, + new ItemStack[] { + ItemUtils.getSimpleStack(Blocks.cobblestone) + }, + null, + new int[] {10000}, + null, + null, + 16, + 32, + 0); + sRecipe_SmoothStone = new GTPP_Recipe( + false, + new ItemStack[] { + CI.getNumberedCircuit(2) + }, + new ItemStack[] { + ItemUtils.getSimpleStack(Blocks.stone) + }, + null, + new int[] {10000}, + null, + null, + 16, + 32, + 0); + sRecipe_Redstone = new GTPP_Recipe( + false, + new ItemStack[] { + CI.getNumberedCircuit(3), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L) + }, + new ItemStack[] { + ItemUtils.getSimpleStack(Blocks.obsidian) + }, + null, + new int[] {10000}, + null, + null, + 128, + 32, + 0); } @Override @@ -301,7 +324,9 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends GregtechMeta_M return false; } - generateRecipes(); + if (sRecipe_Cobblestone == null || sRecipe_SmoothStone == null || sRecipe_Redstone == null) { + generateRecipes(); + } int aCircuit = aGuiCircuit.getItemDamage(); @@ -327,7 +352,7 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends GregtechMeta_M // Based on the Processing Array. A bit overkill, but very flexible. ItemStack[] aItemInputs = aItems.toArray(new ItemStack[aItems.size()]); - FluidStack[] aFluidInputs = aFluids.toArray(new FluidStack[aFluids.size()]); + FluidStack[] aFluidInputs = new FluidStack[] {}; // Reset outputs and progress stats this.mEUt = 0; @@ -365,16 +390,25 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends GregtechMeta_M log("tTotalEUt: "+tTotalEUt); log("tVoltage: "+tVoltage); log("tRecipeEUt: "+tRecipeEUt); - // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits - for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { - if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { - log("Broke at "+parallelRecipes+"."); - break; + + if (aItems.size() > 0 && aCircuit == 3) { + // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { + if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { + break; + } + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); + tTotalEUt += tRecipeEUt; + } + } + else if (aCircuit >= 1 && aCircuit <= 2) { + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); + tTotalEUt += tRecipeEUt; } - log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); - tTotalEUt += tRecipeEUt; } + log("Broke at "+parallelRecipes+"."); if (parallelRecipes == 0) { log("BAD RETURN - 3"); return false; @@ -488,7 +522,7 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends GregtechMeta_M @Override public int getEuDiscountForParallelism() { - return 80; + return 75; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java index aa28faa6f9..2027e6b190 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java @@ -1,14 +1,25 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_IndustrialRockBreaker; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_AutoChisel; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialChisel; public class GregtechIndustrialChisel { - public static void run() { - // Industrial Maceration Stack Multiblock - /*GregtechItemList.Controller_IndustrialRockBreaker.set(new GregtechMetaTileEntity_IndustrialRockBreaker(32005, - "industrialrockcrusher.controller.tier.single", "Boldarnator").getStackForm(1L));*/ + public static void run() { + GregtechItemList.GT_Chisel_LV.set(new GregtechMetaTileEntity_AutoChisel(31066, + "chisel.tier.01", "Basic Auto-Chisel", 1).getStackForm(1L)); + GregtechItemList.GT_Chisel_MV.set(new GregtechMetaTileEntity_AutoChisel(31067, + "chisel.tier.02", "Advanced Auto-Chisel", 2).getStackForm(1L)); + GregtechItemList.GT_Chisel_HV.set(new GregtechMetaTileEntity_AutoChisel(31068, + "chisel.tier.03", "Precision Auto-Chisel", 3).getStackForm(1L)); + + GregtechItemList.Controller_IndustrialAutoChisel.set( + new GregtechMetaTileEntity_IndustrialChisel(31069, + "multimachine.adv.chisel", + "Industrial 3D Copying Machine").getStackForm(1L)); + + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java index 45b923083e..562693ee3e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java @@ -6,7 +6,7 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr public class GregtechIndustrialRockBreaker { public static void run() { - GregtechItemList.Controller_IndustrialRockBreaker.set(new GregtechMetaTileEntity_IndustrialRockBreaker(32005, + GregtechItemList.Controller_IndustrialRockBreaker.set(new GregtechMetaTileEntity_IndustrialRockBreaker(31065, "industrialrockcrusher.controller.tier.single", "Boldarnator").getStackForm(1L)); } -- cgit From 998c739e50ef56e3a4cf2c4cdd397a8cdfbeef6d Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 19 Dec 2021 15:00:59 +0000 Subject: Added pollution config values for the new multis. Added recipes for the new blocks. Fix Rock Breaker handling of Redstone/Obsidian. --- .../java/gtPlusPlus/core/config/ConfigHandler.java | 2 + src/main/java/gtPlusPlus/core/lib/CORE.java | 2 + .../gtPlusPlus/core/recipe/RECIPES_Machines.java | 76 +++++++++++++++++++++- .../common/blocks/GregtechMetaCasingBlocks5.java | 3 +- .../GregtechMetaTileEntity_IndustrialChisel.java | 2 +- ...egtechMetaTileEntity_IndustrialRockBreaker.java | 10 ++- 6 files changed, 86 insertions(+), 9 deletions(-) (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common/blocks') diff --git a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java index 61610a03e9..382b63e2c3 100644 --- a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java +++ b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java @@ -225,6 +225,8 @@ public class ConfigHandler { pollutionPerSecondMultiMassFabricator = config.get("pollution", "pollutionPerSecondMultiMassFabricator", pollutionPerSecondMultiMassFabricator,"pollution rate in gibbl/s for the Matter fabrication CPU").getInt(pollutionPerSecondMultiMassFabricator); pollutionPerSecondMultiRefinery = config.get("pollution", "pollutionPerSecondMultiRefinery", pollutionPerSecondMultiRefinery,"pollution rate in gibbl/s for the Reactor fuel processing plant").getInt(pollutionPerSecondMultiRefinery); //pollutionPerSecondMultiGeneratorArray; + pollutionPerSecondMultiIndustrialRockBreaker = config.get("pollution", "pollutionPerSecondMultiIndustrialRockBreaker", pollutionPerSecondMultiIndustrialRockBreaker,"pollution rate in gibbl/s for the Industrial Rock Breaker").getInt(pollutionPerSecondMultiIndustrialRockBreaker); + pollutionPerSecondMultiIndustrialChisel = config.get("pollution", "pollutionPerSecondMultiIndustrialChisel", pollutionPerSecondMultiIndustrialChisel,"pollution rate in gibbl/s for the Industrial Chisel").getInt(pollutionPerSecondMultiIndustrialChisel); pollutionPerSecondMultiTreeFarm = config.get("pollution", "pollutionPerSecondMultiTreeFarm", pollutionPerSecondMultiTreeFarm,"pollution rate in gibbl/s for the Tree growth simulator").getInt(pollutionPerSecondMultiTreeFarm); pollutionPerSecondMultiFrothFlotationCell = config.get("pollution", "pollutionPerSecondMultiFrothFlotationCell", pollutionPerSecondMultiFrothFlotationCell,"pollution rate in gibbl/s for the Flotation cell regulator").getInt(pollutionPerSecondMultiFrothFlotationCell); pollutionPerSecondMultiAutoCrafter = config.get("pollution", "pollutionPerSecondMultiAutoCrafter", pollutionPerSecondMultiAutoCrafter,"pollution rate in gibbl/s for the Large-Scale auto assembler v1.01").getInt(pollutionPerSecondMultiAutoCrafter); diff --git a/src/main/java/gtPlusPlus/core/lib/CORE.java b/src/main/java/gtPlusPlus/core/lib/CORE.java index 1ef04aa154..7508b9fc8f 100644 --- a/src/main/java/gtPlusPlus/core/lib/CORE.java +++ b/src/main/java/gtPlusPlus/core/lib/CORE.java @@ -300,6 +300,8 @@ public class CORE { public static int pollutionPerSecondMultiAutoCrafter = 500; public static int pollutionPerSecondMultiThermalBoiler = 700; public static int pollutionPerSecondMultiAlgaePond = 0; + public static int pollutionPerSecondMultiIndustrialRockBreaker = 100; + public static int pollutionPerSecondMultiIndustrialChisel = 50; //pollution single blocks public static int basePollutionPerSecondSemiFluidGenerator = 40; public static double[] pollutionReleasedByTierSemiFluidGenerator = new double[]{0,2.0,4.0,8.0}; diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 14001d86bd..e190bc67fa 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -253,7 +253,9 @@ public class RECIPES_Machines { chemPlant(); zyngen(); milling(); - sparging(); + sparging(); + chisels(); + rockBreaker(); } @@ -2637,6 +2639,78 @@ public class RECIPES_Machines { 60 * 20 * 2, MaterialUtils.getVoltageForTier(5)); } + + private static void chisels() { + ItemStack[] aChisels = new ItemStack[] { + GregtechItemList.GT_Chisel_LV.get(1), + GregtechItemList.GT_Chisel_MV.get(1), + GregtechItemList.GT_Chisel_HV.get(1), + }; + for (int i=1;i<4;i++) { + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedBioCircuit(10+i), + CI.getTieredMachineCasing(i), + CI.getPlate(i, 4), + CI.getElectricMotor(i, 2), + CI.getConveyor(i, 2), + CI.getRobotArm(i, 1) + }, + CI.getTieredFluid(i, 144 * 4), + aChisels[i-1], + 20 * 20, + MaterialUtils.getVoltageForTier(i)); + } + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedBioCircuit(14), + aChisels[2], + CI.getPlate(4, 8), + CI.getElectricMotor(4, 8), + CI.getConveyor(4, 8), + CI.getRobotArm(4, 4) + }, + CI.getTieredFluid(4, 144 * 8), + GregtechItemList.Controller_IndustrialAutoChisel.get(1), + 20 * 20, + MaterialUtils.getVoltageForTier(4)); + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedBioCircuit(14), + ItemList.Casing_SolidSteel.get(2), + CI.getPlate(4, 2), + CI.getTieredComponent(OrePrefixes.plate, 3, 4), + CI.getTieredComponent(OrePrefixes.ring, 3, 8), + CI.getTieredComponent(OrePrefixes.rod, 2, 4), + }, + CI.getTieredFluid(2, 144 * 2), + GregtechItemList.Casing_IndustrialAutoChisel.get(1), + 20 * 20, + MaterialUtils.getVoltageForTier(3)); + + + + } + + private static void rockBreaker() { + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(12), + ItemList.Machine_EV_RockBreaker.get(1), + ALLOY.STAINLESS_STEEL.getPlate(8), + ALLOY.STAINLESS_STEEL.getRing(4), + CI.getTieredComponentOfMaterial(Materials.Aluminium, OrePrefixes.plateDouble, 8), + ALLOY.EGLIN_STEEL.getScrew(8), + }, + ELEMENT.getInstance().ALUMINIUM.getFluidStack(144 * 8), + GregtechItemList.Controller_IndustrialRockBreaker.get(1), + 60 * 20 * 2, + MaterialUtils.getVoltageForTier(4)); + + } private static void fakeMachineCasingCovers() { GregtechItemList[] mMachineCasingCovers = new GregtechItemList[] { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java index 4f84a3daca..3d15e5cf58 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java @@ -18,7 +18,8 @@ import net.minecraft.world.IBlockAccess; public class GregtechMetaCasingBlocks5 extends GregtechMetaCasingBlocksAbstract { - //Free Indexes within TAE: 90, 91, 92, 94, 114, 116, 117, 118, 119, 120, 121, 124, 125, 126, 127 + // Free Indexes within TAE: 91, 92, 94, 100, 101, 102, 103, 104, 114, 116, 117, 118, 119, 120, 121, 124, 125, 126, 127 + // 19 Free Indexes private static final TexturesGrinderMultiblock mGrinderOverlayHandler = new TexturesGrinderMultiblock(); public GregtechMetaCasingBlocks5() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java index 51775791f4..77cc19d5d4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java @@ -424,7 +424,7 @@ public class GregtechMetaTileEntity_IndustrialChisel extends GregtechMeta_MultiB } public int getPollutionPerSecond(ItemStack aStack) { - return CORE.ConfigSwitches.pollutionPerSecondMultiAdvImplosion; + return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialChisel; } public int getDamageToComponent(ItemStack aStack) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java index 885aa05716..1b8835f289 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java @@ -82,9 +82,7 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends GregtechMeta_M GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) .addInfo("Controller Block for the Industrial Rock Breaker") - .addInfo("200% Faster than the single block version") - .addInfo("Only uses 80% of the eu/t normally required") - .addInfo("Processes 8 items per voltage tier") + .addInfo("Speed: 200% | Eu Usage: 75% | Parallel: Tier x 8") .addInfo("Circuit goes in the Input Bus or GUI slot") .addInfo("1 = cobble, 2 = stone, 3 = obsidian") .addInfo("Supply Water/Lava") @@ -394,8 +392,8 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends GregtechMeta_M if (aItems.size() > 0 && aCircuit == 3) { // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { - if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { - break; + if (!this.depleteInput(tRecipe.mInputs[1])) { + break; } log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); tTotalEUt += tRecipeEUt; @@ -532,7 +530,7 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker extends GregtechMeta_M @Override public int getPollutionPerSecond(final ItemStack aStack) { - return CORE.ConfigSwitches.pollutionPerSecondMultiABS; + return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialRockBreaker; } @Override -- cgit From b230d17992013dcb5f3df142788f0cb51a72d1e0 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 19 Dec 2021 15:48:48 +0000 Subject: Added Advanced Air Intake Hatch. Added Reservoir Hatch. Refactored Air Intake Hatch into a base class. --- .../xmod/gregtech/api/enums/GregtechItemList.java | 4 + .../GT_MetaTileEntity_Hatch_AirIntake.java | 251 +++----------------- .../GT_MetaTileEntity_Hatch_AirIntake_Extreme.java | 110 +++++++++ .../GT_MetaTileEntity_Hatch_FluidGenerator.java | 254 +++++++++++++++++++++ .../GT_MetaTileEntity_Hatch_Reservoir.java | 81 +++++++ .../common/blocks/textures/TexturesGtBlock.java | 2 + .../gregtech/GregtechCustomHatches.java | 5 + .../blocks/TileEntities/adv_machine_water.png | Bin 0 -> 218 bytes 8 files changed, 485 insertions(+), 222 deletions(-) create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java create mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java create mode 100644 src/main/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_water.png (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common/blocks') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index d3caf99af6..a8ee2e24ad 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -438,6 +438,10 @@ public enum GregtechItemList implements GregtechItemContainer { //Air Intake hatch Hatch_Air_Intake, + Hatch_Air_Intake_Extreme, + + //Reservoir Hatch + Hatch_Reservoir, //XL Turbine Rotor Hatch /*Hatch_Turbine_Rotor,*/ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java index 5fb3b11d08..4716d8038a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java @@ -1,165 +1,65 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; -import java.lang.reflect.Field; - -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.objects.GT_RenderedTexture; -import gtPlusPlus.api.objects.random.XSTR; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_Input { - - private static XSTR floatGen; - public int mProgresstime = 0, mMaxProgresstime = 0; +public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_FluidGenerator { - public GT_MetaTileEntity_Hatch_AirIntake(final int aID, final String aName, final String aNameRegional, - final int aTier) { + public GT_MetaTileEntity_Hatch_AirIntake(final int aID, final String aName, final String aNameRegional, final int aTier) { super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_Hatch_AirIntake(final String aName, final int aTier, final String aDescription, - final ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_AirIntake(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } - /*public GT_MetaTileEntity_Hatch_AirIntake(final String aName, final int aTier, final String[] aDescription, - final ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); - }*/ - - private static String[] S; - private static Field F; - - public synchronized String[] getDescription() { - try { - if (F == null || S == null) { - Field t = ReflectionUtils.getField(this.getClass(), "mDescriptionArray"); - if (t != null) { - F = t; - } - else { - F = ReflectionUtils.getField(this.getClass(), "mDescription"); - } - if (S == null && F != null) { - Object o = F.get(this); - if (o instanceof String[]) { - S = (String[]) o; - } - else if (o instanceof String) { - S = new String[] {(String) o}; - } - } - - } - } - catch (Throwable t) { - - } - if (S != null) { - final String[] desc = new String[S.length + 4]; - System.arraycopy(S, 0, desc, 0, S.length); - desc[S.length] = "DO NOT OBSTRUCT THE INPUT!"; - desc[S.length + 1] = "Draws in Air from the surrounding environment"; - desc[S.length + 2] = "Creates 1000L of Air every 4 ticks"; - desc[S.length + 3] = CORE.GT_Tooltip; - return desc; - } - else { - return new String[] {"DO NOT OBSTRUCT THE INPUT!", "Draws in Air from the surrounding environment", "Creates 1000L of Air every 4 ticks", CORE.GT_Tooltip}; - } - - } - - public ITexture[] getTexturesActive(final ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, - new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER)}; - } - - public ITexture[] getTexturesInactive(final ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, - new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER)}; - } - - public boolean isSimpleMachine() { - return true; - } - - public boolean isFacingValid(final byte aFacing) { - return true; + public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_AirIntake(this.mName, this.mTier, this.mDescription, this.mTextures); } - public boolean isAccessAllowed(final EntityPlayer aPlayer) { - return true; + @Override + public String[] getCustomTooltip() { + String[] aTooltip = new String[3]; + aTooltip[0] = "DO NOT OBSTRUCT THE INPUT!"; + aTooltip[1] = "Draws in Air from the surrounding environment"; + aTooltip[2] = "Creates 1000L of Air every 4 ticks"; + return aTooltip; } - public boolean isValidSlot(final int aIndex) { - return false; + @Override + public Fluid getFluidToGenerate() { + return FluidUtils.getAir(1).getFluid(); } - public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_AirIntake(this.mName, this.mTier, this.mDescription, this.mTextures); + @Override + public int getAmountOfFluidToGenerate() { + return 1000; } - public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, - final ItemStack aStack) { - return false; + @Override + public int getMaxTickTime() { + return 4; } - public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, - final ItemStack aStack) { - return false; + @Override + public int getCapacity() { + return 128000; } - public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - - if (!aBaseMetaTileEntity.isAllowedToWork()) { - aBaseMetaTileEntity.setActive(false); - mProgresstime = 0; - mMaxProgresstime = 0; - } - else { - aBaseMetaTileEntity.setActive(true); - mMaxProgresstime = 4; - if (++mProgresstime >= mMaxProgresstime) { - addAirToHatch(aTick); - mProgresstime = 0; - } - } + @Override + public boolean doesHatchMeetConditionsToGenerate() { + return this.getBaseMetaTileEntity().getAirAtSide(this.getBaseMetaTileEntity().getFrontFacing()); } - - @Override - public int getProgresstime() { - return mProgresstime; - } - - @Override - public int maxProgresstime() { - return mMaxProgresstime; - } - @Override - public int increaseProgress(int aProgress) { - mProgresstime += aProgress; - return mMaxProgresstime - mProgresstime; - } - - public void pollutionParticles(final World aWorld, final String name) { + @Override + public void generateParticles(World aWorld, String name) { if (this.getBaseMetaTileEntity().isServerSide()) { return; } @@ -207,97 +107,4 @@ public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_I (double) -ySpd, (double) zSpd); } - static { - GT_MetaTileEntity_Hatch_AirIntake.floatGen = new XSTR(); - } - - public int getTankPressure() { - return 100; - } - - public int getCapacity() { - return 128000; - } - - @Override - public boolean canTankBeEmptied() { - return true; - } - - private static Fluid AIR; - - public boolean isAirInHatch() { - if (this.mFluid != null) { - if (AIR == null) { - AIR = FluidUtils.getAir(1).getFluid(); - } - if (AIR == this.mFluid.getFluid()) { - return true; - } - } - return false; - } - - public boolean addAirToHatch(long aTick) { - if (!this.getBaseMetaTileEntity().getAirAtSide(this.getBaseMetaTileEntity().getFrontFacing())) { - return false; - } - boolean didFill = this.fill(FluidUtils.getAir(1000), true) > 0; - if (didFill) { - this.pollutionParticles(this.getBaseMetaTileEntity().getWorld(), "cloud"); - } - return didFill; - } - - @Override - public boolean canTankBeFilled() { - if (this.mFluid == null || (this.mFluid != null && (this.mFluid.amount <= this.getCapacity()))) { - return true; - } - return false; - } - - @Override - public boolean doesEmptyContainers() { - return false; - } - - @Override - public boolean doesFillContainers() { - return true; - } - - @Override - public int fill(FluidStack aFluid, boolean doFill) { - return super.fill(aFluid, doFill); - } - - @Override - public boolean canFill(ForgeDirection aSide, Fluid aFluid) { - return false; - } - - @Override - public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { - return 0; - } - - @Override - public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { - return 0; - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setInteger("mProgresstime", mProgresstime); - aNBT.setInteger("mMaxProgresstime", mMaxProgresstime); - super.saveNBTData(aNBT); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - mProgresstime = aNBT.getInteger("mProgresstime"); - mMaxProgresstime = aNBT.getInteger("mMaxProgresstime"); - super.loadNBTData(aNBT); - } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java new file mode 100644 index 0000000000..5ebb2da8d4 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java @@ -0,0 +1,110 @@ +package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; + +public class GT_MetaTileEntity_Hatch_AirIntake_Extreme extends GT_MetaTileEntity_Hatch_FluidGenerator { + + public GT_MetaTileEntity_Hatch_AirIntake_Extreme(final int aID, final String aName, final String aNameRegional, final int aTier) { + super(aID, aName, aNameRegional, aTier); + } + + public GT_MetaTileEntity_Hatch_AirIntake_Extreme(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + + public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_AirIntake_Extreme(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + @Override + public String[] getCustomTooltip() { + String[] aTooltip = new String[3]; + aTooltip[0] = "DO NOT OBSTRUCT THE INPUT!"; + aTooltip[1] = "Draws in Air from the surrounding environment"; + aTooltip[2] = "Creates 5000L of Air every 4 ticks"; + return aTooltip; + } + + @Override + public Fluid getFluidToGenerate() { + return FluidUtils.getAir(1).getFluid(); + } + + @Override + public int getAmountOfFluidToGenerate() { + return 5000; + } + + @Override + public int getMaxTickTime() { + return 4; + } + + @Override + public int getCapacity() { + return 256000; + } + + @Override + public boolean doesHatchMeetConditionsToGenerate() { + return this.getBaseMetaTileEntity().getAirAtSide(this.getBaseMetaTileEntity().getFrontFacing()); + } + + @Override + public void generateParticles(World aWorld, String name) { + if (this.getBaseMetaTileEntity().isServerSide()) { + return; + } + final float ran1 = GT_MetaTileEntity_Hatch_AirIntake_Extreme.floatGen.nextFloat(); + float ran2 = 0.0f; + float ran3 = 0.0f; + ran2 = GT_MetaTileEntity_Hatch_AirIntake_Extreme.floatGen.nextFloat(); + ran3 = GT_MetaTileEntity_Hatch_AirIntake_Extreme.floatGen.nextFloat(); + + final IGregTechTileEntity aMuffler = this.getBaseMetaTileEntity(); + final ForgeDirection aDir = ForgeDirection.getOrientation((int) aMuffler.getFrontFacing()); + final float xPos = aDir.offsetX * 0.76f + aMuffler.getXCoord() + 0.25f; + float yPos = aDir.offsetY * 0.76f + aMuffler.getYCoord() + 0.65f; + final float zPos = aDir.offsetZ * 0.76f + aMuffler.getZCoord() + 0.25f; + float ySpd = aDir.offsetY * 0.1f + 0.2f + 0.1f * GT_MetaTileEntity_Hatch_AirIntake_Extreme.floatGen.nextFloat(); + float xSpd; + float zSpd; + if (aDir.offsetY == -1) { + //Logger.INFO("Y = -1"); + final float temp = GT_MetaTileEntity_Hatch_AirIntake_Extreme.floatGen.nextFloat() * 2.0f * CORE.PI; + xSpd = (float) Math.sin(temp) * 0.1f; + zSpd = (float) Math.cos(temp) * 0.1f; + ySpd = -ySpd; + yPos = yPos - 0.8f; + } + else { + xSpd = aDir.offsetX * (0.1f + 0.2f * GT_MetaTileEntity_Hatch_AirIntake_Extreme.floatGen.nextFloat()); + zSpd = aDir.offsetZ * (0.1f + 0.2f * GT_MetaTileEntity_Hatch_AirIntake_Extreme.floatGen.nextFloat()); + + xSpd = -xSpd; + zSpd = -zSpd; + } + + aWorld.spawnParticle(name, (double) (xPos + ran1 * 0.5f), + (double) (yPos + GT_MetaTileEntity_Hatch_AirIntake_Extreme.floatGen.nextFloat() * 0.5f), + (double) (zPos + GT_MetaTileEntity_Hatch_AirIntake_Extreme.floatGen.nextFloat() * 0.5f), (double) xSpd, + (double) -ySpd, (double) zSpd); + aWorld.spawnParticle(name, (double) (xPos + ran2 * 0.5f), + (double) (yPos + GT_MetaTileEntity_Hatch_AirIntake_Extreme.floatGen.nextFloat() * 0.5f), + (double) (zPos + GT_MetaTileEntity_Hatch_AirIntake_Extreme.floatGen.nextFloat() * 0.5f), (double) xSpd, + (double) -ySpd, (double) zSpd); + aWorld.spawnParticle(name, (double) (xPos + ran3 * 0.5f), + (double) (yPos + GT_MetaTileEntity_Hatch_AirIntake_Extreme.floatGen.nextFloat() * 0.5f), + (double) (zPos + GT_MetaTileEntity_Hatch_AirIntake_Extreme.floatGen.nextFloat() * 0.5f), (double) xSpd, + (double) -ySpd, (double) zSpd); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java new file mode 100644 index 0000000000..7579c8ec5a --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java @@ -0,0 +1,254 @@ +package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; + +import java.lang.reflect.Field; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.objects.GT_RenderedTexture; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.random.XSTR; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTileEntity_Hatch_Input { + + protected static XSTR floatGen = new XSTR(); + public int mProgresstime = 0, mMaxProgresstime = 0; + + public GT_MetaTileEntity_Hatch_FluidGenerator(final int aID, final String aName, final String aNameRegional, final int aTier) { + super(aID, aName, aNameRegional, aTier); + } + + public GT_MetaTileEntity_Hatch_FluidGenerator(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + private static String[] S; + private static Field F; + + public abstract String[] getCustomTooltip(); + + public abstract Fluid getFluidToGenerate(); + + public abstract int getAmountOfFluidToGenerate(); + + public abstract int getMaxTickTime(); + + public synchronized String[] getDescription() { + try { + if (F == null || S == null) { + Field t = ReflectionUtils.getField(this.getClass(), "mDescriptionArray"); + if (t != null) { + F = t; + } + else { + F = ReflectionUtils.getField(this.getClass(), "mDescription"); + } + if (S == null && F != null) { + Object o = F.get(this); + if (o instanceof String[]) { + S = (String[]) o; + } + else if (o instanceof String) { + S = new String[] {(String) o}; + } + } + + } + } + catch (Throwable t) { + Logger.INFO("1"); + t.printStackTrace(); + } + try { + if (S != null) { + String[] aCustomTips = getCustomTooltip(); + final String[] desc = new String[S.length + aCustomTips.length + 1]; + System.arraycopy(S, 0, desc, 0, S.length); + for (int i=0;i= mMaxProgresstime) { + addFluidToHatch(aTick); + mProgresstime = 0; + } + } + } + + @Override + public int getProgresstime() { + return mProgresstime; + } + + @Override + public int maxProgresstime() { + return mMaxProgresstime; + } + + @Override + public int increaseProgress(int aProgress) { + mProgresstime += aProgress; + return mMaxProgresstime - mProgresstime; + } + + public abstract void generateParticles(final World aWorld, final String name); + + public int getTankPressure() { + return 100; + } + + public abstract int getCapacity(); + + @Override + public boolean canTankBeEmptied() { + return true; + } + + public boolean isAirInHatch() { + if (this.mFluid != null) { + if (getFluidToGenerate() == this.mFluid.getFluid()) { + return true; + } + } + return false; + } + + public abstract boolean doesHatchMeetConditionsToGenerate(); + + public boolean addFluidToHatch(long aTick) { + if (!doesHatchMeetConditionsToGenerate()) { + return false; + } + boolean didFill = this.fill(FluidUtils.getFluidStack(getFluidToGenerate(), getAmountOfFluidToGenerate()), true) > 0; + if (didFill) { + this.generateParticles(this.getBaseMetaTileEntity().getWorld(), "cloud"); + } + return didFill; + } + + @Override + public boolean canTankBeFilled() { + if (this.mFluid == null || (this.mFluid != null && (this.mFluid.amount <= this.getCapacity()))) { + return true; + } + return false; + } + + @Override + public boolean doesEmptyContainers() { + return false; + } + + @Override + public boolean doesFillContainers() { + return true; + } + + @Override + public int fill(FluidStack aFluid, boolean doFill) { + return super.fill(aFluid, doFill); + } + + @Override + public boolean canFill(ForgeDirection aSide, Fluid aFluid) { + return false; + } + + @Override + public int fill(ForgeDirection arg0, FluidStack arg1, boolean arg2) { + return 0; + } + + @Override + public int fill_default(ForgeDirection aSide, FluidStack aFluid, boolean doFill) { + return 0; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("mProgresstime", mProgresstime); + aNBT.setInteger("mMaxProgresstime", mMaxProgresstime); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + mProgresstime = aNBT.getInteger("mProgresstime"); + mMaxProgresstime = aNBT.getInteger("mMaxProgresstime"); + super.loadNBTData(aNBT); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java new file mode 100644 index 0000000000..5cd57e9e92 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java @@ -0,0 +1,81 @@ +package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; + +public class GT_MetaTileEntity_Hatch_Reservoir extends GT_MetaTileEntity_Hatch_FluidGenerator { + + public GT_MetaTileEntity_Hatch_Reservoir(final int aID, final String aName, final String aNameRegional, final int aTier) { + super(aID, aName, aNameRegional, aTier); + } + + public GT_MetaTileEntity_Hatch_Reservoir(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + + public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_Reservoir(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + @Override + public String[] getCustomTooltip() { + String[] aTooltip = new String[3]; + aTooltip[0] = "Requires a Block of water facing the intake"; + aTooltip[1] = "Infinite water supply hatch"; + aTooltip[2] = "Creates 2000L of Water every 4 ticks"; + return aTooltip; + } + + @Override + public Fluid getFluidToGenerate() { + return FluidRegistry.WATER; + } + + @Override + public int getAmountOfFluidToGenerate() { + return 2000; + } + + @Override + public int getMaxTickTime() { + return 4; + } + + @Override + public int getCapacity() { + return 128000; + } + + @Override + public boolean doesHatchMeetConditionsToGenerate() { + Block aWater = this.getBaseMetaTileEntity().getBlockAtSide(this.getBaseMetaTileEntity().getFrontFacing()); + return aWater == Blocks.water || aWater == Blocks.flowing_water; + } + + @Override + public void generateParticles(World aWorld, String name) { + + } + + public ITexture[] getTexturesActive(final ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, + new GT_RenderedTexture(TexturesGtBlock.Overlay_Water)}; + } + + public ITexture[] getTexturesInactive(final ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, + new GT_RenderedTexture(TexturesGtBlock.Overlay_Water)}; + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index 518ffe0eae..8b372dff0c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -445,6 +445,8 @@ public class TexturesGtBlock { private static final CustomIcon Internal_Overlay_Oil = new CustomIcon("TileEntities/adv_machine_oil"); public static final CustomIcon Overlay_Oil = Internal_Overlay_Oil; + private static final CustomIcon Internal_Overlay_Water = new CustomIcon("TileEntities/adv_machine_water"); + public static final CustomIcon Overlay_Water = Internal_Overlay_Water; private static final CustomIcon Internal_Overlay_UU_Matter = new CustomIcon("TileEntities/adv_machine_uum"); public static final CustomIcon Overlay_UU_Matter = Internal_Overlay_UU_Matter; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java index 64e77393bd..b93933d088 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java @@ -68,7 +68,12 @@ public class GregtechCustomHatches { // Multiblock Air Intake Hatch GregtechItemList.Hatch_Air_Intake.set(new GT_MetaTileEntity_Hatch_AirIntake(861, "hatch.air.intake.tier.00", "Air Intake Hatch", 5).getStackForm(1L)); + GregtechItemList.Hatch_Air_Intake_Extreme.set(new GT_MetaTileEntity_Hatch_AirIntake_Extreme(31070, "hatch.air.intake.tier.01", "Extreme Air Intake Hatch", 6).getStackForm(1L)); + // Multiblock Reservoir Hatch + GregtechItemList.Hatch_Reservoir.set(new GT_MetaTileEntity_Hatch_Reservoir(31071, "hatch.water.intake.tier.00", "Reservoir Hatch", 6).getStackForm(1L)); + + // Steam Hatch GregtechItemList.Hatch_Input_Steam .set(new GT_MetaTileEntity_Hatch_CustomFluidBase(FluidUtils.getSteam(1).getFluid(), // Fluid diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_water.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_water.png new file mode 100644 index 0000000000..3351f5d0a6 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/adv_machine_water.png differ -- cgit