diff --git a/resources/tinkertextures/ConstructBlocks.png b/resources/tinkertextures/ConstructBlocks.png index ca9839d1..7f69c769 100644 Binary files a/resources/tinkertextures/ConstructBlocks.png and b/resources/tinkertextures/ConstructBlocks.png differ diff --git a/resources/tinkertextures/materials.png b/resources/tinkertextures/materials.png index ea199cef..6913f7f2 100644 Binary files a/resources/tinkertextures/materials.png and b/resources/tinkertextures/materials.png differ diff --git a/resources/tinkertextures/tools/patterns.png b/resources/tinkertextures/tools/patterns.png index 35dcc562..4e7adb11 100644 Binary files a/resources/tinkertextures/tools/patterns.png and b/resources/tinkertextures/tools/patterns.png differ diff --git a/tinker/tconstruct/TContent.java b/tinker/tconstruct/TContent.java index f0bca662..438c6764 100644 --- a/tinker/tconstruct/TContent.java +++ b/tinker/tconstruct/TContent.java @@ -98,8 +98,8 @@ public class TContent implements IFuelHandler public static Block bronzeFlowing; public static Block bronzeStill; - public static Block brassFlowing; - public static Block brassStill; + public static Block alBrassFlowing; + public static Block alBrassStill; public static Block manyullynFlowing; public static Block manyullynStill; public static Block alumiteFlowing; @@ -143,6 +143,7 @@ public class TContent implements IFuelHandler GameRegistry.registerTileEntity(tinker.tconstruct.logic.PartCrafterLogic.class, "PartCrafter"); GameRegistry.registerTileEntity(tinker.tconstruct.logic.PatternChestLogic.class, "PatternHolder"); GameRegistry.registerTileEntity(tinker.tconstruct.logic.PatternShaperLogic.class, "PatternShaper"); + GameRegistry.registerTileEntity(tinker.tconstruct.logic.CastingTableLogic.class, "CastingTable"); heldItemBlock = new EquipBlock(PHConstruct.heldItemBlock, Material.wood); GameRegistry.registerBlock(heldItemBlock, "HeldItemBlock"); @@ -153,13 +154,14 @@ public class TContent implements IFuelHandler GameRegistry.registerBlock(craftedSoil, tinker.tconstruct.items.CraftedSoilItemBlock.class, "CraftedSoil"); //Smeltery - lavaTank = new LavaTankBlock(PHConstruct.lavaTank); - GameRegistry.registerBlock(lavaTank, "LavaTank"); - GameRegistry.registerTileEntity(tinker.tconstruct.logic.LavaTankLogic.class, "TConstruct.LavaTank"); - smeltery = new SmelteryBlock(PHConstruct.smeltery); GameRegistry.registerBlock(smeltery, "Smeltery"); GameRegistry.registerTileEntity(tinker.tconstruct.logic.SmelteryLogic.class, "TConstruct.Smeltery"); + //GameRegistry.registerTileEntity(tinker.tconstruct.logic.SmelteryLogic.class, "TConstruct.Smeltery"); + + lavaTank = new LavaTankBlock(PHConstruct.lavaTank); + GameRegistry.registerBlock(lavaTank, "LavaTank"); + GameRegistry.registerTileEntity(tinker.tconstruct.logic.LavaTankLogic.class, "TConstruct.LavaTank"); searedBrick = new SearedBrick(PHConstruct.searedBrick, 80, Material.iron, 10.0F, 6); GameRegistry.registerBlock(searedBrick, tinker.tconstruct.items.SearedBrickItemBlock.class, "SearedBrick"); @@ -203,10 +205,10 @@ public class TContent implements IFuelHandler GameRegistry.registerBlock(bronzeFlowing, "Liquid bronze Flowing"); bronzeStill = new BronzeStill(PHConstruct.bronzeStill).setBlockName("liquid.bronzeStill"); GameRegistry.registerBlock(bronzeStill, "Liquid bronze Still"); - brassFlowing = new BrassFlowing(PHConstruct.brassFlowing).setBlockName("liquid.brassFlow"); - GameRegistry.registerBlock(brassFlowing, "Liquid brass Flowing"); - brassStill = new BrassStill(PHConstruct.brassStill).setBlockName("liquid.brassStill"); - GameRegistry.registerBlock(brassStill, "Liquid brass Still"); + alBrassFlowing = new AlBrassFlowing(PHConstruct.brassFlowing).setBlockName("liquid.brassFlow"); + GameRegistry.registerBlock(alBrassFlowing, "Liquid albrass Flowing"); + alBrassStill = new AlBrassStill(PHConstruct.brassStill).setBlockName("liquid.brassStill"); + GameRegistry.registerBlock(alBrassStill, "Liquid albrass Still"); manyullynFlowing = new ManyullynFlowing(PHConstruct.manyullynFlowing).setBlockName("liquid.manyullynFlow"); GameRegistry.registerBlock(manyullynFlowing, "Liquid manyullyn Flowing"); manyullynStill = new ManyullynStill(PHConstruct.manyullynStill).setBlockName("liquid.manyullynStill"); @@ -398,16 +400,18 @@ public class TContent implements IFuelHandler void addSmelteryRecipes() { - Smeltery.addMelting(Block.oreIron, 0, 450, new LiquidStack(ironStill.blockID, 250, 0)); - Smeltery.addMelting(Block.oreGold, 0, 300, new LiquidStack(goldStill.blockID, 250, 0)); - Smeltery.addMelting(new ItemStack(Item.ingotIron, 8), Block.blockSteel.blockID, 0, 450, new LiquidStack(ironStill.blockID, 250, 0)); - Smeltery.addMelting(new ItemStack(Item.ingotGold, 8), Block.blockGold.blockID, 0, 300, new LiquidStack(goldStill.blockID, 250, 0)); - Smeltery.addMelting(Block.blockSteel, 0, 450, new LiquidStack(ironStill.blockID, 2250, 0)); - Smeltery.addMelting(Block.blockGold, 0, 300, new LiquidStack(goldStill.blockID, 2250, 0)); - Smeltery.addMelting(searedBrick, 3, 300, new LiquidStack(copperStill.blockID, 250, 0)); - Smeltery.addMelting(searedBrick, 4, 300, new LiquidStack(tinStill.blockID, 250, 0)); + Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(ironStill.blockID, 250, 0)); + Smeltery.addMelting(Block.oreGold, 0, 550, new LiquidStack(goldStill.blockID, 250, 0)); + Smeltery.addMelting(new ItemStack(Item.ingotIron, 8), Block.blockSteel.blockID, 0, 500, new LiquidStack(ironStill.blockID, 250, 0)); + Smeltery.addMelting(new ItemStack(Item.ingotGold, 8), Block.blockGold.blockID, 0, 450, new LiquidStack(goldStill.blockID, 250, 0)); + Smeltery.addMelting(Block.blockSteel, 0, 500, new LiquidStack(ironStill.blockID, 2250, 0)); + Smeltery.addMelting(Block.blockGold, 0, 450, new LiquidStack(goldStill.blockID, 2250, 0)); + Smeltery.addMelting(searedBrick, 3, 550, new LiquidStack(copperStill.blockID, 250, 0)); + Smeltery.addMelting(searedBrick, 4, 175, new LiquidStack(tinStill.blockID, 250, 0)); + Smeltery.addMelting(searedBrick, 5, 350, new LiquidStack(aluminumStill.blockID, 250, 0)); Smeltery.addAlloyMixing(new LiquidStack(bronzeStill.blockID, 4, 0), new LiquidStack(copperStill.blockID, 3, 0), new LiquidStack(tinStill.blockID, 1, 0)); + Smeltery.addAlloyMixing(new LiquidStack(alBrassStill.blockID, 4, 0), new LiquidStack(aluminumStill.blockID, 3, 0), new LiquidStack(copperStill.blockID, 1, 0)); } void addCraftingRecipes () diff --git a/tinker/tconstruct/blocks/SmelteryBlock.java b/tinker/tconstruct/blocks/SmelteryBlock.java index e42069fe..0f10be49 100644 --- a/tinker/tconstruct/blocks/SmelteryBlock.java +++ b/tinker/tconstruct/blocks/SmelteryBlock.java @@ -45,17 +45,17 @@ public class SmelteryBlock extends InventoryBlock public int getBlockTextureFromSideAndMetadata (int side, int meta) { - if (side == 0 || side == 1) + /*if (side == 0 || side == 1) { return blockIndexInTexture + 3 + meta * 4; - } + }*/ if (side == 3) { - return blockIndexInTexture + meta * 4; + return blockIndexInTexture + 1 + meta * 3; } else { - return blockIndexInTexture + 2 + meta * 4; + return blockIndexInTexture + meta * 3; } } @@ -66,32 +66,38 @@ public class SmelteryBlock extends InventoryBlock int meta = world.getBlockMetadata(x, y, z); if (meta == 0) //Smeltery { - if (side == 1) + /*if (side == 1) { return blockIndexInTexture + 3 + meta * 4; - } + }*/ if (side == direction) { if (isActive(world, x, y, z)) { - return blockIndexInTexture + 2 + meta * 4; + return blockIndexInTexture + 2; } else { - return blockIndexInTexture + 1 + meta * 4; + return blockIndexInTexture + 1; } } else { - return blockIndexInTexture + meta * 4; + return blockIndexInTexture + meta; } } - else //Output + if (meta == 1) { if (side == direction) - return blockIndexInTexture + 3 + meta*2; + return blockIndexInTexture + 1 + 3; + else if (side / 2 == direction / 2) + return blockIndexInTexture + 2 + 3; else - return blockIndexInTexture + 2 + meta*2; + return blockIndexInTexture + 3; + } + else + { + return blockIndexInTexture + meta +4; } } diff --git a/tinker/tconstruct/blocks/ToolStationBlock.java b/tinker/tconstruct/blocks/ToolStationBlock.java index 492c9b89..967ce018 100644 --- a/tinker/tconstruct/blocks/ToolStationBlock.java +++ b/tinker/tconstruct/blocks/ToolStationBlock.java @@ -14,6 +14,7 @@ import tinker.common.InventoryBlock; import tinker.tconstruct.TConstruct; import tinker.tconstruct.TContent; import tinker.tconstruct.client.TableRender; +import tinker.tconstruct.logic.CastingTableLogic; import tinker.tconstruct.logic.PartCrafterLogic; import tinker.tconstruct.logic.PatternChestLogic; import tinker.tconstruct.logic.PatternShaperLogic; @@ -118,6 +119,7 @@ public class ToolStationBlock extends InventoryBlock case 11: return new PatternShaperLogic(); case 12: return new PatternShaperLogic(); case 13: return new PatternShaperLogic(); + case 14: return new CastingTableLogic(); default: return null; } } @@ -152,7 +154,7 @@ public class ToolStationBlock extends InventoryBlock list.add(new ItemStack(id, 1, iter)); } - for (int iter = 10; iter < 14; iter++) + for (int iter = 10; iter < 15; iter++) { list.add(new ItemStack(id, 1, iter)); } diff --git a/tinker/tconstruct/blocks/liquids/BrassFlowing.java b/tinker/tconstruct/blocks/liquids/AlBrassFlowing.java similarity index 58% rename from tinker/tconstruct/blocks/liquids/BrassFlowing.java rename to tinker/tconstruct/blocks/liquids/AlBrassFlowing.java index 3211ce39..d5f1e24d 100644 --- a/tinker/tconstruct/blocks/liquids/BrassFlowing.java +++ b/tinker/tconstruct/blocks/liquids/AlBrassFlowing.java @@ -2,10 +2,10 @@ package tinker.tconstruct.blocks.liquids; import tinker.tconstruct.TContent; -public class BrassFlowing extends LiquidMetalFlowing +public class AlBrassFlowing extends LiquidMetalFlowing { - public BrassFlowing(int id) + public AlBrassFlowing(int id) { super(id); blockIndexInTexture = 41; @@ -14,6 +14,6 @@ public class BrassFlowing extends LiquidMetalFlowing @Override public int stillLiquidId () { - return TContent.brassStill.blockID; + return TContent.alBrassStill.blockID; } } diff --git a/tinker/tconstruct/blocks/liquids/BrassStill.java b/tinker/tconstruct/blocks/liquids/AlBrassStill.java similarity index 59% rename from tinker/tconstruct/blocks/liquids/BrassStill.java rename to tinker/tconstruct/blocks/liquids/AlBrassStill.java index 4a35db8e..367b27bd 100644 --- a/tinker/tconstruct/blocks/liquids/BrassStill.java +++ b/tinker/tconstruct/blocks/liquids/AlBrassStill.java @@ -2,10 +2,10 @@ package tinker.tconstruct.blocks.liquids; import tinker.tconstruct.TContent; -public class BrassStill extends LiquidMetalStill +public class AlBrassStill extends LiquidMetalStill { - public BrassStill(int id) + public AlBrassStill(int id) { super(id); blockIndexInTexture = 41; @@ -14,7 +14,7 @@ public class BrassStill extends LiquidMetalStill @Override public int flowingLiquidID () { - return TContent.brassFlowing.blockID; + return TContent.alBrassFlowing.blockID; } } diff --git a/tinker/tconstruct/client/SmelteryRender.java b/tinker/tconstruct/client/SmelteryRender.java index 56a60361..a2cd23a5 100644 --- a/tinker/tconstruct/client/SmelteryRender.java +++ b/tinker/tconstruct/client/SmelteryRender.java @@ -35,61 +35,71 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler { if (modelID == smelteryModel) { - renderer.renderStandardBlock(block, x, y, z); - SmelteryLogic logic = (SmelteryLogic) world.getBlockTileEntity(x, y, z); - if (logic.validStructure) + switch (world.getBlockMetadata(x, y, z)) { - int posX = logic.centerPos.x - 1, posY = logic.centerPos.y, posZ = logic.centerPos.z - 1; - //Melting - for (int i = 0; i < 9; i++) + case 0: return renderSmeltery(world, x, y, z, block, modelID, renderer); + case 1: + } + } + return false; + } + + public boolean renderSmeltery(IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) + { + renderer.renderStandardBlock(block, x, y, z); + SmelteryLogic logic = (SmelteryLogic) world.getBlockTileEntity(x, y, z); + if (logic.validStructure) + { + int posX = logic.centerPos.x - 1, posY = logic.centerPos.y, posZ = logic.centerPos.z - 1; + //Melting + for (int i = 0; i < 9; i++) + { + ItemStack input = logic.getStackInSlot(i); + if (input != null && logic.getTempForSlot(i) > 20) { - ItemStack input = logic.getStackInSlot(i); - if (input != null) - { - ItemStack blockToRender = Smeltery.getRenderIndex(input); - float blockHeight = input.stackSize / (float) blockToRender.stackSize; - renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, MathHelper.clamp_float(blockHeight, 0.01F, 1.0F), 1.0F); - - if (blockToRender.itemID < 4096) //Block - { - Block liquidBlock = Block.blocksList[blockToRender.itemID]; - ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0); - BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, blockToRender.getItemDamage(), posX + i % 3, posY, posZ + i / 3, renderer, world); - } - else //Item - { - Item liquidItem = Item.itemsList[blockToRender.itemID]; - ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0); - int metadata = blockToRender.getItemDamage(); - BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(metadata), metadata, posX, posY, posZ, renderer, world); - } - } - } - - //Liquids - float base = 0F; - for (LiquidStack liquid : logic.moltenMetal) - { - float height = liquid.amount / 10000F; - renderer.setRenderBounds(0.0F, base, 0.0F, 1.0F, height + base, 1.0F); - base += height; + ItemStack blockToRender = Smeltery.getRenderIndex(input); + float blockHeight = input.stackSize / (float) blockToRender.stackSize; + renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, MathHelper.clamp_float(blockHeight, 0.01F, 1.0F), 1.0F); - if (liquid.itemID < 4096) //Block + if (blockToRender.itemID < 4096) //Block { - Block liquidBlock = Block.blocksList[liquid.itemID]; + Block liquidBlock = Block.blocksList[blockToRender.itemID]; ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0); - for (int i = 0; i < 9; i++) - BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, liquid.itemMeta, posX + i % 3, posY, posZ + i / 3, renderer, world); + BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, blockToRender.getItemDamage(), posX + i % 3, posY, posZ + i / 3, renderer, world); } else //Item { - Item liquidItem = Item.itemsList[liquid.itemID]; + Item liquidItem = Item.itemsList[blockToRender.itemID]; ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0); - for (int i = 0; i < 9; i++) - BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(liquid.itemMeta), liquid.itemMeta, posX, posY, posZ, renderer, world); + int metadata = blockToRender.getItemDamage(); + BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(metadata), metadata, posX, posY, posZ, renderer, world); } } } + + //Liquids + float base = 0F; + for (LiquidStack liquid : logic.moltenMetal) + { + float height = liquid.amount / 10000F; + renderer.setRenderBounds(0.0F, base, 0.0F, 1.0F, height + base, 1.0F); + base += height; + + if (liquid.itemID < 4096) //Block + { + Block liquidBlock = Block.blocksList[liquid.itemID]; + ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0); + for (int i = 0; i < 9; i++) + BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, liquid.itemMeta, posX + i % 3, posY, posZ + i / 3, renderer, world); + } + else //Item + { + Item liquidItem = Item.itemsList[liquid.itemID]; + ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0); + for (int i = 0; i < 9; i++) + BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(liquid.itemMeta), liquid.itemMeta, posX, posY, posZ, renderer, world); + } + } } return false; } diff --git a/tinker/tconstruct/client/TProxyClient.java b/tinker/tconstruct/client/TProxyClient.java index 342c150a..b059bdb0 100644 --- a/tinker/tconstruct/client/TProxyClient.java +++ b/tinker/tconstruct/client/TProxyClient.java @@ -96,6 +96,7 @@ public class TProxyClient extends TProxyCommon LanguageRegistry.instance().addStringLocalization("ToolStation.Parts.name", "Part Builder"); LanguageRegistry.instance().addStringLocalization("ToolStation.PatternChest.name", "Pattern Chest"); LanguageRegistry.instance().addStringLocalization("ToolStation.PatternShaper.name", "Stencil Table"); + LanguageRegistry.instance().addStringLocalization("ToolStation.PatternShaper.name", "Casting Table"); LanguageRegistry.instance().addStringLocalization("CraftedSoil.Slime.name", "Slimy Mud"); LanguageRegistry.instance().addStringLocalization("CraftedSoil.Grout.name", "Grout"); @@ -169,8 +170,8 @@ public class TProxyClient extends TProxyCommon LanguageRegistry.addName(TContent.bronzeFlowing, "Liquid Bronze"); LanguageRegistry.addName(TContent.bronzeStill, "Liquid Bronze"); - LanguageRegistry.addName(TContent.brassFlowing, "Liquid Brass"); - LanguageRegistry.addName(TContent.brassStill, "Liquid Brass"); + LanguageRegistry.addName(TContent.alBrassFlowing, "Liquid Brass"); + LanguageRegistry.addName(TContent.alBrassStill, "Liquid Brass"); LanguageRegistry.addName(TContent.alumiteFlowing, "Liquid Alumite"); LanguageRegistry.addName(TContent.alumiteStill, "Liquid Alumite"); LanguageRegistry.addName(TContent.manyullynFlowing, "Liquid Manyullyn"); diff --git a/tinker/tconstruct/client/TableRender.java b/tinker/tconstruct/client/TableRender.java index c21be9c1..1210614d 100644 --- a/tinker/tconstruct/client/TableRender.java +++ b/tinker/tconstruct/client/TableRender.java @@ -22,6 +22,32 @@ public class TableRender implements ISimpleBlockRenderingHandler renderer.setRenderBounds(0.0F, 0.0, 0.0F, 1.0F, 0.875F, 1.0F); renderDo(renderer, block, metadata); } + else if (metadata == 14) + { + //Top + renderer.setRenderBounds(0.0F, 0.625F, 0.0F, 1.0F, 0.9375F, 1.0F); + renderDo(renderer, block, metadata); + + //Lip + renderer.setRenderBounds(0.0F, 0.9375, 0.0F, 0.0625, 1.0, 1.0F); + renderDo(renderer, block, metadata); + renderer.setRenderBounds(0.0625, 0.9375, 0.9375, 0.9375, 1.0, 1.0F); + renderDo(renderer, block, metadata); + renderer.setRenderBounds(0.9375, 0.9375, 0.0F, 1.0F, 1.0, 1.0F); + renderDo(renderer, block, metadata); + renderer.setRenderBounds(0.0625, 0.9375, 0.0F, 0.9375, 1.0, 0.0625); + renderDo(renderer, block, metadata); + + //Legs + renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.3125F, 0.625F, 0.3125F); + renderDo(renderer, block, metadata); + renderer.setRenderBounds(0.6875, 0.0F, 0.0F, 1.0F, 0.625F, 0.25F); + renderDo(renderer, block, metadata); + renderer.setRenderBounds(0.0F, 0.0F, 0.6875, 0.3125F, 0.625F, 1.0F); + renderDo(renderer, block, metadata); + renderer.setRenderBounds(0.6875, 0.0F, 0.6875, 1.0F, 0.625F, 1.0F); + renderDo(renderer, block, metadata); + } else { renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); @@ -49,6 +75,32 @@ public class TableRender implements ISimpleBlockRenderingHandler renderer.setRenderBounds(0.0F, 0.0, 0.0F, 1.0F, 0.875F, 1.0F); renderer.renderStandardBlock(block, x, y, z); } + else if (metadata == 14) + { + //Top + renderer.setRenderBounds(0.0F, 0.625F, 0.0F, 1.0F, 0.9375F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + + //Lip + renderer.setRenderBounds(0.0F, 0.9375, 0.0F, 0.0625, 1.0, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.0625, 0.9375, 0.9375, 0.9375, 1.0, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.9375, 0.9375, 0.0F, 1.0F, 1.0, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.0625, 0.9375, 0.0F, 0.9375, 1.0, 0.0625); + renderer.renderStandardBlock(block, x, y, z); + + //Legs + renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.3125F, 0.625F, 0.3125F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.6875, 0.0F, 0.0F, 1.0F, 0.625F, 0.25F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.0F, 0.0F, 0.6875, 0.3125F, 0.625F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.6875, 0.0F, 0.6875, 1.0F, 0.625F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + } else { renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); diff --git a/tinker/tconstruct/client/liquidrender/LiquidBrassFX.java b/tinker/tconstruct/client/liquidrender/LiquidBrassFX.java index 30cedee5..b7644aa9 100644 --- a/tinker/tconstruct/client/liquidrender/LiquidBrassFX.java +++ b/tinker/tconstruct/client/liquidrender/LiquidBrassFX.java @@ -6,6 +6,6 @@ public class LiquidBrassFX extends TextureLiquidStillFX { public LiquidBrassFX() { - super(200, 255, 200, 255, 40, 80, TContent.brassStill.blockIndexInTexture, TContent.brassStill.getTextureFile()); + super(200, 255, 200, 255, 40, 80, TContent.alBrassStill.blockIndexInTexture, TContent.alBrassStill.getTextureFile()); } } \ No newline at end of file diff --git a/tinker/tconstruct/client/liquidrender/LiquidBrassFlowFX.java b/tinker/tconstruct/client/liquidrender/LiquidBrassFlowFX.java index 35575ed7..8b639850 100644 --- a/tinker/tconstruct/client/liquidrender/LiquidBrassFlowFX.java +++ b/tinker/tconstruct/client/liquidrender/LiquidBrassFlowFX.java @@ -6,6 +6,6 @@ public class LiquidBrassFlowFX extends TextureLiquidFlowingFX { public LiquidBrassFlowFX() { - super(200, 255, 200, 255, 40, 80, TContent.brassFlowing.blockIndexInTexture+1, TContent.brassFlowing.getTextureFile()); + super(200, 255, 200, 255, 40, 80, TContent.alBrassFlowing.blockIndexInTexture+1, TContent.alBrassFlowing.getTextureFile()); } } \ No newline at end of file diff --git a/tinker/tconstruct/items/ToolStationItemBlock.java b/tinker/tconstruct/items/ToolStationItemBlock.java index 8cd76273..96261466 100644 --- a/tinker/tconstruct/items/ToolStationItemBlock.java +++ b/tinker/tconstruct/items/ToolStationItemBlock.java @@ -7,7 +7,8 @@ public class ToolStationItemBlock extends ItemBlock { public static final String blockType[] = { - "Crafter", "Parts", "Parts", "Parts", "Parts", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternShaper", "PatternShaper", "PatternShaper", "PatternShaper" + "Crafter", "Parts", "Parts", "Parts", "Parts", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternChest", + "PatternShaper", "PatternShaper", "PatternShaper", "PatternShaper", "CastingTable" }; public ToolStationItemBlock(int id) diff --git a/tinker/tconstruct/logic/CastingTableLogic.java b/tinker/tconstruct/logic/CastingTableLogic.java new file mode 100644 index 00000000..204f16c9 --- /dev/null +++ b/tinker/tconstruct/logic/CastingTableLogic.java @@ -0,0 +1,28 @@ +package tinker.tconstruct.logic; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.world.World; +import tinker.common.InventoryLogic; + +public class CastingTableLogic extends InventoryLogic +{ + + public CastingTableLogic() + { + super(2); + } + + @Override + public String getInvName () //Not a gui block + { + return null; + } + + @Override + public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) //Not a gui block + { + return null; + } + +} diff --git a/tinker/tconstruct/logic/LavaTankLogic.java b/tinker/tconstruct/logic/LavaTankLogic.java index 9ddcd3e7..4a699ae2 100644 --- a/tinker/tconstruct/logic/LavaTankLogic.java +++ b/tinker/tconstruct/logic/LavaTankLogic.java @@ -23,6 +23,7 @@ public class LavaTankLogic extends TileEntity { tank = new LiquidTank(LiquidContainerRegistry.BUCKET_VOLUME); max = LiquidContainerRegistry.BUCKET_VOLUME*4; + pressure = 0; } @Override @@ -106,7 +107,7 @@ public class LavaTankLogic extends TileEntity @Override public int getTankPressure () { - return 0; + return pressure; } public void readFromNBT(NBTTagCompound par1NBTTagCompound) diff --git a/tinker/tconstruct/logic/MultiblockLogic.java b/tinker/tconstruct/logic/MultiblockLogic.java new file mode 100644 index 00000000..20df9f74 --- /dev/null +++ b/tinker/tconstruct/logic/MultiblockLogic.java @@ -0,0 +1,51 @@ +package tinker.tconstruct.logic; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import tinker.common.CoordTuple; + +public class MultiblockLogic extends TileEntity +{ + boolean hasMaster; + CoordTuple master; + + public boolean hasValidMaster () + { + return hasMaster; + } + + public CoordTuple getMaster () + { + return master; + } + + public void setMaster(int x, int y, int z) + { + master = new CoordTuple(x, y, z); + } + + public void readFromNBT (NBTTagCompound tags) + { + super.readFromNBT(tags); + hasMaster = tags.getBoolean("HasMaster"); + if (hasMaster) + { + int xCenter = tags.getInteger("xCenter"); + int yCenter = tags.getInteger("yCenter"); + int zCenter = tags.getInteger("zCenter"); + master = new CoordTuple(xCenter, yCenter, zCenter); + } + } + + public void writeToNBT (NBTTagCompound tags) + { + super.writeToNBT(tags); + tags.setBoolean("HasMaster", hasMaster); + if (hasMaster) + { + tags.setInteger("xCenter", master.x); + tags.setInteger("yCenter", master.y); + tags.setInteger("zCenter", master.z); + } + } +} diff --git a/tinker/tconstruct/logic/SmelteryDrainLogic.java b/tinker/tconstruct/logic/SmelteryDrainLogic.java new file mode 100644 index 00000000..a01b1689 --- /dev/null +++ b/tinker/tconstruct/logic/SmelteryDrainLogic.java @@ -0,0 +1,65 @@ +package tinker.tconstruct.logic; + +import net.minecraftforge.liquids.ILiquidTank; +import net.minecraftforge.liquids.LiquidStack; + +public class SmelteryDrainLogic extends MultiblockLogic + implements ILiquidTank +{ + boolean isDrain; + + public SmelteryDrainLogic(boolean drain) + { + isDrain = drain; + } + + @Override + public LiquidStack getLiquid () + { + return null; + } + + @Override + public int getCapacity () + { + if (!hasMaster) + return 0; + + SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z); + return smeltery.getCapacity(); + } + + @Override + public int fill (LiquidStack resource, boolean doFill) + { + if (hasMaster && !isDrain) //Not sure if it should fill or not + { + return 0; + } + else + { + return 0; + } + } + + @Override + public LiquidStack drain (int maxDrain, boolean doDrain) + { + if (hasMaster && isDrain) + { + SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z); + return smeltery.drain(maxDrain, doDrain); + } + else + { + return null; + } + } + + @Override + public int getTankPressure () + { + return 0; + } + +} diff --git a/tinker/tconstruct/logic/SmelteryLogic.java b/tinker/tconstruct/logic/SmelteryLogic.java index 4c2e9970..8b80f792 100644 --- a/tinker/tconstruct/logic/SmelteryLogic.java +++ b/tinker/tconstruct/logic/SmelteryLogic.java @@ -271,6 +271,7 @@ public class SmelteryLogic extends InventoryLogic worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } + /* Multiblock */ public void checkValidPlacement () { switch (getDirection()) @@ -362,6 +363,39 @@ public class SmelteryLogic extends InventoryLogic internalTemp = 20; } } + + public int getCapacity() + { + return maxLiquid; + } + + public LiquidStack drain (int maxDrain, boolean doDrain) + { + if (moltenMetal.size() == 0) + return null; + + LiquidStack liquid = moltenMetal.get(0); + if (liquid.amount - maxDrain < 0) + { + LiquidStack liq = liquid.copy(); + if (doDrain) + { + //liquid = null; + moltenMetal.remove(liquid); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + return liq; + } + else + { + if (doDrain) + { + liquid.amount -= maxDrain; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + return new LiquidStack(liquid.itemID, maxDrain, liquid.itemMeta); + } + } /* NBT */ @Override