From b9833f63271c7d27e21e96ba2e3875cd369bd242 Mon Sep 17 00:00:00 2001 From: Rseifert Date: Sat, 5 Jan 2013 15:05:53 -0500 Subject: [PATCH] more changes of the last Still working on moving everything over to my new system. So far i've got it mostly done for the tank and pipe though i have no way to test them yet. I would list the change but meh its break time, i'm tired and the code says everything Things that are still broken *Lang file *release Valve *pipe *Tank *Some crafting --- minecraft/liquidmechanics/api/IPressure.java | 4 - .../helpers/{Colors.java => PipeColor.java} | 10 +- .../api/helpers/TankHelper.java | 130 -------------- .../api/helpers/connectionHelper.java | 56 ++++++ .../liquidmechanics/client/ClientProxy.java | 3 - .../client/model/ModelPipe.java | 122 ------------- .../client/render/BlockRenderHelper.java | 138 ++++++++------ .../client/render/ItemRenderHelper.java | 116 ------------ .../client/render/RenderPipe.java | 51 +++--- .../client/render/RenderTank.java | 117 ++++++++++-- .../common/LiquidMechanics.java | 170 ++++++++---------- .../common/block/BlockLiquidMachine.java | 89 ++------- .../common/block/BlockPipe.java | 57 +----- .../common/block/BlockSteam.java | 35 ---- .../common/block/BlockTank.java | 137 ++++++++++++++ .../common/handlers/LiquidData.java | 10 +- .../common/handlers/LiquidHandler.java | 33 +++- .../common/handlers/PipeCreator.java | 20 --- .../common/handlers/PipeInstance.java | 11 +- .../common/handlers/UpdateConverter.java | 23 ++- .../liquidmechanics/common/item/ItemPipe.java | 135 -------------- .../liquidmechanics/common/item/ItemTank.java | 138 -------------- .../tileentity/TileEntityGenerator.java | 4 +- .../common/tileentity/TileEntityPipe.java | 42 +++-- .../common/tileentity/TileEntityPump.java | 6 - .../tileentity/TileEntityReleaseValve.java | 146 ++++++++++----- .../common/tileentity/TileEntityTank.java | 108 +++++------ .../resource/lang/en_US.properties | 7 +- .../{LiquidTankCorner.png => Corner.png} | Bin ...uidTankCornerWater.png => CornerWater.png} | Bin .../resource/tanks/LiquidTank.png | Bin 487 -> 0 bytes .../resource/tanks/LiquidTank0.png | Bin 494 -> 0 bytes .../resource/tanks/LiquidTank1.png | Bin 563 -> 0 bytes .../resource/tanks/LiquidTank2.png | Bin 514 -> 0 bytes .../resource/tanks/LiquidTank3.png | Bin 504 -> 0 bytes .../resource/tanks/LiquidTank4.png | Bin 476 -> 0 bytes .../liquidmechanics/resource/tanks/Tank.png | Bin 0 -> 1056 bytes .../resource/tanks/WaterTank.png | Bin 0 -> 491 bytes .../resource/tanks/guage/0.png | Bin 0 -> 742 bytes .../resource/tanks/guage/0Lava.png | Bin 0 -> 760 bytes .../resource/tanks/guage/1.png | Bin 0 -> 770 bytes .../resource/tanks/guage/2.png | Bin 0 -> 967 bytes .../resource/tanks/guage/3.png | Bin 0 -> 790 bytes .../resource/tanks/guage/4.png | Bin 0 -> 740 bytes 44 files changed, 743 insertions(+), 1175 deletions(-) rename minecraft/liquidmechanics/api/helpers/{Colors.java => PipeColor.java} (82%) delete mode 100644 minecraft/liquidmechanics/api/helpers/TankHelper.java create mode 100644 minecraft/liquidmechanics/api/helpers/connectionHelper.java delete mode 100644 minecraft/liquidmechanics/client/model/ModelPipe.java delete mode 100644 minecraft/liquidmechanics/client/render/ItemRenderHelper.java delete mode 100644 minecraft/liquidmechanics/common/block/BlockSteam.java create mode 100644 minecraft/liquidmechanics/common/block/BlockTank.java delete mode 100644 minecraft/liquidmechanics/common/handlers/PipeCreator.java delete mode 100644 minecraft/liquidmechanics/common/item/ItemPipe.java delete mode 100644 minecraft/liquidmechanics/common/item/ItemTank.java rename minecraft/liquidmechanics/resource/tanks/{LiquidTankCorner.png => Corner.png} (100%) rename minecraft/liquidmechanics/resource/tanks/{LiquidTankCornerWater.png => CornerWater.png} (100%) delete mode 100644 minecraft/liquidmechanics/resource/tanks/LiquidTank.png delete mode 100644 minecraft/liquidmechanics/resource/tanks/LiquidTank0.png delete mode 100644 minecraft/liquidmechanics/resource/tanks/LiquidTank1.png delete mode 100644 minecraft/liquidmechanics/resource/tanks/LiquidTank2.png delete mode 100644 minecraft/liquidmechanics/resource/tanks/LiquidTank3.png delete mode 100644 minecraft/liquidmechanics/resource/tanks/LiquidTank4.png create mode 100644 minecraft/liquidmechanics/resource/tanks/Tank.png create mode 100644 minecraft/liquidmechanics/resource/tanks/WaterTank.png create mode 100644 minecraft/liquidmechanics/resource/tanks/guage/0.png create mode 100644 minecraft/liquidmechanics/resource/tanks/guage/0Lava.png create mode 100644 minecraft/liquidmechanics/resource/tanks/guage/1.png create mode 100644 minecraft/liquidmechanics/resource/tanks/guage/2.png create mode 100644 minecraft/liquidmechanics/resource/tanks/guage/3.png create mode 100644 minecraft/liquidmechanics/resource/tanks/guage/4.png diff --git a/minecraft/liquidmechanics/api/IPressure.java b/minecraft/liquidmechanics/api/IPressure.java index c02c9a47..0fa84601 100644 --- a/minecraft/liquidmechanics/api/IPressure.java +++ b/minecraft/liquidmechanics/api/IPressure.java @@ -21,8 +21,4 @@ public interface IPressure * @return */ public boolean canPressureToo(LiquidData type, ForgeDirection dir); - /** - * gets the LiquidData linked to the TE - */ - public LiquidData getLiquidType(); } diff --git a/minecraft/liquidmechanics/api/helpers/Colors.java b/minecraft/liquidmechanics/api/helpers/PipeColor.java similarity index 82% rename from minecraft/liquidmechanics/api/helpers/Colors.java rename to minecraft/liquidmechanics/api/helpers/PipeColor.java index 13ae27ab..e9d6cabd 100644 --- a/minecraft/liquidmechanics/api/helpers/Colors.java +++ b/minecraft/liquidmechanics/api/helpers/PipeColor.java @@ -3,7 +3,7 @@ package liquidmechanics.api.helpers; import liquidmechanics.common.handlers.LiquidData; import liquidmechanics.common.handlers.LiquidHandler; -public enum Colors +public enum PipeColor { BLACK, RED, GREEN, BROWN, BLUE, PURPLE, CYAN, SILVER, GREY, PINK, LIME, YELLOW, LIGHTBLUE, MAGENTA, ORANGE, NONE; @@ -24,7 +24,7 @@ public enum Colors /** * gets a color based on liquid Data */ - public static Colors get(LiquidData data) + public static PipeColor get(LiquidData data) { if (data == LiquidHandler.lava) { return RED; } if (data == LiquidHandler.steam) { return ORANGE; } @@ -34,11 +34,11 @@ public enum Colors /** * gets a color based on number(0-15) */ - public static Colors get(int num) + public static PipeColor get(int num) { - if(num < Colors.values().length) + if(num < PipeColor.values().length) { - return Colors.values()[num]; + return PipeColor.values()[num]; } return NONE; } diff --git a/minecraft/liquidmechanics/api/helpers/TankHelper.java b/minecraft/liquidmechanics/api/helpers/TankHelper.java deleted file mode 100644 index 17748833..00000000 --- a/minecraft/liquidmechanics/api/helpers/TankHelper.java +++ /dev/null @@ -1,130 +0,0 @@ -package liquidmechanics.api.helpers; - -import liquidmechanics.common.handlers.LiquidData; -import liquidmechanics.common.handlers.LiquidHandler; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.liquids.ILiquidTank; -import net.minecraftforge.liquids.ITankContainer; -import net.minecraftforge.liquids.LiquidStack; -import universalelectricity.core.vector.Vector3; - -public class TankHelper -{ - /** - * Used to find all tileEntities sounding the location you will have to filter for selective - * tileEntities - * - * @param world - the world being searched threw - * @param x - * @param y - * @param z - * @return an array of up to 6 tileEntities - */ - public static TileEntity[] getSurroundings(World world, int x, int y, int z) - { - TileEntity[] list = new TileEntity[] { null, null, null, null, null, null }; - for (int i = 0; i < 6; i++) - { - ForgeDirection d = ForgeDirection.getOrientation(i); - TileEntity aEntity = world.getBlockTileEntity(x + d.offsetX, y + d.offsetY, z + d.offsetZ); - if (aEntity instanceof TileEntity) - { - list[i] = aEntity; - } - } - return list; - } - /** - * - * @param world - world - * @param center - location of center of trade - * @param tank - liquid tank to be drained/filled - * @return ammount removed from tank - */ - public static int shareLiquid(World world, Vector3 center, LiquidStack resource) - { - - if (resource == null) - return 0; - LiquidStack liquid = resource.copy(); - TileEntity[] connected = TankHelper.getSurroundings(world, center.intX(), center.intY(), center.intZ()); - LiquidData type = LiquidHandler.get(liquid); - ForgeDirection firstTrade = ForgeDirection.UP; - if (!type.getCanFloat()) - firstTrade = ForgeDirection.DOWN; - for (int i = 0; i < 6; i++) - { - ForgeDirection dir = ForgeDirection.getOrientation(i); - - if (connected[i] instanceof ITankContainer) - { - ITankContainer cont = ((ITankContainer) connected[i]); - ILiquidTank[] tanks = cont.getTanks(dir); - boolean validTank = false; - for (int t = 0; t < tanks.length; t++) - { - if (tanks[t].getLiquid() != null && LiquidHandler.isEqual(tanks[t].getLiquid(), liquid)) - { - validTank = true; - break; - } - } - if (!validTank) - connected[i] = null; - } - else - { - connected[i] = null; - } - - } - int filled = 0; - if (connected[firstTrade.ordinal()] instanceof ITankContainer && liquid != null && liquid.amount <= 0) - { - int f = ((ITankContainer) connected[firstTrade.ordinal()]).fill(firstTrade, liquid, true); - liquid.amount -= f; - filled += f; - } - if (connected[firstTrade.getOpposite().ordinal()] instanceof ITankContainer && liquid != null && liquid.amount <= 0) - { - int f = ((ITankContainer) connected[firstTrade.getOpposite().ordinal()]).fill(firstTrade, liquid, true); - liquid.amount -= f; - filled += f; - } - for (int i = 2; i < 6; i++) - { - ForgeDirection dir = ForgeDirection.getOrientation(i); - if (liquid == null || liquid.amount <= 0) - break; - if (connected[i] instanceof ITankContainer) - { - int f = ((ITankContainer) connected[i]).fill(dir, liquid, true); - liquid.amount -= f; - filled += f; - } - - } - return filled; - - } - - /** - * - * @param entity - entity in question - * @return 1-4 if corner 0 if not a corner you have to figure out which is which depending on - * what your using this for 1 should be north east 2 south east - */ - public static int corner(TileEntity entity) - { - TileEntity[] en = getSurroundings(entity.worldObj, entity.xCoord, entity.yCoord, entity.zCoord); - if (en[4] != null && en[2] != null && en[5] == null && en[3] == null) { return 3; } - if (en[2] != null && en[5] != null && en[3] == null && en[4] == null) { return 4; } - if (en[5] != null && en[3] != null && en[4] == null && en[2] == null) { return 1; } - if (en[3] != null && en[4] != null && en[2] == null && en[5] == null) { return 2; } - - return 0; - - } -} diff --git a/minecraft/liquidmechanics/api/helpers/connectionHelper.java b/minecraft/liquidmechanics/api/helpers/connectionHelper.java new file mode 100644 index 00000000..7c2f4de9 --- /dev/null +++ b/minecraft/liquidmechanics/api/helpers/connectionHelper.java @@ -0,0 +1,56 @@ +package liquidmechanics.api.helpers; + +import liquidmechanics.common.handlers.LiquidData; +import liquidmechanics.common.handlers.LiquidHandler; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.liquids.ILiquidTank; +import net.minecraftforge.liquids.ITankContainer; +import net.minecraftforge.liquids.LiquidStack; +import universalelectricity.core.vector.Vector3; + +public class connectionHelper +{ + /** + * Used to find all tileEntities sounding the location you will have to filter for selective + * tileEntities + * + * @param world - the world being searched threw + * @param x + * @param y + * @param z + * @return an array of up to 6 tileEntities + */ + public static TileEntity[] getSurroundings(World world, int x, int y, int z) + { + TileEntity[] list = new TileEntity[] { null, null, null, null, null, null }; + for (int i = 0; i < 6; i++) + { + ForgeDirection d = ForgeDirection.getOrientation(i); + TileEntity aEntity = world.getBlockTileEntity(x + d.offsetX, y + d.offsetY, z + d.offsetZ); + if (aEntity instanceof TileEntity) + { + list[i] = aEntity; + } + } + return list; + } + + /** + * Used to find which of 4 Corners this block is in a group of blocks + * 0 = not a corner + * 1-4 = a corner of some direction + */ + public static int corner(TileEntity entity) + { + TileEntity[] en = getSurroundings(entity.worldObj, entity.xCoord, entity.yCoord, entity.zCoord); + if (en[4] != null && en[2] != null && en[5] == null && en[3] == null) { return 3; } + if (en[2] != null && en[5] != null && en[3] == null && en[4] == null) { return 4; } + if (en[5] != null && en[3] != null && en[4] == null && en[2] == null) { return 1; } + if (en[3] != null && en[4] != null && en[2] == null && en[5] == null) { return 2; } + + return 0; + + } +} diff --git a/minecraft/liquidmechanics/client/ClientProxy.java b/minecraft/liquidmechanics/client/ClientProxy.java index 08a8fac1..d4639d6c 100644 --- a/minecraft/liquidmechanics/client/ClientProxy.java +++ b/minecraft/liquidmechanics/client/ClientProxy.java @@ -1,7 +1,6 @@ package liquidmechanics.client; import liquidmechanics.client.render.BlockRenderHelper; -import liquidmechanics.client.render.ItemRenderHelper; import liquidmechanics.client.render.RenderGearRod; import liquidmechanics.client.render.RenderGenerator; import liquidmechanics.client.render.RenderPipe; @@ -36,8 +35,6 @@ public class ClientProxy extends CommonProxy ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGenerator.class, new RenderGenerator()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTank.class, new RenderTank()); RenderingRegistry.registerBlockHandler(new BlockRenderHelper()); - MinecraftForgeClient.registerItemRenderer(LiquidMechanics.itemPipes.shiftedIndex, new ItemRenderHelper()); - MinecraftForgeClient.registerItemRenderer(LiquidMechanics.itemTank.shiftedIndex, new ItemRenderHelper()); } @Override diff --git a/minecraft/liquidmechanics/client/model/ModelPipe.java b/minecraft/liquidmechanics/client/model/ModelPipe.java deleted file mode 100644 index 6179f593..00000000 --- a/minecraft/liquidmechanics/client/model/ModelPipe.java +++ /dev/null @@ -1,122 +0,0 @@ -package liquidmechanics.client.model; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelPipe extends ModelBase -{ - // fields - ModelRenderer Middle; - ModelRenderer Right; - ModelRenderer Left; - ModelRenderer Back; - ModelRenderer Front; - ModelRenderer Top; - ModelRenderer Bottom; - - public ModelPipe() - { - textureWidth = 64; - textureHeight = 32; - - Middle = new ModelRenderer(this, 0, 0); - Middle.addBox(-1F, -1F, -1F, 4, 4, 4); - Middle.setRotationPoint(-1F, 15F, -1F); - Middle.setTextureSize(64, 32); - Middle.mirror = true; - setRotation(Middle, 0F, 0F, 0F); - Right = new ModelRenderer(this, 21, 0); - Right.addBox(0F, 0F, 0F, 6, 4, 4); - Right.setRotationPoint(2F, 14F, -2F); - Right.setTextureSize(64, 32); - Right.mirror = true; - setRotation(Right, 0F, 0F, 0F); - Left = new ModelRenderer(this, 21, 0); - Left.addBox(0F, 0F, 0F, 6, 4, 4); - Left.setRotationPoint(-8F, 14F, -2F); - Left.setTextureSize(64, 32); - Left.mirror = true; - setRotation(Left, 0F, 0F, 0F); - Back = new ModelRenderer(this, 0, 11); - Back.addBox(0F, 0F, 0F, 4, 4, 6); - Back.setRotationPoint(-2F, 14F, 2F); - Back.setTextureSize(64, 32); - Back.mirror = true; - setRotation(Back, 0F, 0F, 0F); - Front = new ModelRenderer(this, 0, 11); - Front.addBox(0F, 0F, 0F, 4, 4, 6); - Front.setRotationPoint(-2F, 14F, -8F); - Front.setTextureSize(64, 32); - Front.mirror = true; - setRotation(Front, 0F, 0F, 0F); - Top = new ModelRenderer(this, 21, 11); - Top.addBox(0F, 0F, 0F, 4, 6, 4); - Top.setRotationPoint(-2F, 8F, -2F); - Top.setTextureSize(64, 32); - Top.mirror = true; - setRotation(Top, 0F, 0F, 0F); - Bottom = new ModelRenderer(this, 21, 11); - Bottom.addBox(0F, 0F, 0F, 4, 6, 4); - Bottom.setRotationPoint(-2F, 18F, -2F); - Bottom.setTextureSize(64, 32); - Bottom.mirror = true; - setRotation(Bottom, 0F, 0F, 0F); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - this.renderMiddle(); - this.renderBottom(); - this.renderTop(); - this.renderLeft(); - this.renderRight(); - this.renderBack(); - this.renderFront(); - } - - public void renderMiddle() - { - Middle.render(0.0625F); - } - - public void renderBottom() - { - Bottom.render(0.0625F); - } - - public void renderTop() - { - Top.render(0.0625F); - } - - public void renderLeft() - { - Left.render(0.0625F); - } - - public void renderRight() - { - Right.render(0.0625F); - } - - public void renderBack() - { - Back.render(0.0625F); - } - - public void renderFront() - { - Front.render(0.0625F); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - -} diff --git a/minecraft/liquidmechanics/client/render/BlockRenderHelper.java b/minecraft/liquidmechanics/client/render/BlockRenderHelper.java index 5d464190..effaf34c 100644 --- a/minecraft/liquidmechanics/client/render/BlockRenderHelper.java +++ b/minecraft/liquidmechanics/client/render/BlockRenderHelper.java @@ -2,6 +2,8 @@ package liquidmechanics.client.render; import liquidmechanics.client.model.ModelGearRod; import liquidmechanics.client.model.ModelGenerator; +import liquidmechanics.client.model.ModelLargePipe; +import liquidmechanics.client.model.ModelLiquidTank; import liquidmechanics.client.model.ModelPump; import liquidmechanics.common.LiquidMechanics; import net.minecraft.block.Block; @@ -16,64 +18,92 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class BlockRenderHelper implements ISimpleBlockRenderingHandler { - public static BlockRenderHelper instance = new BlockRenderHelper(); - public static int renderID = RenderingRegistry.getNextAvailableRenderId(); - private ModelPump modelPump = new ModelPump(); - private ModelGearRod modelRod = new ModelGearRod(); - private ModelGenerator modelGen = new ModelGenerator(); + public static BlockRenderHelper instance = new BlockRenderHelper(); + public static int renderID = RenderingRegistry.getNextAvailableRenderId(); + private ModelPump modelPump = new ModelPump(); + private ModelGearRod modelRod = new ModelGearRod(); + private ModelGenerator modelGen = new ModelGenerator(); + private ModelLargePipe SixPipe = new ModelLargePipe(); + private ModelLiquidTank tank = new ModelLiquidTank(); - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) - { - if (block.blockID == LiquidMechanics.blockMachine.blockID && metadata < 4) - { - GL11.glPushMatrix(); - GL11.glTranslatef((float) 0.0F, (float) 1.1F, (float) 0.0F); - GL11.glRotatef(180f, 0f, 0f, 1f); - GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(LiquidMechanics.RESOURCE_PATH + "pumps/Pump.png")); - modelPump.renderMain(0.0725F); - modelPump.renderC1(0.0725F); - modelPump.renderC2(0.0725F); - modelPump.renderC3(0.0725F); - GL11.glPopMatrix(); - } - if (block.blockID == LiquidMechanics.blockPipe.blockID) - { + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) + { + if (block.blockID == LiquidMechanics.blockMachine.blockID && metadata < 4) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float) 0.0F, (float) 1.1F, (float) 0.0F); + GL11.glRotatef(180f, 0f, 0f, 1f); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(LiquidMechanics.RESOURCE_PATH + "pumps/Pump.png")); + modelPump.renderMain(0.0725F); + modelPump.renderC1(0.0725F); + modelPump.renderC2(0.0725F); + modelPump.renderC3(0.0725F); + GL11.glPopMatrix(); + } + if (block.blockID == LiquidMechanics.blockPipe.blockID) + { + this.renderPipeItem(renderer, metadata); + } + if (block.blockID == LiquidMechanics.blockTank.blockID) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float) 0.0F, (float) 1.1F, (float) 0.0F); + GL11.glRotatef(180f, 0f, 0f, 1f); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(RenderTank.getTankTexture(metadata))); + tank.renderMain(0.0625F); + tank.renderMeter(null, 0.0625F); + GL11.glPopMatrix(); + } + if (block.blockID == LiquidMechanics.blockRod.blockID) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float) 0.0F, (float) 1.5F, (float) 0.0F); + GL11.glRotatef(180f, 0f, 0f, 1f); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(LiquidMechanics.RESOURCE_PATH + "mechanical/GearRod.png")); + modelRod.render(0.0825F, 0); + GL11.glPopMatrix(); + } + if (block.blockID == LiquidMechanics.blockGenerator.blockID) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float) 0.0F, (float) 1.3F, (float) 0.0F); + GL11.glRotatef(180f, 0f, 0f, 1f); + GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(LiquidMechanics.RESOURCE_PATH + "mechanical/Generator.png")); + modelGen.render(null); + GL11.glPopMatrix(); + } + } - } - if (block.blockID == LiquidMechanics.blockRod.blockID) - { - GL11.glPushMatrix(); - GL11.glTranslatef((float) 0.0F, (float) 1.5F, (float) 0.0F); - GL11.glRotatef(180f, 0f, 0f, 1f); - GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(LiquidMechanics.RESOURCE_PATH + "mechanical/GearRod.png")); - modelRod.render(0.0825F, 0); - GL11.glPopMatrix(); - } - if (block.blockID == LiquidMechanics.blockGenerator.blockID) - { - GL11.glPushMatrix(); - GL11.glTranslatef((float) 0.0F, (float) 1.3F, (float) 0.0F); - GL11.glRotatef(180f, 0f, 0f, 1f); - GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(LiquidMechanics.RESOURCE_PATH + "mechanical/Generator.png")); - modelGen.render(null); - GL11.glPopMatrix(); - } - } + public void renderPipeItem(RenderBlocks renderer, int meta) + { - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) - { - return false; - } + GL11.glPushMatrix(); - public boolean shouldRender3DInInventory() - { + GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(RenderPipe.getPipeTexture(meta))); - return true; - } + GL11.glTranslatef(0.5F, -0.5F, 0.5F); + + SixPipe.renderRight(); + SixPipe.renderLeft(); + SixPipe.renderMiddle(); - public int getRenderId() - { - return renderID; - } + GL11.glPopMatrix(); + } + + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) + { + return false; + } + + public boolean shouldRender3DInInventory() + { + + return true; + } + + public int getRenderId() + { + return renderID; + } } diff --git a/minecraft/liquidmechanics/client/render/ItemRenderHelper.java b/minecraft/liquidmechanics/client/render/ItemRenderHelper.java deleted file mode 100644 index 03b28170..00000000 --- a/minecraft/liquidmechanics/client/render/ItemRenderHelper.java +++ /dev/null @@ -1,116 +0,0 @@ -package liquidmechanics.client.render; - -import liquidmechanics.client.model.ModelLargePipe; -import liquidmechanics.client.model.ModelLiquidTank; -import liquidmechanics.common.LiquidMechanics; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.FMLClientHandler; - -/** - * special tanks to Mekanism github - */ -public class ItemRenderHelper implements IItemRenderer -{ - static final ModelLiquidTank model = new ModelLiquidTank(); - static final ModelLargePipe SixPipe = new ModelLargePipe(); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) - { - return true; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) - { - return true; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) - { - if (item.itemID == LiquidMechanics.itemPipes.shiftedIndex) - { - this.renderPipeItem((RenderBlocks) data[0], item.getItemDamage(), type == ItemRenderType.EQUIPPED); - } - if (item.itemID == LiquidMechanics.itemTank.shiftedIndex) - { - this.rendertankItem((RenderBlocks) data[0], item.getItemDamage(), type == ItemRenderType.EQUIPPED); - } - - } - - public void renderPipeItem(RenderBlocks renderer, int meta, boolean equ) - { - - GL11.glPushMatrix(); - String file = LiquidMechanics.RESOURCE_PATH + "pipes/"; - switch (meta) - { - case 0: - file += "SixSteamPipe.png"; - break; - case 1: - file += "SixWaterPipe.png"; - break; - case 2: - file += "SixLavaPipe.png"; - break; - case 3: - file += "SixOilPipe.png"; - break; - default: - file += "DefaultPipe.png"; - break; - } - GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(file)); - if (!equ) - { - GL11.glTranslatef(0.5F, -0.5F, 0.5F); - SixPipe.renderRight(); - SixPipe.renderLeft(); - SixPipe.renderMiddle(); - } - else - { - GL11.glTranslatef(0.5F, -0.5F, 0.5F); - SixPipe.renderFront(); - SixPipe.renderBack(); - SixPipe.renderMiddle(); - } - - GL11.glPopMatrix(); - } - - public void rendertankItem(RenderBlocks renderer, int meta, boolean equ) - { - - GL11.glPushMatrix(); - - String file = LiquidMechanics.RESOURCE_PATH + "tanks/"; - switch (meta) - { - default: - file += "LiquidTank.png"; - break; - } - - GL11.glBindTexture(GL11.GL_TEXTURE_2D, FMLClientHandler.instance().getClient().renderEngine.getTexture(file)); - if (!equ) - { - GL11.glTranslatef(0.5F, -0.5F, 0.5F); - } - else - { - GL11.glTranslatef(0.5F, -0.5F, 0.5F); - } - model.renderMain(0.0625F); - model.renderMeter(null, 0.0625F); - GL11.glPopMatrix(); - } -} diff --git a/minecraft/liquidmechanics/client/render/RenderPipe.java b/minecraft/liquidmechanics/client/render/RenderPipe.java index 46f3fc9b..29711fd7 100644 --- a/minecraft/liquidmechanics/client/render/RenderPipe.java +++ b/minecraft/liquidmechanics/client/render/RenderPipe.java @@ -1,10 +1,7 @@ package liquidmechanics.client.render; import liquidmechanics.client.model.ModelLargePipe; -import liquidmechanics.client.model.ModelPipe; import liquidmechanics.common.LiquidMechanics; -import liquidmechanics.common.handlers.LiquidData; -import liquidmechanics.common.handlers.LiquidHandler; import liquidmechanics.common.tileentity.TileEntityPipe; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; @@ -13,14 +10,11 @@ import org.lwjgl.opengl.GL11; public class RenderPipe extends TileEntitySpecialRenderer { - private LiquidData type = LiquidHandler.water; - private ModelPipe fourPipe; private ModelLargePipe SixPipe; private TileEntity[] ents = new TileEntity[6]; public RenderPipe() { - fourPipe = new ModelPipe(); SixPipe = new ModelLargePipe(); } @@ -30,35 +24,42 @@ public class RenderPipe extends TileEntitySpecialRenderer GL11.glPushMatrix(); GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glScalef(1.0F, -1F, -1F); + int meta = 0; if (te instanceof TileEntityPipe) { - type = ((TileEntityPipe) te).getType(); + meta = te.getBlockMetadata(); ents = ((TileEntityPipe) te).connectedBlocks; } - this.render(type, ents); + this.render(meta, ents); GL11.glPopMatrix(); } - - public void render(LiquidData type2, TileEntity[] ents) + public static String getPipeTexture(int meta) { - - if (type2 == LiquidHandler.water) + switch(meta) { - bindTextureByName(LiquidMechanics.RESOURCE_PATH + "pipes/SixWaterPipe.png"); - } - else if (type2 == LiquidHandler.lava) - { - bindTextureByName(LiquidMechanics.RESOURCE_PATH + "pipes/SixLavaPipe.png"); - } - else if (type2 == LiquidHandler.steam) - { - bindTextureByName(LiquidMechanics.RESOURCE_PATH + "pipes/SixSteamPipe.png"); - } - else - { - bindTextureByName(LiquidMechanics.RESOURCE_PATH + "pipes/SixOilPipe.png"); + case 0: + case 1:return LiquidMechanics.RESOURCE_PATH + "pipes/SixLavaPipe.png"; + case 2: + case 3: + case 4:return LiquidMechanics.RESOURCE_PATH + "pipes/SixWaterPipe.png"; + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14:return LiquidMechanics.RESOURCE_PATH + "pipes/SixSteamPipe.png"; + case 15: + default:return LiquidMechanics.RESOURCE_PATH + "pipes/SixOilPipe.png"; } + } + public void render(int meta, TileEntity[] ents) + { + bindTextureByName(this.getPipeTexture(meta)); if (ents[0] != null) SixPipe.renderBottom(); if (ents[1] != null) diff --git a/minecraft/liquidmechanics/client/render/RenderTank.java b/minecraft/liquidmechanics/client/render/RenderTank.java index 68c5e8c4..92094c5a 100644 --- a/minecraft/liquidmechanics/client/render/RenderTank.java +++ b/minecraft/liquidmechanics/client/render/RenderTank.java @@ -1,6 +1,6 @@ package liquidmechanics.client.render; -import liquidmechanics.api.helpers.TankHelper; +import liquidmechanics.api.helpers.connectionHelper; import liquidmechanics.client.model.ModelLiquidTank; import liquidmechanics.client.model.ModelLiquidTankCorner; import liquidmechanics.common.LiquidMechanics; @@ -28,19 +28,17 @@ public class RenderTank extends TileEntitySpecialRenderer public void renderAModelAt(TileEntityTank te, double d, double d1, double d2, float f) { - type = te.getType(); - if (te.tank.getLiquid() != null) - pos = Math.min((te.tank.getLiquid().amount / LiquidContainerRegistry.BUCKET_VOLUME), 4); + int meta = te.getBlockMetadata(); + pos = Math.min((te.volume / LiquidContainerRegistry.BUCKET_VOLUME), 4); + GL11.glPushMatrix(); GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glScalef(1.0F, -1F, -1F); - if (TankHelper.corner(te) > 0) + + if (connectionHelper.corner(te) > 0) { - if (type == LiquidHandler.water) - { - bindTextureByName(LiquidMechanics.RESOURCE_PATH + "tanks/LiquidTankCornerWater.png"); - } - int corner = TankHelper.corner(te); + bindTextureByName(this.getCornerTexture(meta)); + int corner = connectionHelper.corner(te); switch (corner) { case 2: @@ -60,20 +58,105 @@ public class RenderTank extends TileEntitySpecialRenderer } else { - switch (LiquidHandler.getMeta(type)) - { - // case 0: - // bindTextureByName(BasicPipesMain.textureFile+"/pipes/SixSteamPipe.png");break; - default:bindTextureByName(LiquidMechanics.RESOURCE_PATH + "tanks/LiquidTank" + pos + ".png");break; - - } + bindTextureByName(this.getTankTexture(meta)); model.renderMain(0.0625F); + bindTextureByName(this.getGuageTexture(meta, pos)); model.renderMeter(te, 0.0625F); } GL11.glPopMatrix(); } + public static String getTankTexture(int meta) + { + String type = ""; + switch (meta) + { + case 0: + case 1: + case 2: + case 3: + case 4:// default + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + default: + type = ""; + break; + } + + return LiquidMechanics.RESOURCE_PATH + "tanks/" + type + "Tank.png"; + + } + + public static String getGuageTexture(int meta, int pos) + { + String type = ""; + switch (meta) + { + case 0: + case 1: + case 2: + case 3: + case 4:// default + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + default: + type = ""; + break; + } + + return LiquidMechanics.RESOURCE_PATH + "tanks/guage/" + pos + type + ".png"; + } + + public static String getCornerTexture(int meta) + { + String type = ""; + switch (meta) + { + case 0: + case 1: + case 2: + case 3: + case 4: + type = "Water"; + break; + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + default: + type = ""; + break; + } + return LiquidMechanics.RESOURCE_PATH + "tanks/Corner" + type + "png"; + + } + @Override public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) { diff --git a/minecraft/liquidmechanics/common/LiquidMechanics.java b/minecraft/liquidmechanics/common/LiquidMechanics.java index 90e1c0f6..6acdf01e 100644 --- a/minecraft/liquidmechanics/common/LiquidMechanics.java +++ b/minecraft/liquidmechanics/common/LiquidMechanics.java @@ -2,18 +2,17 @@ package liquidmechanics.common; import java.io.File; +import liquidmechanics.api.helpers.PipeColor; import liquidmechanics.common.block.BlockGenerator; import liquidmechanics.common.block.BlockLiquidMachine; import liquidmechanics.common.block.BlockPipe; import liquidmechanics.common.block.BlockReleaseValve; import liquidmechanics.common.block.BlockRod; -import liquidmechanics.common.block.BlockSteam; +import liquidmechanics.common.block.BlockTank; import liquidmechanics.common.handlers.LiquidHandler; import liquidmechanics.common.item.ItemGuage; import liquidmechanics.common.item.ItemParts; import liquidmechanics.common.item.ItemParts.Parts; -import liquidmechanics.common.item.ItemPipe; -import liquidmechanics.common.item.ItemTank; import liquidmechanics.common.tileentity.TileEntityGenerator; import liquidmechanics.common.tileentity.TileEntityPipe; import liquidmechanics.common.tileentity.TileEntityPump; @@ -25,8 +24,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraftforge.common.Configuration; -import net.minecraftforge.liquids.LiquidContainerRegistry; -import net.minecraftforge.liquids.LiquidDictionary; import net.minecraftforge.liquids.LiquidStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; @@ -68,8 +65,8 @@ public class LiquidMechanics extends DummyModContainer public static final String BLOCK_TEXTURE_FILE = RESOURCE_PATH + "blocks.png"; public static final String ITEM_TEXTURE_FILE = RESOURCE_PATH + "items.png"; public static final String LANGUAGE_PATH = RESOURCE_PATH + "lang/"; - - private static final String[] LANGUAGES_SUPPORTED = new String[] { "en_US"}; + + private static final String[] LANGUAGES_SUPPORTED = new String[] { "en_US" }; public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir() + "/UniversalElectricity/", NAME + ".cfg")); @@ -78,19 +75,17 @@ public class LiquidMechanics extends DummyModContainer public final static int ITEM_ID_PREFIX = 13200; public static Block blockPipe; + public static Block blockTank; public static Block blockMachine; public static Block blockRod; public static Block blockGenerator; public static Block blockReleaseValve; - public static Block blockSteamBlock; public static LiquidStack liquidSteam; public static Item itemParts; - public static Item itemPipes; + // public static Item itemPipes; public static Item itemGauge; - public static Item itemOilBucket; - public static Item itemTank; @SidedProxy(clientSide = "liquidmechanics.client.ClientProxy", serverSide = "liquidmechanics.common.CommonProxy") public static CommonProxy proxy; @@ -111,31 +106,27 @@ public class LiquidMechanics extends DummyModContainer blockRod = new BlockRod(this.CONFIGURATION.getBlock("Mechanical Rod", BLOCK_ID_PREFIX + 3).getInt()); blockGenerator = new BlockGenerator((this.CONFIGURATION.getBlock("Generator", BLOCK_ID_PREFIX + 4).getInt())); blockReleaseValve = new BlockReleaseValve((this.CONFIGURATION.getBlock("Release Valve", BLOCK_ID_PREFIX + 5).getInt())); - - // Liquid Blocks - blockSteamBlock = new BlockSteam(this.CONFIGURATION.getBlock("SteamBlock", LIQUID_ID_PREFIX).getInt()); - + blockTank = new BlockTank(this.CONFIGURATION.getBlock("Tank", BLOCK_ID_PREFIX + 6).getInt()); // Items itemParts = new ItemParts(this.CONFIGURATION.getItem("Parts", ITEM_ID_PREFIX).getInt()); - itemPipes = new ItemPipe(this.CONFIGURATION.getItem("PipeItem", ITEM_ID_PREFIX + 1).getInt()); + // itemPipes = new ItemPipe(this.CONFIGURATION.getItem("PipeItem", + // ITEM_ID_PREFIX + 1).getInt()); // Valve item itemGauge = new ItemGuage(this.CONFIGURATION.getItem("PipeGuage", ITEM_ID_PREFIX + 3).getInt()); - itemTank = new ItemTank(this.CONFIGURATION.getItem("TankItem", ITEM_ID_PREFIX + 5).getInt()); // Liquid Registry - liquidSteam = LiquidDictionary.getOrCreateLiquid("Steam", new LiquidStack(blockSteamBlock, LiquidContainerRegistry.BUCKET_VOLUME)); CONFIGURATION.save(); proxy.preInit(); // block registry GameRegistry.registerBlock(blockPipe, "lmPipe"); - GameRegistry.registerBlock(blockReleaseValve,"eValve"); + GameRegistry.registerBlock(blockReleaseValve, "eValve"); GameRegistry.registerBlock(blockRod, "mechRod"); GameRegistry.registerBlock(blockGenerator, "lmGen"); GameRegistry.registerBlock(blockMachine, "lmMachines"); - GameRegistry.registerBlock(blockSteamBlock, "lmSteam"); + GameRegistry.registerBlock(blockTank, "lmTank"); } @Init @@ -151,106 +142,98 @@ public class LiquidMechanics extends DummyModContainer GameRegistry.registerTileEntity(TileEntityGenerator.class, "lmGen"); System.out.println("Fluid Mechanics Loaded: " + TranslationHelper.loadLanguages(LANGUAGE_PATH, LANGUAGES_SUPPORTED) + " Languages."); - } @PostInit public void PostInit(FMLPostInitializationEvent event) { proxy.postInit(); - TabLiquidMechanics.setItemStack(new ItemStack(itemPipes, 1, 1)); + TabLiquidMechanics.setItemStack(new ItemStack(blockPipe, 1, 4)); // generator - CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(this.blockGenerator, 1), new Object[] { - "@T@", "OVO", "@T@", - 'T', new ItemStack(LiquidMechanics.blockRod, 1), - '@', "plateSteel", - 'O', "basicCircuit", - 'V', "motor" })); + CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(this.blockGenerator, 1), new Object[] { + "@T@", "OVO", "@T@", + 'T', new ItemStack(LiquidMechanics.blockRod, 1), + '@', "plateSteel", + 'O', "basicCircuit", + 'V', "motor" })); // pipe gauge - GameRegistry.addRecipe(new ItemStack(this.itemGauge, 1, 0), new Object[] { - "TVT", " T ", - 'V', new ItemStack(itemParts, 1, 7), - 'T', new ItemStack(itemParts, 1, Parts.Iron.ordinal()) }); + GameRegistry.addRecipe(new ItemStack(this.itemGauge, 1, 0), new Object[] { + "TVT", " T ", + 'V', new ItemStack(itemParts, 1, 7), + 'T', new ItemStack(itemParts, 1, Parts.Iron.ordinal()) }); // iron tube - GameRegistry.addRecipe(new ItemStack(itemParts, 2, Parts.Iron.ordinal()), new Object[] { - "@@@", - '@', Item.ingotIron }); + GameRegistry.addRecipe(new ItemStack(itemParts, 2, Parts.Iron.ordinal()), new Object[] { + "@@@", + '@', Item.ingotIron }); // bronze tube - CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(itemParts, 2, Parts.Bronze.ordinal()), new Object[] { - "@@@", - '@', "ingotBronze" })); + CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(itemParts, 2, Parts.Bronze.ordinal()), new Object[] { + "@@@", + '@', "ingotBronze" })); // obby tube - GameRegistry.addRecipe(new ItemStack(itemParts, 2, Parts.Obby.ordinal()), new Object[] { - "@@@", - '@', Block.obsidian }); + GameRegistry.addRecipe(new ItemStack(itemParts, 2, Parts.Obby.ordinal()), new Object[] { + "@@@", + '@', Block.obsidian }); // nether tube - GameRegistry.addRecipe(new ItemStack(itemParts, 2, Parts.Nether.ordinal()), new Object[] { - "N@N", - 'N', Block.netherrack, - '@', new ItemStack(itemParts, 2, Parts.Obby.ordinal()) }); + GameRegistry.addRecipe(new ItemStack(itemParts, 2, Parts.Nether.ordinal()), new Object[] { + "N@N", + 'N', Block.netherrack, + '@', new ItemStack(itemParts, 2, Parts.Obby.ordinal()) }); // seal - GameRegistry.addRecipe(new ItemStack(itemParts, 2, Parts.Seal.ordinal()), new Object[] { - "@@", "@@", - '@', Item.leather }); + GameRegistry.addRecipe(new ItemStack(itemParts, 2, Parts.Seal.ordinal()), new Object[] { + "@@", "@@", + '@', Item.leather }); // slime steal GameRegistry.addShapelessRecipe(new ItemStack(itemParts, 1, Parts.SlimeSeal.ordinal()), new Object[] { - new ItemStack(itemParts, 1, Parts.Seal.ordinal()), - new ItemStack(Item.slimeBall, 1) }); + new ItemStack(itemParts, 1, Parts.Seal.ordinal()), + new ItemStack(Item.slimeBall, 1) }); // part valve - GameRegistry.addRecipe(new ItemStack(itemParts, 1, Parts.Valve.ordinal()), new Object[] { - "T@T", - 'T', new ItemStack(itemParts, 1, Parts.Iron.ordinal()), - '@', Block.lever }); + GameRegistry.addRecipe(new ItemStack(itemParts, 1, Parts.Valve.ordinal()), new Object[] { + "T@T", + 'T', new ItemStack(itemParts, 1, Parts.Iron.ordinal()), + '@', Block.lever }); // unfinished tank - GameRegistry.addRecipe(new ItemStack(itemParts, 1, Parts.Tank.ordinal()), new Object[] { - " @ ", "@ @", " @ ", - '@', Item.ingotIron }); + GameRegistry.addRecipe(new ItemStack(itemParts, 1, Parts.Tank.ordinal()), new Object[] { + " @ ", "@ @", " @ ", + '@', Item.ingotIron }); // mechanical rod - GameRegistry.addRecipe(new ItemStack(blockRod, 1), new Object[] { - "I@I", - 'I', Item.ingotIron, - '@', new ItemStack(itemParts, 1, Parts.Iron.ordinal()) }); + GameRegistry.addRecipe(new ItemStack(blockRod, 1), new Object[] { + "I@I", + 'I', Item.ingotIron, + '@', new ItemStack(itemParts, 1, Parts.Iron.ordinal()) }); // Iron Pipe - GameRegistry.addShapelessRecipe(new ItemStack(itemPipes, 1, 0), new Object[] { - new ItemStack(itemParts, 1, Parts.Iron.ordinal()), - new ItemStack(itemParts, 1, Parts.Seal.ordinal()) }); - + GameRegistry.addShapelessRecipe(new ItemStack(blockPipe, 1, 15), new Object[] { + new ItemStack(itemParts, 1, Parts.Iron.ordinal()), + new ItemStack(itemParts, 1, Parts.Seal.ordinal()) }); // steam tank - GameRegistry.addShapelessRecipe(new ItemStack(itemTank, 1, 0), new Object[] { - new ItemStack(itemParts, 1, Parts.Tank.ordinal()), - new ItemStack(itemParts, 1, Parts.Seal.ordinal()), - new ItemStack(Item.dyePowder, 1, 15) }); + GameRegistry.addShapelessRecipe(new ItemStack(blockTank, 1, PipeColor.ORANGE.ordinal()), new Object[] { + new ItemStack(itemParts, 1, Parts.Tank.ordinal()), + new ItemStack(itemParts, 1, Parts.Seal.ordinal()), + new ItemStack(Item.dyePowder, 1, PipeColor.ORANGE.ordinal()) }); // lava tank - GameRegistry.addShapelessRecipe(new ItemStack(itemTank, 1, 2), new Object[] { - new ItemStack(itemParts, 1, Parts.Tank.ordinal()), - Block.obsidian, - Block.obsidian, - Block.obsidian, - Block.obsidian }); + GameRegistry.addRecipe(new ItemStack(blockTank, 1, PipeColor.RED.ordinal()), new Object[] { + " @ ", "@T@", " @ ", + 'T', new ItemStack(itemParts, 1, Parts.Tank.ordinal()), + '@', Block.obsidian, }); // pump GameRegistry.addRecipe(new ItemStack(blockMachine, 1, 0), new Object[] { - "@T@", "BPB", "@P@", - '@', new ItemStack(Item.ingotIron, 2), - 'B', new ItemStack(itemParts, 1, Parts.Valve.ordinal()), - 'P', new ItemStack(Block.pistonBase), - 'T', new ItemStack(itemParts, 1, Parts.Tank.ordinal()) }); + "@T@", "BPB", "@P@", + '@', new ItemStack(Item.ingotIron, 2), + 'B', new ItemStack(itemParts, 1, Parts.Valve.ordinal()), + 'P', new ItemStack(Block.pistonBase), + 'T', new ItemStack(itemParts, 1, Parts.Tank.ordinal()) }); - // eVavles - for (int i = 0; i < LiquidHandler.allowedLiquids.size() - 1; i++) - { - GameRegistry.addRecipe(new ItemStack(blockMachine, 1, i), new Object[] { - " P ", "PVP", " P ", - 'P', new ItemStack(itemPipes, 1, i), - 'V', new ItemStack(itemParts, 1, Parts.Valve.ordinal()), }); - } - - - - //reg ore directory for parts + // release valve + GameRegistry.addRecipe(new ItemStack(blockMachine, 1), new Object[] { + "RPR", "PVP", "RPR", " P ", + 'P', new ItemStack(blockPipe, 1, 15), + 'V', new ItemStack(itemParts, 1, Parts.Valve.ordinal()), + 'R', Item.redstone }); + + // reg ore directory for parts OreDictionary.registerOre("bronzeTube", new ItemStack(itemParts, 1, Parts.Bronze.ordinal())); OreDictionary.registerOre("ironTube", new ItemStack(itemParts, 1, Parts.Iron.ordinal())); OreDictionary.registerOre("netherTube", new ItemStack(itemParts, 1, Parts.Nether.ordinal())); @@ -260,7 +243,8 @@ public class LiquidMechanics extends DummyModContainer OreDictionary.registerOre("valvePart", new ItemStack(itemParts, 1, Parts.Valve.ordinal())); OreDictionary.registerOre("bronzeTube", new ItemStack(itemParts, 1, Parts.Bronze.ordinal())); OreDictionary.registerOre("unfinishedTank", new ItemStack(itemParts, 1, Parts.Tank.ordinal())); - //add Default Liquids to current list, done last to let other mods use there liquid data first if used + // add Default Liquids to current list, done last to let other mods use + // there liquid data first if used LiquidHandler.addDefaultLiquids(); } } diff --git a/minecraft/liquidmechanics/common/block/BlockLiquidMachine.java b/minecraft/liquidmechanics/common/block/BlockLiquidMachine.java index 6d140c9e..17251d34 100644 --- a/minecraft/liquidmechanics/common/block/BlockLiquidMachine.java +++ b/minecraft/liquidmechanics/common/block/BlockLiquidMachine.java @@ -28,11 +28,17 @@ public class BlockLiquidMachine extends BlockMachine public BlockLiquidMachine(int id) { super("lmMachines", id, Material.iron, TabLiquidMechanics.INSTANCE); - this.blockIndexInTexture = 26; this.setHardness(1f); this.setResistance(5f); } - + public void onBlockAdded(World world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + if(MetaGroup.getGrouping(meta) == 1) + { + world.setBlockAndMetadata(x, y, z, LiquidMechanics.blockTank.blockID, 15); + } + } @Override public boolean isOpaqueCube() { @@ -45,75 +51,6 @@ public class BlockLiquidMachine extends BlockMachine return false; } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ) - { - ItemStack current = entityplayer.inventory.getCurrentItem(); - if (current != null) - { - - LiquidStack liquid = LiquidContainerRegistry.getLiquidForFilledItem(current); - - TileEntity tileEntity = world.getBlockTileEntity(x, y, z); - - if (tileEntity instanceof TileEntityTank) - { - TileEntityTank tank = (TileEntityTank) tileEntity; - - // Handle filled containers - if (liquid != null) - { - int filled = tank.fill(ForgeDirection.UNKNOWN, liquid, true); - - if (filled != 0 && !entityplayer.capabilities.isCreativeMode) - { - entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, LiquidHandler.consumeItem(current)); - } - - return true; - - // Handle empty containers - } - else - { - - LiquidStack stack = tank.tank.getLiquid(); - if (stack != null) - { - ItemStack liquidItem = LiquidContainerRegistry.fillLiquidContainer(stack, current); - - liquid = LiquidContainerRegistry.getLiquidForFilledItem(liquidItem); - - if (liquid != null) - { - if (!entityplayer.capabilities.isCreativeMode) - { - if (current.stackSize > 1) - { - if (!entityplayer.inventory.addItemStackToInventory(liquidItem)) return false; - else - { - entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, LiquidHandler.consumeItem(current)); - } - } - else - { - entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, LiquidHandler.consumeItem(current)); - entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, liquidItem); - } - } - tank.tank.drain(liquid.amount, true); - return true; - } - } - } - } - } - - return false; - - } - @Override public int getRenderType() { @@ -137,7 +74,7 @@ public class BlockLiquidMachine extends BlockMachine { new ItemStack(LiquidMechanics.blockMachine, 1, 0); } - if (ent instanceof TileEntityTank) { return new ItemStack(LiquidMechanics.itemTank, 1, LiquidHandler.getMeta(((TileEntityTank) ent).type)); } + return null; } @@ -147,10 +84,8 @@ public class BlockLiquidMachine extends BlockMachine int meta = world.getBlockMetadata(x, y, z); int angle = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; TileEntity ent = world.getBlockTileEntity(x, y, z); - if (MetaGroup.getGrouping(meta) != 1) - { - world.setBlockMetadata(x, y, z, angle + MetaGroup.getGroupStartMeta(MetaGroup.getGrouping(meta))); - } + + world.setBlockMetadata(x, y, z, angle + MetaGroup.getGroupStartMeta(MetaGroup.getGrouping(meta))); if (ent instanceof TileEntityAdvanced) { ((TileEntityAdvanced) world.getBlockTileEntity(x, y, z)).initiate(); @@ -171,7 +106,7 @@ public class BlockLiquidMachine extends BlockMachine } else if (meta >= 4) { - return new TileEntityTank(); + } else { diff --git a/minecraft/liquidmechanics/common/block/BlockPipe.java b/minecraft/liquidmechanics/common/block/BlockPipe.java index 16a2409b..c9d18f96 100644 --- a/minecraft/liquidmechanics/common/block/BlockPipe.java +++ b/minecraft/liquidmechanics/common/block/BlockPipe.java @@ -2,7 +2,11 @@ package liquidmechanics.common.block; import java.util.Random; +import universalelectricity.prefab.BlockMachine; + +import liquidmechanics.client.render.BlockRenderHelper; import liquidmechanics.common.LiquidMechanics; +import liquidmechanics.common.TabLiquidMechanics; import liquidmechanics.common.handlers.LiquidHandler; import liquidmechanics.common.tileentity.TileEntityPipe; @@ -14,12 +18,11 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -public class BlockPipe extends BlockContainer +public class BlockPipe extends BlockMachine { public BlockPipe(int id) { - super(id, Material.iron); - this.setBlockName("Pipe"); + super("Pipe",id, Material.iron,TabLiquidMechanics.INSTANCE); this.setBlockBounds(0.30F, 0.30F, 0.30F, 0.70F, 0.70F, 0.70F); this.setHardness(1f); this.setResistance(3f); @@ -40,19 +43,7 @@ public class BlockPipe extends BlockContainer @Override public int getRenderType() { - return -1; - } - - @Override - public int idDropped(int par1, Random par2Random, int par3) - { - return 0; - } - - @Override - public void onBlockAdded(World world, int x, int y, int z) - { - super.onBlockAdded(world, x, y, z); + return BlockRenderHelper.renderID; } /** @@ -82,43 +73,13 @@ public class BlockPipe extends BlockContainer @Override public TileEntity createNewTileEntity(World var1) { - // TODO Auto-generated method stub return new TileEntityPipe(); } @Override public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { - TileEntity ent = world.getBlockTileEntity(x, y, z); - int meta = 0; - if (ent instanceof TileEntityPipe) - { - TileEntityPipe pipe = (TileEntityPipe) ent; - meta = LiquidHandler.getMeta(pipe.type); - - } - return new ItemStack(LiquidMechanics.itemPipes, 1, 0); - } - - @Override - public void breakBlock(World world, int x, int y, int z, int par5, int par6) - { - super.breakBlock(world, x, y, z, par5, par6); - TileEntity ent = world.getBlockTileEntity(x, y, z); - Random furnaceRand = new Random(); - if (ent instanceof TileEntityPipe) - { - TileEntityPipe pipe = (TileEntityPipe) ent; - int meta = LiquidHandler.getMeta(pipe.type); - float var8 = furnaceRand.nextFloat() * 0.8F + 0.1F; - float var9 = furnaceRand.nextFloat() * 0.8F + 0.1F; - float var10 = furnaceRand.nextFloat() * 0.8F + 0.1F; - EntityItem var12 = new EntityItem(world, (double) ((float) x + var8), (double) ((float) y + var9), (double) ((float) z + var10), new ItemStack(LiquidMechanics.itemPipes, 1, meta)); - float var13 = 0.05F; - var12.motionX = (double) ((float) furnaceRand.nextGaussian() * var13); - var12.motionY = (double) ((float) furnaceRand.nextGaussian() * var13 + 0.2F); - var12.motionZ = (double) ((float) furnaceRand.nextGaussian() * var13); - world.spawnEntityInWorld(var12); - } + int meta = world.getBlockMetadata(x, y, z); + return new ItemStack(LiquidMechanics.blockPipe, 1, meta); } } diff --git a/minecraft/liquidmechanics/common/block/BlockSteam.java b/minecraft/liquidmechanics/common/block/BlockSteam.java deleted file mode 100644 index 1a40c40c..00000000 --- a/minecraft/liquidmechanics/common/block/BlockSteam.java +++ /dev/null @@ -1,35 +0,0 @@ -package liquidmechanics.common.block; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraftforge.liquids.ILiquid; - -public class BlockSteam extends Block implements ILiquid -{ - public static int blockID; - - public BlockSteam(int par1) - { - super(par1, Material.air); - blockID = par1; - } - - @Override - public int stillLiquidId() - { - return blockID; - } - - @Override - public boolean isMetaSensitive() - { - return false; - } - - @Override - public int stillLiquidMeta() - { - return 0; - } - -} diff --git a/minecraft/liquidmechanics/common/block/BlockTank.java b/minecraft/liquidmechanics/common/block/BlockTank.java new file mode 100644 index 00000000..575e4eb8 --- /dev/null +++ b/minecraft/liquidmechanics/common/block/BlockTank.java @@ -0,0 +1,137 @@ +package liquidmechanics.common.block; + +import liquidmechanics.client.render.BlockRenderHelper; +import liquidmechanics.common.LiquidMechanics; +import liquidmechanics.common.TabLiquidMechanics; +import liquidmechanics.common.handlers.LiquidHandler; +import liquidmechanics.common.tileentity.TileEntityPump; +import liquidmechanics.common.tileentity.TileEntityTank; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.liquids.LiquidContainerRegistry; +import net.minecraftforge.liquids.LiquidStack; +import universalelectricity.prefab.BlockMachine; + +public class BlockTank extends BlockMachine +{ + + public BlockTank(int id) + { + super("lmTank", id, Material.rock, TabLiquidMechanics.INSTANCE); + this.setHardness(1f); + this.setResistance(5f); + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int getRenderType() + { + return BlockRenderHelper.renderID; + } + + @Override + public int damageDropped(int meta) + { + return meta; + } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ) + { + ItemStack current = entityplayer.inventory.getCurrentItem(); + if (current != null) + { + + LiquidStack liquid = LiquidContainerRegistry.getLiquidForFilledItem(current); + + TileEntity tileEntity = world.getBlockTileEntity(x, y, z); + + if (tileEntity instanceof TileEntityTank) + { + TileEntityTank tank = (TileEntityTank) tileEntity; + + // Handle filled containers + if (liquid != null) + { + int filled = tank.fill(ForgeDirection.UNKNOWN, liquid, true); + + if (filled != 0 && !entityplayer.capabilities.isCreativeMode) + { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, LiquidHandler.consumeItem(current)); + } + + return true; + + // Handle empty containers + } + else + { + + LiquidStack stack = tank.tank.getLiquid(); + if (stack != null) + { + ItemStack liquidItem = LiquidContainerRegistry.fillLiquidContainer(stack, current); + + liquid = LiquidContainerRegistry.getLiquidForFilledItem(liquidItem); + + if (liquid != null) + { + if (!entityplayer.capabilities.isCreativeMode) + { + if (current.stackSize > 1) + { + if (!entityplayer.inventory.addItemStackToInventory(liquidItem)) return false; + else + { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, LiquidHandler.consumeItem(current)); + } + } + else + { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, LiquidHandler.consumeItem(current)); + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, liquidItem); + } + } + tank.tank.drain(liquid.amount, true); + return true; + } + } + } + } + } + + return false; + + } + + @Override + public TileEntity createNewTileEntity(World var1) + { + return new TileEntityTank(); + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + + return new ItemStack(this, 1, meta); + + } +} diff --git a/minecraft/liquidmechanics/common/handlers/LiquidData.java b/minecraft/liquidmechanics/common/handlers/LiquidData.java index 1c359de0..c3426d2b 100644 --- a/minecraft/liquidmechanics/common/handlers/LiquidData.java +++ b/minecraft/liquidmechanics/common/handlers/LiquidData.java @@ -1,6 +1,6 @@ package liquidmechanics.common.handlers; -import liquidmechanics.api.helpers.Colors; +import liquidmechanics.api.helpers.PipeColor; import net.minecraftforge.liquids.LiquidStack; public class LiquidData @@ -9,9 +9,9 @@ public class LiquidData private int defaultPressure; private LiquidStack sampleStack; private String name; - private Colors color; + private PipeColor color; - public LiquidData(String name, LiquidStack stack,Colors color, boolean gas, int dPressure) + public LiquidData(String name, LiquidStack stack,PipeColor color, boolean gas, int dPressure) { this.sampleStack = stack; this.isAGas = gas; @@ -38,10 +38,10 @@ public class LiquidData { return isAGas; } - public Colors getColor() + public PipeColor getColor() { if (color != null) { return color; } - return Colors.NONE; + return PipeColor.NONE; } } diff --git a/minecraft/liquidmechanics/common/handlers/LiquidHandler.java b/minecraft/liquidmechanics/common/handlers/LiquidHandler.java index 1e25ef54..32064fb2 100644 --- a/minecraft/liquidmechanics/common/handlers/LiquidHandler.java +++ b/minecraft/liquidmechanics/common/handlers/LiquidHandler.java @@ -3,7 +3,7 @@ package liquidmechanics.common.handlers; import java.util.ArrayList; import java.util.List; -import liquidmechanics.api.helpers.Colors; +import liquidmechanics.api.helpers.PipeColor; import liquidmechanics.common.LiquidMechanics; import liquidmechanics.common.tileentity.TileEntityPipe; import net.minecraft.block.Block; @@ -29,14 +29,12 @@ public class LiquidHandler * Called to add the default liquids to the allowed list */ public static void addDefaultLiquids() - { - steam = new LiquidData("Steam", LiquidDictionary.getOrCreateLiquid("Steam", new LiquidStack(LiquidMechanics.blockSteamBlock, 1)),Colors.ORANGE, true, 100); - allowedLiquids.add(steam); - water = new LiquidData("water", LiquidDictionary.getOrCreateLiquid("Water", new LiquidStack(Block.waterStill, 1)),Colors.BLUE, false, 32); + { + water = new LiquidData("water", LiquidDictionary.getOrCreateLiquid("Water", new LiquidStack(Block.waterStill, 1)), PipeColor.BLUE, false, 32); allowedLiquids.add(water); - lava = new LiquidData("Lava", LiquidDictionary.getOrCreateLiquid("Lava", new LiquidStack(Block.lavaStill, 1)),Colors.RED, false, 20); + lava = new LiquidData("Lava", LiquidDictionary.getOrCreateLiquid("Lava", new LiquidStack(Block.lavaStill, 1)), PipeColor.RED, false, 20); allowedLiquids.add(lava); - air = new LiquidData("Air", LiquidDictionary.getOrCreateLiquid("Air", new LiquidStack(0, 1)),Colors.NONE, false, 0); + air = new LiquidData("Air", LiquidDictionary.getOrCreateLiquid("Air", new LiquidStack(0, 1)), PipeColor.NONE, false, 0); allowedLiquids.add(air); } @@ -45,7 +43,22 @@ public class LiquidHandler { // TODO use this to add new liquid types to the data list // or something along the lines of IDing liquids for use - + if (event.Name.equalsIgnoreCase("methane")) + { + this.allowedLiquids.add(new LiquidData("methane", event.Liquid, PipeColor.LIME, true, 100)); + } + else if (event.Name.equalsIgnoreCase("oil")) + { + this.allowedLiquids.add(new LiquidData("oil", event.Liquid, PipeColor.BLACK, true, 30)); + } + else if (event.Name.equalsIgnoreCase("fuel")) + { + this.allowedLiquids.add(new LiquidData("fuel", event.Liquid, PipeColor.YELLOW, true, 50)); + } + else if (event.Name.equalsIgnoreCase("steam")) + { + this.steam =new LiquidData("steam", event.Liquid, PipeColor.ORANGE, true, 100); + } } /** @@ -77,7 +90,7 @@ public class LiquidHandler */ public static LiquidStack getStack(LiquidData type, int vol) { - if(type == null) return null; + if (type == null) return null; return new LiquidStack(type.getStack().itemID, vol, type.getStack().itemMeta); } @@ -127,6 +140,7 @@ public class LiquidHandler if (type.getStack().itemID == stack.itemID && type.getStack().itemMeta == stack.itemMeta) { return true; } return false; } + public static boolean isEqual(LiquidStack stack, LiquidStack type) { if (stack == null || type == null) @@ -134,6 +148,7 @@ public class LiquidHandler if (type.itemID == stack.itemID && type.itemMeta == stack.itemMeta) { return true; } return false; } + public static ItemStack consumeItem(ItemStack stack) { if (stack.stackSize == 1) diff --git a/minecraft/liquidmechanics/common/handlers/PipeCreator.java b/minecraft/liquidmechanics/common/handlers/PipeCreator.java deleted file mode 100644 index 1a0db9f9..00000000 --- a/minecraft/liquidmechanics/common/handlers/PipeCreator.java +++ /dev/null @@ -1,20 +0,0 @@ -package liquidmechanics.common.handlers; - -import net.minecraftforge.liquids.LiquidDictionary.LiquidRegisterEvent; -/** - * WIP unknown if this can actual work fully - * @author Rseifert - * - */ -public class PipeCreator -{ - /** - * used to create a new pipe type - */ - public static void createNewPipe(LiquidRegisterEvent event) - { - - } - - -} diff --git a/minecraft/liquidmechanics/common/handlers/PipeInstance.java b/minecraft/liquidmechanics/common/handlers/PipeInstance.java index e7eac29e..bd36c147 100644 --- a/minecraft/liquidmechanics/common/handlers/PipeInstance.java +++ b/minecraft/liquidmechanics/common/handlers/PipeInstance.java @@ -1,19 +1,18 @@ package liquidmechanics.common.handlers; +import liquidmechanics.api.helpers.PipeColor; import liquidmechanics.common.tileentity.TileEntityPipe; /** * used to keep track of a pipe, its meta, and if Universal */ public class PipeInstance { - public int color; + public PipeColor color; public TileEntityPipe pipe; - public boolean any; - - public PipeInstance(int color, TileEntityPipe pipe, boolean any) + //colors + public PipeInstance(PipeColor cc, TileEntityPipe pipe) { - this.color = color; + this.color = cc; this.pipe = pipe; - this.any = any; } } diff --git a/minecraft/liquidmechanics/common/handlers/UpdateConverter.java b/minecraft/liquidmechanics/common/handlers/UpdateConverter.java index 30dc9602..7af351e8 100644 --- a/minecraft/liquidmechanics/common/handlers/UpdateConverter.java +++ b/minecraft/liquidmechanics/common/handlers/UpdateConverter.java @@ -1,8 +1,9 @@ package liquidmechanics.common.handlers; import net.minecraft.nbt.NBTTagCompound; -import liquidmechanics.api.helpers.Colors; +import liquidmechanics.api.helpers.PipeColor; import liquidmechanics.common.tileentity.TileEntityPipe; +import liquidmechanics.common.tileentity.TileEntityTank; /** * used to help convert older system to newer systems. @@ -15,14 +16,28 @@ public class UpdateConverter Boolean converted25 = nbt.getBoolean("converted025"); if (!converted24) { - pipe.setColor(Colors.get(LiquidHandler.getFromMeta(nbt.getInteger("type")))); + pipe.setColor(PipeColor.get(LiquidHandler.getFromMeta(nbt.getInteger("type")))); } else if (converted24 && !converted25) { - pipe.setColor(Colors.get(LiquidHandler.get(nbt.getString("name")))); + pipe.setColor(PipeColor.get(LiquidHandler.get(nbt.getString("name")))); + } + nbt.setBoolean("converted", true); + nbt.setBoolean("converted025", true); + } + public static void convert(TileEntityTank pipe, NBTTagCompound nbt) + { + Boolean converted24 = nbt.getBoolean("converted"); + Boolean converted25 = nbt.getBoolean("converted025"); + if (!converted24) + { + pipe.setColor(PipeColor.get(LiquidHandler.getFromMeta(nbt.getInteger("type")))); + } + else if (converted24 && !converted25) + { + pipe.setColor(PipeColor.get(LiquidHandler.get(nbt.getString("name")))); } nbt.setBoolean("converted", true); nbt.setBoolean("converted025", true); } - } diff --git a/minecraft/liquidmechanics/common/item/ItemPipe.java b/minecraft/liquidmechanics/common/item/ItemPipe.java deleted file mode 100644 index c320b43e..00000000 --- a/minecraft/liquidmechanics/common/item/ItemPipe.java +++ /dev/null @@ -1,135 +0,0 @@ -package liquidmechanics.common.item; - -import java.util.List; - -import liquidmechanics.api.helpers.Colors; -import liquidmechanics.common.LiquidMechanics; -import liquidmechanics.common.TabLiquidMechanics; -import liquidmechanics.common.handlers.LiquidHandler; -import liquidmechanics.common.tileentity.TileEntityPipe; -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class ItemPipe extends Item -{ - int index = 32; - private int spawnID; - - public ItemPipe(int id) - { - super(id); - this.setMaxDamage(0); - this.setIconIndex(10); - this.setItemName("itemPipe"); - this.setCreativeTab(TabLiquidMechanics.INSTANCE); - } - - @Override - public int getIconFromDamage(int par1) - { - - return par1 + index; - } - - @Override - public String getItemNameIS(ItemStack itemstack) - { - return "pipe"; - } - - @Override - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - for (int i = 0; i < LiquidHandler.allowedLiquids.size() - 1; i++) - { - par3List.add(new ItemStack(this, 1, i)); - } - } - - public String getTextureFile() - { - return LiquidMechanics.ITEM_TEXTURE_FILE; - } - - @Override - public String getItemName() - { - return "Pipes"; - } - - @Override - public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World par3World, int x, int y, int z, int par7, float par8, float par9, float par10) - { - int blockID = par3World.getBlockId(x, y, z); - spawnID = LiquidMechanics.blockPipe.blockID; - if (blockID == Block.snow.blockID) - { - par7 = 1; - } - else if (blockID != Block.vine.blockID && blockID != Block.tallGrass.blockID && blockID != Block.deadBush.blockID) - { - if (par7 == 0) - { - --y; - } - - if (par7 == 1) - { - ++y; - } - - if (par7 == 2) - { - --z; - } - - if (par7 == 3) - { - ++z; - } - - if (par7 == 4) - { - --x; - } - - if (par7 == 5) - { - ++x; - } - } - - if (LiquidMechanics.blockPipe.canPlaceBlockAt(par3World, x, y, z)) - { - Block var9 = Block.blocksList[this.spawnID]; - par3World.editingBlocks = true; - if (par3World.setBlockWithNotify(x, y, z, var9.blockID)) - { - if (par3World.getBlockId(x, y, z) == var9.blockID) - { - - Block.blocksList[this.spawnID].onBlockAdded(par3World, x, y, z); - Block.blocksList[this.spawnID].onBlockPlacedBy(par3World, x, y, z, player); - TileEntity blockEntity = par3World.getBlockTileEntity(x, y, z); - if (blockEntity instanceof TileEntityPipe) - { - TileEntityPipe pipeEntity = (TileEntityPipe) blockEntity; - par3World.setBlockMetadataWithNotify(x,y,z,Colors.NONE.ordinal()); - } - } - - --itemstack.stackSize; - par3World.editingBlocks = false; - return true; - } - } - par3World.editingBlocks = false; - return false; - } - -} \ No newline at end of file diff --git a/minecraft/liquidmechanics/common/item/ItemTank.java b/minecraft/liquidmechanics/common/item/ItemTank.java deleted file mode 100644 index 4e5e3385..00000000 --- a/minecraft/liquidmechanics/common/item/ItemTank.java +++ /dev/null @@ -1,138 +0,0 @@ -package liquidmechanics.common.item; - -import java.util.List; - -import liquidmechanics.common.LiquidMechanics; -import liquidmechanics.common.TabLiquidMechanics; -import liquidmechanics.common.handlers.LiquidData; -import liquidmechanics.common.handlers.LiquidHandler; -import liquidmechanics.common.tileentity.TileEntityTank; -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class ItemTank extends Item -{ - int index = 64;// 64 + 2 rows alloted to pipes - private int spawnID; - - public ItemTank(int id) - { - super(id); - this.setMaxDamage(0); - this.setHasSubtypes(true); - this.setIconIndex(10); - this.setItemName("itemTank"); - this.setCreativeTab(TabLiquidMechanics.INSTANCE); - } - - @Override - public int getIconFromDamage(int par1) - { - - return par1 + index; - } - - @Override - public String getItemNameIS(ItemStack itemstack) - { - return "Tank"; - } - - @Override - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - for (int i = 0; i < LiquidHandler.allowedLiquids.size() -1; i++) - { - par3List.add(new ItemStack(this, 1, i)); - } - } - - public String getTextureFile() - { - return LiquidMechanics.ITEM_TEXTURE_FILE; - } - - @Override - public String getItemName() - { - return "Pipes"; - } - - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) - { - int blockID = par3World.getBlockId(par4, par5, par6); - spawnID = LiquidMechanics.blockMachine.blockID; - if (blockID == Block.snow.blockID) - { - par7 = 1; - } - else if (blockID != Block.vine.blockID && blockID != Block.tallGrass.blockID && blockID != Block.deadBush.blockID) - { - if (par7 == 0) - { - --par5; - } - - if (par7 == 1) - { - ++par5; - } - - if (par7 == 2) - { - --par6; - } - - if (par7 == 3) - { - ++par6; - } - - if (par7 == 4) - { - --par4; - } - - if (par7 == 5) - { - ++par4; - } - } - - if (LiquidMechanics.blockPipe.canPlaceBlockAt(par3World, par4, par5, par6)) - { - Block var9 = Block.blocksList[this.spawnID]; - par3World.editingBlocks = true; - if (par3World.setBlockAndMetadataWithNotify(par4, par5, par6, var9.blockID, 5)) - { - if (par3World.getBlockId(par4, par5, par6) == var9.blockID) - { - - Block.blocksList[this.spawnID].onBlockAdded(par3World, par4, par5, par6); - Block.blocksList[this.spawnID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer); - TileEntity blockEntity = par3World.getBlockTileEntity(par4, par5, par6); - if (blockEntity instanceof TileEntityTank) - { - TileEntityTank pipeEntity = (TileEntityTank) blockEntity; - LiquidData dm = LiquidHandler.getFromMeta(par1ItemStack.getItemDamage()); - pipeEntity.setType(dm); - pipeEntity.converted = true; - } - } - - --par1ItemStack.stackSize; - par3World.editingBlocks = false; - return true; - } - } - par3World.editingBlocks = false; - return false; - } - -} \ No newline at end of file diff --git a/minecraft/liquidmechanics/common/tileentity/TileEntityGenerator.java b/minecraft/liquidmechanics/common/tileentity/TileEntityGenerator.java index 7d56dc75..01aef30b 100644 --- a/minecraft/liquidmechanics/common/tileentity/TileEntityGenerator.java +++ b/minecraft/liquidmechanics/common/tileentity/TileEntityGenerator.java @@ -4,7 +4,7 @@ import java.util.EnumSet; import liquidmechanics.api.IForce; import liquidmechanics.api.IReadOut; -import liquidmechanics.api.helpers.TankHelper; +import liquidmechanics.api.helpers.connectionHelper; import liquidmechanics.common.LiquidMechanics; import liquidmechanics.common.MetaGroup; import liquidmechanics.common.block.BlockGenerator; @@ -76,7 +76,7 @@ public class TileEntityGenerator extends TileEntityElectricityProducer implement this.genAmmount = Math.abs(force / this.getVoltage()); // wire count update int wireCount = 0; - TileEntity[] ents = TankHelper.getSurroundings(worldObj, xCoord, yCoord, zCoord); + TileEntity[] ents = connectionHelper.getSurroundings(worldObj, xCoord, yCoord, zCoord); this.wires = new IConductor[6]; for (int i = 0; i < ents.length; i++) { diff --git a/minecraft/liquidmechanics/common/tileentity/TileEntityPipe.java b/minecraft/liquidmechanics/common/tileentity/TileEntityPipe.java index 4e7bbb90..b78179bd 100644 --- a/minecraft/liquidmechanics/common/tileentity/TileEntityPipe.java +++ b/minecraft/liquidmechanics/common/tileentity/TileEntityPipe.java @@ -2,8 +2,8 @@ package liquidmechanics.common.tileentity; import liquidmechanics.api.IReadOut; import liquidmechanics.api.IPressure; -import liquidmechanics.api.helpers.Colors; -import liquidmechanics.api.helpers.TankHelper; +import liquidmechanics.api.helpers.PipeColor; +import liquidmechanics.api.helpers.connectionHelper; import liquidmechanics.common.LiquidMechanics; import liquidmechanics.common.handlers.LiquidData; import liquidmechanics.common.handlers.LiquidHandler; @@ -28,7 +28,7 @@ import com.google.common.io.ByteArrayDataInput; public class TileEntityPipe extends TileEntity implements ITankContainer, IPacketReceiver, IReadOut { - private Colors color = Colors.NONE; + private PipeColor color = PipeColor.NONE; private int count = 40; private int count2, presure = 0; @@ -47,7 +47,7 @@ public class TileEntityPipe extends TileEntity implements ITankContainer, IPacke { count = 0; this.validataConnections(); - this.color = Colors.get(worldObj.getBlockMetadata(xCoord, yCoord, zCoord)); + this.color = PipeColor.get(worldObj.getBlockMetadata(xCoord, yCoord, zCoord)); if (!worldObj.isRemote) { this.updatePressure(); @@ -97,7 +97,7 @@ public class TileEntityPipe extends TileEntity implements ITankContainer, IPacke /** * gets the current color mark of the pipe */ - public Colors getColor() + public PipeColor getColor() { return this.color; } @@ -105,18 +105,19 @@ public class TileEntityPipe extends TileEntity implements ITankContainer, IPacke /** * sets the current color mark of the pipe */ - public void setColor(Colors cc) + public void setColor(PipeColor cc) { this.color = cc; } + /** * sets the current color mark of the pipe */ public void setColor(int i) { - if (i < Colors.values().length) + if (i < PipeColor.values().length) { - this.color = Colors.values()[i]; + this.color = PipeColor.values()[i]; } } @@ -145,7 +146,8 @@ public class TileEntityPipe extends TileEntity implements ITankContainer, IPacke { super.readFromNBT(nbt); UpdateConverter.convert(this, nbt); - LiquidStack stack = LiquidStack.loadLiquidStackFromNBT(nbt); + NBTTagCompound stored = nbt.getCompoundTag("stored"); + LiquidStack stack = LiquidStack.loadLiquidStackFromNBT(stored); this.stored.setLiquid(stack); } @@ -155,16 +157,16 @@ public class TileEntityPipe extends TileEntity implements ITankContainer, IPacke @Override public void writeToNBT(NBTTagCompound nbt) { - super.writeToNBT(nbt); + super.writeToNBT(nbt); if (stored.getLiquid() != null) { - stored.getLiquid().writeToNBT(nbt); + nbt.setCompoundTag("stored", stored.getLiquid().writeToNBT(nbt)); } } @Override public String getMeterReading(EntityPlayer user, ForgeDirection side) - { + { return "ReadOut not setup"; } @@ -216,20 +218,28 @@ public class TileEntityPipe extends TileEntity implements ITankContainer, IPacke */ public void validataConnections() { - this.connectedBlocks = TankHelper.getSurroundings(worldObj, xCoord, yCoord, zCoord); + this.connectedBlocks = connectionHelper.getSurroundings(worldObj, xCoord, yCoord, zCoord); for (int i = 0; i < 6; i++) { + ForgeDirection dir = ForgeDirection.getOrientation(i); TileEntity ent = connectedBlocks[i]; if (ent instanceof ITankContainer) { - if (ent instanceof TileEntityPipe) + if (ent instanceof TileEntityPipe && color != ((TileEntityPipe) ent).getColor()) { - + connectedBlocks[i] = null; + } + if(ent instanceof TileEntityTank && color != ((TileEntityTank)ent).getColor()) + { + connectedBlocks[i] = null; } } else if (ent instanceof IPressure) { - + if (!((IPressure) ent).canPressureToo(color.getLiquidData(), dir)) + { + connectedBlocks[i] = null; + } } else { diff --git a/minecraft/liquidmechanics/common/tileentity/TileEntityPump.java b/minecraft/liquidmechanics/common/tileentity/TileEntityPump.java index 1f1e413f..11ad0f37 100644 --- a/minecraft/liquidmechanics/common/tileentity/TileEntityPump.java +++ b/minecraft/liquidmechanics/common/tileentity/TileEntityPump.java @@ -358,10 +358,4 @@ public class TileEntityPump extends TileEntityElectricityReceiver implements IPa return false; } - @Override - public LiquidData getLiquidType() - { - return this.type; - } - } diff --git a/minecraft/liquidmechanics/common/tileentity/TileEntityReleaseValve.java b/minecraft/liquidmechanics/common/tileentity/TileEntityReleaseValve.java index 68f9a319..fc5df03d 100644 --- a/minecraft/liquidmechanics/common/tileentity/TileEntityReleaseValve.java +++ b/minecraft/liquidmechanics/common/tileentity/TileEntityReleaseValve.java @@ -1,11 +1,14 @@ package liquidmechanics.common.tileentity; +import java.nio.channels.Pipe; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import liquidmechanics.api.IPressure; import liquidmechanics.api.IReadOut; -import liquidmechanics.api.helpers.TankHelper; +import liquidmechanics.api.helpers.PipeColor; +import liquidmechanics.api.helpers.connectionHelper; import liquidmechanics.common.block.BlockReleaseValve; import liquidmechanics.common.handlers.LiquidData; import liquidmechanics.common.handlers.LiquidHandler; @@ -25,8 +28,7 @@ import universalelectricity.prefab.implement.IRedstoneReceptor; public class TileEntityReleaseValve extends TileEntity implements IPressure, IReadOut, IRedstoneReceptor, IInventory { - public LiquidData type = LiquidHandler.air; - + public boolean[] allowed = new boolean[PipeColor.values().length]; public TileEntity[] connected = new TileEntity[6]; private List output = new ArrayList(); @@ -36,7 +38,6 @@ public class TileEntityReleaseValve extends TileEntity implements IPressure, IRe public boolean isPowered = false; public boolean converted = false; - public boolean isRestricted = false; private ItemStack[] inventory = new ItemStack[0]; @@ -48,11 +49,81 @@ public class TileEntityReleaseValve extends TileEntity implements IPressure, IRe if (!this.worldObj.isRemote && ticks++ == 10) { BlockReleaseValve.checkForPower(worldObj, xCoord, yCoord, zCoord); - validateNBuildList(); + //start the draining process + if (this.input.size() > 0 && this.output.size() > 0) + { + Iterator itr = input.iterator(); + // testing out Iterators :p + while (itr.hasNext()) + { + Object element = itr.next(); + if (element instanceof ILiquidTank) + { + ILiquidTank tank = (ILiquidTank) element; + if (tank.getLiquid() != null && tank.getLiquid().amount < tank.getCapacity()) + { + TileEntityPipe pipe = this.findValidPipe(tank.getLiquid()); + if (pipe != null) + { + int drain = pipe.stored.fill(tank.getLiquid(), true); + tank.drain(drain, true); + break; + } + } + } + } + } } } + /** + * used to find a valid pipe for filling of the liquid type + */ + public TileEntityPipe findValidPipe(LiquidStack stack) + { + LiquidData data = LiquidHandler.get(stack); + if (data != LiquidHandler.air) + { + for (PipeInstance pipe : output) + { + if (pipe.color == data.getColor() && (pipe.pipe.stored.getLiquid() == null || pipe.pipe.stored.getLiquid().amount < pipe.pipe.stored.getCapacity())) { return pipe.pipe; } + } + } + return null; + } + + /** + * sees if it can connect to a pipe of some color + */ + public boolean canConnect(PipeColor cc) + { + for (int i = 0; i < this.allowed.length; i++) + { + if (allowed[i] && i == cc.ordinal()) { return true; } + } + return false; + } + + /** + * if any of allowed list is true + * + * @return true + */ + public boolean isRestricted() + { + for (int i = 0; i < this.allowed.length; i++) + { + if (allowed[i]) { return true; } + } + return false; + } + + public boolean canAcceptLiquid(LiquidStack stack) + { + return canConnect(PipeColor.get(LiquidHandler.get(stack))); + } + /** * Collects info about the surrounding 6 tiles and orders them into * drain-able(ITankContainer) and fill-able(TileEntityPipes) instances @@ -60,7 +131,7 @@ public class TileEntityReleaseValve extends TileEntity implements IPressure, IRe public void validateNBuildList() { // cleanup - this.connected = TankHelper.getSurroundings(worldObj, xCoord, yCoord, zCoord); + this.connected = connectionHelper.getSurroundings(worldObj, xCoord, yCoord, zCoord); this.input.clear(); this.output.clear(); // read surroundings @@ -71,7 +142,7 @@ public class TileEntityReleaseValve extends TileEntity implements IPressure, IRe if (ent instanceof TileEntityPipe) { TileEntityPipe pipe = (TileEntityPipe) ent; - if (this.isRestricted && pipe.type != this.type) + if (this.isRestricted() && this.canConnect(pipe.getColor())) { connected[i] = null; } @@ -81,7 +152,7 @@ public class TileEntityReleaseValve extends TileEntity implements IPressure, IRe } else { - this.output.add(new PipeInstance(LiquidHandler.getMeta(pipe.type), pipe, pipe.isUniversal)); + this.output.add(new PipeInstance(pipe.getColor(), pipe)); } } else if (ent instanceof ITankContainer) @@ -93,9 +164,9 @@ public class TileEntityReleaseValve extends TileEntity implements IPressure, IRe if (ll != null && ll.amount > 0 && ll.amount < tanks[t].getCapacity()) { // if restricted check for type match - if (this.isRestricted) + if (this.isRestricted()) { - if (LiquidHandler.isEqual(ll, this.type)) + if (this.canAcceptLiquid(ll)) { this.input.add(tanks[t]); } @@ -114,45 +185,34 @@ public class TileEntityReleaseValve extends TileEntity implements IPressure, IRe } } - /** - * removes liquid from a tank and fills it to a pipe - * - * @param pipe - * - pipe being filled - * @param drainee - * - LiquidTank being drained - */ - public void drainTo(TileEntityPipe pipe, LiquidTank drainee) - { - - } - @Override public int presureOutput(LiquidData type, ForgeDirection dir) { - if (type == this.type) { return LiquidData.getPressure(type); } + if (type == null) return 0; + if (this.canConnect(type.getColor())) { return type.getPressure(); } return 0; } @Override public boolean canPressureToo(LiquidData type, ForgeDirection dir) { - if (type == this.type) - return true; + if (type == null) return false; + if (this.canConnect(type.getColor())) return true; return false; } @Override public String getMeterReading(EntityPlayer user, ForgeDirection side) { - if (type == null) return "Error: No Type"; + // TODO maybe debug on # of connected units of input/output String output = ""; - if (this.isRestricted) + if (this.isRestricted()) { - output +="Outputting: "+ LiquidData.getName(type)+" ||"; - }else + output += "Output: Restricted and"; + } + else { - output += " Outputting: All ||"; + output += " Output: UnRestricted and"; } if (!this.isPowered) { @@ -169,8 +229,10 @@ public class TileEntityReleaseValve extends TileEntity implements IPressure, IRe public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); - this.type = LiquidHandler.get(nbt.getString("name")); - this.isRestricted = nbt.getBoolean("restricted"); + for (int i = 0; i < this.allowed.length; i++) + { + allowed[i] = nbt.getBoolean("allowed" + i); + } } /** @@ -180,14 +242,10 @@ public class TileEntityReleaseValve extends TileEntity implements IPressure, IRe public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); - nbt.setBoolean("restricted", this.isRestricted); - nbt.setString("name", LiquidData.getName(type)); - } - - public void setType(LiquidData dm) - { - this.type = dm; - + for (int i = 0; i < this.allowed.length; i++) + { + nbt.setBoolean("allowed" + i, allowed[i]); + } } @Override @@ -315,10 +373,4 @@ public class TileEntityReleaseValve extends TileEntity implements IPressure, IRe } - @Override - public LiquidData getLiquidType() - { - return this.type; - } - } diff --git a/minecraft/liquidmechanics/common/tileentity/TileEntityTank.java b/minecraft/liquidmechanics/common/tileentity/TileEntityTank.java index 891f5b31..6627acdc 100644 --- a/minecraft/liquidmechanics/common/tileentity/TileEntityTank.java +++ b/minecraft/liquidmechanics/common/tileentity/TileEntityTank.java @@ -1,11 +1,15 @@ package liquidmechanics.common.tileentity; +import javax.swing.colorchooser.ColorSelectionModel; + import liquidmechanics.api.IReadOut; import liquidmechanics.api.IPressure; -import liquidmechanics.api.helpers.TankHelper; +import liquidmechanics.api.helpers.PipeColor; +import liquidmechanics.api.helpers.connectionHelper; import liquidmechanics.common.LiquidMechanics; import liquidmechanics.common.handlers.LiquidData; import liquidmechanics.common.handlers.LiquidHandler; +import liquidmechanics.common.handlers.UpdateConverter; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.INetworkManager; @@ -24,37 +28,50 @@ import universalelectricity.prefab.network.PacketManager; import com.google.common.io.ByteArrayDataInput; -public class TileEntityTank extends TileEntity implements IPacketReceiver, IReadOut, IPressure,ITankContainer +public class TileEntityTank extends TileEntity implements IPacketReceiver, IReadOut, IPressure, ITankContainer { public TileEntity[] cc = { null, null, null, null, null, null }; + public LiquidData type = LiquidHandler.air; + + private PipeColor color = PipeColor.NONE; + public static final int LMax = 4; - private int count = 0; - private int count2 = 0; - public boolean converted = false; + private int count, count2 = 0; + + public int volume; + public int pVolume = 0; private boolean doUpdate = true; public LiquidTank tank = new LiquidTank(LiquidContainerRegistry.BUCKET_VOLUME * LMax); public void updateEntity() { - if (tank.getLiquid() == null) + if (tank.getLiquid() == null && type != LiquidHandler.air) { tank.setLiquid(LiquidHandler.getStack(this.type, 1)); } + LiquidStack liquid = tank.getLiquid(); if (++count >= 20 && liquid != null) { count = 0; - this.cc = TankHelper.getSurroundings(worldObj, xCoord, yCoord, zCoord); + this.cc = connectionHelper.getSurroundings(worldObj, xCoord, yCoord, zCoord); if (!worldObj.isRemote) { + this.type = color.getLiquidData(); + this.tradeDown(); this.tradeArround(); + volume = liquid.amount; - Packet packet = PacketManager.getPacket(LiquidMechanics.CHANNEL, this, new Object[] { LiquidData.getName(type), liquid.amount }); - PacketManager.sendPacketToClients(packet, worldObj, new Vector3(this), 20); + if (volume != pVolume) + { + Packet packet = PacketManager.getPacket(LiquidMechanics.CHANNEL, this, new Object[] { volume }); + PacketManager.sendPacketToClients(packet, worldObj, new Vector3(this), 20); + } + pVolume = volume; } } @@ -63,47 +80,28 @@ public class TileEntityTank extends TileEntity implements IPacketReceiver, IRead @Override public String getMeterReading(EntityPlayer user, ForgeDirection side) { - if (type == null) return "Error: No Type"; - String output = ""; - LiquidStack stack = tank.getLiquid(); - if (stack != null) - output += (stack.amount / LiquidContainerRegistry.BUCKET_VOLUME) + " " + LiquidData.getName(type); - if (stack != null) - return output; - return "0/4 " + LiquidData.getName(type); + if (volume == 0) { return "empty"; } + return (volume / LiquidContainerRegistry.BUCKET_VOLUME) + "/" + (tank.getCapacity() / LiquidContainerRegistry.BUCKET_VOLUME) + " " + type.getName(); } @Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); - this.converted = nbt.getBoolean("converted"); - if (!converted) - { - int t = nbt.getInteger("type"); - this.type = LiquidHandler.getFromMeta(t); - this.converted = true; - } - else - { - this.type = LiquidHandler.get(nbt.getString("name")); - } - - if (this.type == null) type = LiquidHandler.air; - int vol = nbt.getInteger("liquid"); - this.tank.setLiquid(LiquidHandler.getStack(type, vol)); + UpdateConverter.convert(this, nbt); + NBTTagCompound stored = nbt.getCompoundTag("stored"); + LiquidStack stack = LiquidStack.loadLiquidStackFromNBT(stored); + this.tank.setLiquid(stack); } @Override public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); - nbt.setBoolean("converted", this.converted); - int s = 0; - if (tank.getLiquid() != null) s = tank.getLiquid().amount; - nbt.setInteger("liquid", s); - - nbt.setString("name", LiquidData.getName(type)); + if (tank.getLiquid() != null) + { + nbt.setCompoundTag("stored", tank.getLiquid().writeToNBT(nbt)); + } } @Override @@ -111,8 +109,7 @@ public class TileEntityTank extends TileEntity implements IPacketReceiver, IRead { try { - this.type = LiquidHandler.get(data.readUTF()); - this.tank.setLiquid(LiquidHandler.getStack(this.type, data.readInt())); + this.volume = data.readInt(); } catch (Exception e) { @@ -152,7 +149,7 @@ public class TileEntityTank extends TileEntity implements IPacketReceiver, IRead if (this.isFull()) { int change = 1; - if (LiquidData.getCanFloat(LiquidHandler.get(resource))) + if (LiquidHandler.get(resource).getCanFloat()) change = -1; TileEntity tank = worldObj.getBlockTileEntity(xCoord, yCoord + change, zCoord); if (tank instanceof TileEntityTank) { return ((TileEntityTank) tank).tank.fill(resource, doFill); } @@ -249,10 +246,10 @@ public class TileEntityTank extends TileEntity implements IPacketReceiver, IRead { if (type == this.type) { - if (LiquidData.getCanFloat(type) && dir == ForgeDirection.DOWN) - return LiquidData.getPressure(type); - if (!LiquidData.getCanFloat(type) && dir == ForgeDirection.UP) - return LiquidData.getPressure(type); + if (type.getCanFloat() && dir == ForgeDirection.DOWN) + return type.getPressure(); + if (!type.getCanFloat() && dir == ForgeDirection.UP) + return type.getPressure(); } return 0; } @@ -262,9 +259,9 @@ public class TileEntityTank extends TileEntity implements IPacketReceiver, IRead { if (type == this.type) { - if (LiquidData.getCanFloat(type) && dir == ForgeDirection.DOWN) + if (type.getCanFloat() && dir == ForgeDirection.DOWN) return true; - if (!LiquidData.getCanFloat(type) && dir == ForgeDirection.UP) + if (!type.getCanFloat() && dir == ForgeDirection.UP) return true; } return false; @@ -293,12 +290,12 @@ public class TileEntityTank extends TileEntity implements IPacketReceiver, IRead { if (this.tank.getLiquid() == null || this.tank.getLiquid().amount <= 0) return; - TileEntity[] ents = TankHelper.getSurroundings(worldObj, xCoord, yCoord, zCoord); + TileEntity[] ents = connectionHelper.getSurroundings(worldObj, xCoord, yCoord, zCoord); int commonVol = this.tank.getLiquid().amount; int tanks = 1; for (int i = 2; i < 6; i++) { - if (ents[i] instanceof TileEntityTank && ((TileEntityTank) ents[i]).type == this.type) + if (ents[i] instanceof TileEntityTank && ((TileEntityTank) ents[i]).color == this.color) { tanks++; if (((TileEntityTank) ents[i]).tank.getLiquid() != null) @@ -313,7 +310,7 @@ public class TileEntityTank extends TileEntity implements IPacketReceiver, IRead if (this.tank.getLiquid() == null || this.tank.getLiquid().amount <= equalVol) break; - if (ents[i] instanceof TileEntityTank && ((TileEntityTank) ents[i]).type == this.type && !((TileEntityTank) ents[i]).isFull()) + if (ents[i] instanceof TileEntityTank && ((TileEntityTank) ents[i]).color == this.color && !((TileEntityTank) ents[i]).isFull()) { LiquidStack stack = ((TileEntityTank) ents[i]).tank.getLiquid(); LiquidStack filling = this.tank.getLiquid(); @@ -336,9 +333,14 @@ public class TileEntityTank extends TileEntity implements IPacketReceiver, IRead } } - @Override - public LiquidData getLiquidType() + public void setColor(PipeColor pipeColor) { - return this.type; + this.color = pipeColor; + + } + + public PipeColor getColor() + { + return color; } } diff --git a/minecraft/liquidmechanics/resource/lang/en_US.properties b/minecraft/liquidmechanics/resource/lang/en_US.properties index dce8901b..b9c77f97 100644 --- a/minecraft/liquidmechanics/resource/lang/en_US.properties +++ b/minecraft/liquidmechanics/resource/lang/en_US.properties @@ -7,7 +7,8 @@ tile.lmMachines.0.name=Pump tile.lmMachines.4.name=Condensor tile.MechanicRod.name=Geared Rod tile.eValve.name=Release Valve - +tile.lmTank.name = Tank +tile.lmPipe.name = Pipe # Items item.lmTool.0.name=Pipe Guage @@ -24,7 +25,3 @@ item.itemPipe.0.name=Steam Pipe item.itemPipe.1.name=Water Pipe item.itemPipe.2.name=Lava Pipe -item.itemTank.0.name=Steam Tank -item.itemTank.1.name=Water Tank -item.itemTank.2.name=Lava Tank - diff --git a/minecraft/liquidmechanics/resource/tanks/LiquidTankCorner.png b/minecraft/liquidmechanics/resource/tanks/Corner.png similarity index 100% rename from minecraft/liquidmechanics/resource/tanks/LiquidTankCorner.png rename to minecraft/liquidmechanics/resource/tanks/Corner.png diff --git a/minecraft/liquidmechanics/resource/tanks/LiquidTankCornerWater.png b/minecraft/liquidmechanics/resource/tanks/CornerWater.png similarity index 100% rename from minecraft/liquidmechanics/resource/tanks/LiquidTankCornerWater.png rename to minecraft/liquidmechanics/resource/tanks/CornerWater.png diff --git a/minecraft/liquidmechanics/resource/tanks/LiquidTank.png b/minecraft/liquidmechanics/resource/tanks/LiquidTank.png deleted file mode 100644 index cfd08774b2dc50aece3a249f5e7a485216473b5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 487 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSY)RhkE)4%caKYZ?lYt_f1s;*b z3=DjSL74G){)!Z!AbW|YuPggqMizb@gCmF7I~f=lOFUg1Ln>~)y*f9h`LXrQfdu=!_odVP&u!mHZ4bdG!d#f;hO z8Lo$wy4e4IxiDJmpsuL)qVrp?oj=Jv@pC`d2RE;qS3C4vOAbG&Up^&k>$CH@)3%w% zuX5Y}`0@LwQ*}T7NI5waGrXI-B%MuTk@wO!zW<_TAGpkQfQz}{9`gbw5Hxrmdmwww zAG_sOmUmpfIA>G)+1DHgwC_#2#T39O7kuk>_`ix6)d*Mq2Hl3=+6VU9v;ThmQ=G4% zn^*hVo?qKM7j8puoVvz|?@CZ2ac^zWMLYpRxr^=u%*Xa8F|}Y_19} W{7_>Y9{d6na}1uYelF{r5}E)G8MU4O diff --git a/minecraft/liquidmechanics/resource/tanks/LiquidTank0.png b/minecraft/liquidmechanics/resource/tanks/LiquidTank0.png deleted file mode 100644 index 365d24bd8abdd13c40c9bece8d3a8129850a0683..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 494 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSY)RhkE)4%caKYZ?lYt_f1s;*b z3=DjSL74G){)!Z!AbW|YuPggqMizb@m3tDGzc4T`R(rZQhE&{od&jV^$$^3O!pvUP z;|8~@IJCI@yc3@)=9tSg*KIqbaWFJ2E%w3QBQpfJThFIU9FTaY(dEn~TyocvO)UL; z!eTz>kB^I{JwL1^z`(+g-0-pS!IGys{&TEu%|CUs(HUqp9Ndg~cT?U@-k{8We>%st z&XrPt?fwzvHH5>+8$^9dKmcu+{NFDf5Pd3>gf( z3m8or*e)c3eMi)!9m^nU8+%gOUH0*Q2Ci^+$$~Opu(XtDnm{r-UW|r1`lC diff --git a/minecraft/liquidmechanics/resource/tanks/LiquidTank1.png b/minecraft/liquidmechanics/resource/tanks/LiquidTank1.png deleted file mode 100644 index 7c79eed86bbff3c86dff181f1578ac985f92894c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 563 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSY)RhkE)4%caKYZ?lYt_f1s;*b z3=DjSL74G){)!Z!AbW|YuPggqMizb@ksk*iM=&rj9`JN=45_&F_Ku)e_Pi&S`g{P_C*dCJJnnIqG&c=E*!Kjd%pTs!E%&>fViy7c^Hfk{D3U+(>WXAu>Y zQ*g=tZ1=YP^?O9$+0XS0zF={8zFbXRWfcF>JsZQfrAI#VFbg@ZD8RtNP~7mSGvQ%b z^1p{3sp-Gn=RW@Mb^)tsLa=lAR(qfWVIVYO&gT2C=dO*BH<)c(XFb2ZcK#~Sy=q^J zG9zwlAIRTZWmfG|`u)%TkfvO%Yk!|4rp~`uFyWKUdvUprDRChU%th73)BD?+C3x9C zAM5Wp@%3lu-DSOJXRo?g^ZQrz-uX5<@17?vc*b?%_1veYx7XGk*vjQ_Tdnc5XoDD= z18V?dNJFf8<5|W|akXS%ZP*kPmp=hZA7v+bE2H}Z~N z5NP1KAaeWLgH76POa%!h8x$K>X&qSi`e*9=_22&`Gsxs*Y`nDB{`97(`g>pRA5v@N zU|?!sP+&k%4oidXX8$hze7lhgRRYR`g$gFUA$pNqV~axvX=f;3%^UV)GnDMAhC))I)bF6%j zfmOG4?=8Ng>z_-`=b!GtAi!{jahH12-gCxwE8pkr*Dq&p1KJJ;Y{mc1)>YR#Tz~)b zt>O&1-%QWq7~g$;waboYU-gTbULQP;-U|J_`uh~ud9#-Ne6vSDvvwte@TS$@d?TL( ziv3*qQCUf<_TR0foaE1Ivr4S)|68*=tKM$jp#uj*6;6kpefoNC{Dx4*8MjqFY-0NG zM8F_!wnq2+jtKW7W=dvJHFet?UtgOzlQrSC)gmT?zm^V>Pv&l4cQWbo9JR*&wGvWH z0gT5UU6i|1el&nV&5c=_sUnp1$Lp$n`{(^X&RDQ9@mSUOe@}}nUp&71_~QztnJh{S z91Khi3g2Mt&#Tl0a^doTsaw%Q~loCIFVH B!F~V$ diff --git a/minecraft/liquidmechanics/resource/tanks/LiquidTank3.png b/minecraft/liquidmechanics/resource/tanks/LiquidTank3.png deleted file mode 100644 index dc833ab27239597f9ba80eb56d8e9013e95fa3c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 504 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSY)RhkE)4%caKYZ?lYt_f1s;*b z3=DjSL74G){)!Z!AbW|YuPggqMizc;wfb-sc?Jf?R!V@Vv|L zxI?UDV4F;{oKWAv28l@RY4;SXtwIzgvaR42Y^k{~bTY}|*t3(BsevJZ_rhL*Gg;{sLGQBcr{8VV1lkS*4fka3-^`!S|DtOC zeaWWlk7Ewp&_1v=F!uWHd;a`?mka$_nzYvZ_T=*+Pi;(nKi{iV4*C_s80QgqX4a}X z?xE-S=gJFSl=!?{&3X3h^P!8KtAFoaXMX$fR{=I7=7MZ>TRn%+4e|m^Ng^1~LW!;frkX4?J~ca`O9cO>RH?nB&0bTu)!d6%60C-u_hHe|Mcw zPZDo~X2Wgm18eQsf4}~z&et%TS9zN4ujQ9B*XxJA`Ccu0Qb~Z(fkA+Qg#khBn1AK_ p=D+)XzI9+lmjWw<`5u$5SdlNfCF?lv;aT<|Nl#Zlmvv4FO#tcnxA6b~ diff --git a/minecraft/liquidmechanics/resource/tanks/LiquidTank4.png b/minecraft/liquidmechanics/resource/tanks/LiquidTank4.png deleted file mode 100644 index cacfa8a697f20c4f385263001de8c6386c69af70..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 476 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSY)RhkE)4%caKYZ?lYt_f1s;*b z3=DjSL74G){)!Z!AbW|YuPggqMizc;)88*s4>B+?W_r3fhE&{od&e-Z*+7CVVE3sR z$qUxm`c|DNnzcssctSb*tyQHS!R--^KWsIfKD9jfoG)FFWRbkT-gDsr3%TTk;xh5P zEV(ZG+c)Q_Pj_GtU^v70OufnVZH~Xr+_%#=SsAbZErx-Bv)|2s|NPgm^Zn1aiWN5B zShvJ6>V17xXcKndw!~NUhyPJ7#nk7r$zCrjzd0TGv5v`Rf~G?4jJk)Pe@y%G^L|;h z^z8GYi`Rd9)lix`%xOXjA5L~c#`DCC7dx@v7EBjqW7JeOr zBZt^K85o!+c)B=-RK&fV>sWNlLBwV8ny1kRtn32%rZZb+_a(j+b~&Z#++wm=F6hgb z#a*pWe=dIc&%akdOs;OOe7u;PzW#de+3)kJ>+4rboqzDWAR&S|VOCw-+9H|#v2}5` z_!!P#yl^YDX02{QO*|iiL;T-0VayCyr+p3GP{kLZJhiw%YWuwOHwAVZqie)3WOX)N zJazK;nZw=(l54ik{QAzjp_fTa%hG|#;J&jbBLkHbf4sk+ORnvq*V#+Hhqot3o!(!(xajp=gZt|29t{OD z&kompJ-6WJikdGI>u)ztQqk~SbNju;1HGm7neWXQpFQ)x{QY!sozLall21Myu63*v zWcV!j(|&$-?yUYlOI>ztua&8fStflveAj;QhN$OuvkKR1ZvCwJ*j~NC$bbD-SI!4I z^H?I@$9-p*!0-?Wzh)4Lyj}>?JZ*Mwv`DKVfm*QHP2Pzw;PG0tzp&|2el&&;G zlx3zBKf?^ObyqhrE+AUse1V0G+^>3O`M2EjWi$9DGt8?0c9kLFzLPHlL&m?G;mi%S z+@_2S3x1}@^D=zXy~4uK@N9mqDZ`EJ0m2M;6vx)4PuQEp5(7*rEzFDz3QcGL(l zFdUNQnC{QS;IM=F;U`Z9299!t7&}e|hKGDDr_~u56z((@{8V9JXt5U1n-8?Afc?-@ gU?v$@&42FCQ2oSk=Ol9=FuO8%y85}Sb4q9e02CdmSpWb4 literal 0 HcmV?d00001 diff --git a/minecraft/liquidmechanics/resource/tanks/WaterTank.png b/minecraft/liquidmechanics/resource/tanks/WaterTank.png new file mode 100644 index 0000000000000000000000000000000000000000..ec6482af61ca00a31b50bc01a54957305071458f GIT binary patch literal 491 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSY)RhkE)4%caKYZ?lYt_f1s;*b z3=DjSL74G){)!Z!AbW|YuPggqMpj`Xkw%7x-xwGeD?D8sLn>~)y5@@CCB zpH~JV|ND&X{q-6d6c}DG_L(>NK0f20_x4-#PU{VS`}UrH&vWo` zpv`sf__q}&=C}ue3cS)C7rmlXa$1DdH21W-40R{y1pz70=^WT;~+s-VCE(K8t^EC$j aU|AhQgF%gP?m?e9AW2VGKbLh*2~7azIJj#7 literal 0 HcmV?d00001 diff --git a/minecraft/liquidmechanics/resource/tanks/guage/0.png b/minecraft/liquidmechanics/resource/tanks/guage/0.png new file mode 100644 index 0000000000000000000000000000000000000000..af5d4cbe27b7e6de36cab220eacd0594cd9ee14c GIT binary patch literal 742 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sDEfH31!Z9ZwBAX}2Ry9>jA5L~c#`DCC7dx@v7EBjqW7JeO- zdlHwwFfcHMdAc};RK&f#Zs=(`d1eNkCzrgG@Z}+B&!m-hTbbaM@&S-@6;heDmbv!>`}D z6MMA(xB9;gtTXukfBX0AgZchv-``)_kl22neFp!>8;ihyCxs8rF{Jjl1QW{{7N>zjOL?N!uF6 zY4_Rv{`wW%i+LPtyNBVi?9Kl|Z{LY+5WT-P>2}azt_{5RL-QC5**Pfl9GPJjA5L~c#`DCC7dx@v7EBjqW7JeO- zdlHwwFfcG>c)B=-RK&f#v)Ah|P(k72M-QT3E?V$lF&Eda7txj$D>X%a`9>Fbyc3_` zl-a&J=Ko4bt3Q8a#rxJYp4PGa(8|bo#95$$;St-TA7Ty+h0KLD+zJgl8ZGv*3OL+x zkh#yqp^&H0m(R!|U@mZcI|EaPbjRap2F4@2M?UHjuk9m4+sc1-2QFXzdTV9%zkj!^ zroLZ4Kl}V$+dD`6znlHb5l^uB`MrO8_x_I(^6iNN2ih7>vKrKVGPnP$e0ksV`*C(+ zCr-Pwu92P*!?1kbfvc<*U-!0NKX1ptU10I}CVK+oBgTk^3I;I+xdv7XnFCMqSl<2; zFAy!f&b#o?_MgR)>Hk#=D(e&O*ESU&J^QqFGk=1f`m6mGYUP|3VJ+TA3zwxyA1M40 q_f$wA-+^2&k{L2XLfc1%I>r-1cK>$y96SU}h76vrelF{r5}E+=_8gV~ literal 0 HcmV?d00001 diff --git a/minecraft/liquidmechanics/resource/tanks/guage/1.png b/minecraft/liquidmechanics/resource/tanks/guage/1.png new file mode 100644 index 0000000000000000000000000000000000000000..365881b39602982955e89eb776990f77329f3312 GIT binary patch literal 770 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sDEfH31!Z9ZwBAX}2Ry9>jA5L~c#`DCC7dx@v7EBjqW7JeO( z9|s>tFfcF`dAc};RK&f#W9!A7$iVh6mS0r#i$t8!*4C-LP4?SAsLWy!?@^o8;9EAY zLC0fO<^DpmWj8+7ewEs@iF;1!$;Ny!1&0_GCIN+g4l?nK90KtQed`%mI`jpOhchr8 z5$|}c&A|AG`^ZPp28NHUkA84DH2h#HtYKAfsA;s=N4z!x@dTTz&zXB3?E z$Ddta=dJE`{j;O~(fMr*<=ej>{`&Oiv-H1F@%z0Gw+YwS9rz_sF8gHPeS4d|Ip->O zS$%oSnik!_`8k_WrtXE9!9uMA?{8^4*l=$acVN848nMpq@BX!QVzXZx=sd1}fABoR z;eyYewy~BUN*gEtR(i4i|5MxVpDYfh|CdboRhMx8JInF2ru)m!$2I(vz4>2g?j79+ z0X5sZ4o{o4mZAM&_4H_mJB-Bpj?6$Ag4&L-{$SW|VQnOCc<382K{9x{`njxgN@xNA DNWLa6 literal 0 HcmV?d00001 diff --git a/minecraft/liquidmechanics/resource/tanks/guage/2.png b/minecraft/liquidmechanics/resource/tanks/guage/2.png new file mode 100644 index 0000000000000000000000000000000000000000..2051db92eb8076c2eaa57bd9ca0368001b8fe254 GIT binary patch literal 967 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sDEfH31!Z9ZwBAX}2Ry9>jA5L~c#`DCC7dx@v7EBjqW7JhAM zb^8oH1_owxPZ!6KinzCP0`o2hh_EJ$g*r5)Zt$AMC^RK@!=x>q8(kDw>(89uV?Aw^ zOK3^SJIlw}>hkx_oj<-ZIfp6#nBTnz*IAenEI1ei7!C_d*wslZFtn)~)ci4XVBqmj z`0*pRfk9&4fe#;VGcX$1G(LR1oslV_g6Z(_d}fvdA6VM@@3V0YeSg2d}@&o6rCG;ay_I-TMChZ`gKB`Tz0n?br98?%4B>)7OM!K7WDc z$GC~>|NcL{{do5I-`Pv=t8IA0cH{V;TIP^{3%n25Wl2A{f8%u?)BkeW`}u6~?-=X; z&H8uw^XuoYe}De@Xo=MrYzR~@--LKM*EAFkDA1&4p%DwpcDKwg^xZ%O6$ck<_5ozW#SB*4rT0S95t36fuKG+&0)3Jtks8sxr)Kl L)z4*}Q$iB}<)n!B literal 0 HcmV?d00001 diff --git a/minecraft/liquidmechanics/resource/tanks/guage/3.png b/minecraft/liquidmechanics/resource/tanks/guage/3.png new file mode 100644 index 0000000000000000000000000000000000000000..7b693fb38586da68a2dcf391a8736c7c66a382f8 GIT binary patch literal 790 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sDEfH31!Z9ZwBAX}2Ry9>jA5L~c#`DCC7dx@v7EBjqW7JhBD z`fwF_1_q`!PZ!6KinzCT{Pma%8Qeei?cE*mb8-RC@wU|Z>5{qBSL)=M z-zCl(ANTDy&tKHdmoMMn>R#5kSjY0iRVJ2>ZU+XYBjO#8wHX*6aUc08+Q9IU_0bP5 zhlU?ag*B`S4mFJy``(3u|B=p^w{KtR-;W=^t!6lV-u4))T6n|X{yduk_WhZ= z8yMz?|BGn&%R1}3KMPAh!+sGyjs*;bj3N*88P&d99a#6D^~~>cwHCW>-e)>?oqgM0 zzk(f_%YV*J(?4L+|MdUAS10c>mCZf2Hfj6PH0=X)=<(`$as(O Y#7B3xbx+MBfQgjB)78&qol`;+0BG$rSpWb4 literal 0 HcmV?d00001 diff --git a/minecraft/liquidmechanics/resource/tanks/guage/4.png b/minecraft/liquidmechanics/resource/tanks/guage/4.png new file mode 100644 index 0000000000000000000000000000000000000000..17dd45311c8a167a58e3499edca1dc537bc7ab64 GIT binary patch literal 740 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sDEfH31!Z9ZwBAX}2Ry9>jA5L~c#`DCC7dx@v7EBjqW7JhBh z-!D@SGB7ZOc)B=-RK&f#vE(jAYZ85oc79{H%-!0?Fe z(GM{PhC=4T8g7M#9gP*B3hdOf5MxuKN*sH+MTz5nbEww-)COShwa}E z>m7LcrE;Nde0|!7&nCzI+lfqVxV_?XOq8a&!QGSo4o YxoR%j_2jn{Fv&4^y85}Sb4q9e04Zk_>Hq)$ literal 0 HcmV?d00001