From f6bca1d2c9622a7aa792370aaaa977f4facd378f Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Wed, 15 Jan 2014 23:52:10 -0500 Subject: [PATCH] Added Salination Plant component recipes, removed a few printlns, more descriptive multiblock issue notifications --- .../client/gui/GuiSalinationController.java | 22 +++++++++- common/mekanism/common/Mekanism.java | 6 +++ .../tile/TileEntitySalinationController.java | 44 +++++++++++-------- 3 files changed, 52 insertions(+), 20 deletions(-) diff --git a/common/mekanism/client/gui/GuiSalinationController.java b/common/mekanism/client/gui/GuiSalinationController.java index 488221896..d89d5e1a0 100644 --- a/common/mekanism/client/gui/GuiSalinationController.java +++ b/common/mekanism/client/gui/GuiSalinationController.java @@ -35,7 +35,7 @@ public class GuiSalinationController extends GuiMekanism fontRenderer.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 4, 0x404040); - fontRenderer.drawString("Structure: " + (tileEntity.structured ? MekanismUtils.localize("gui.on") : MekanismUtils.localize("gui.off")), 50, 21, 0x00CD00); + fontRenderer.drawString(getStruct(), 50, 21, 0x00CD00); fontRenderer.drawString("Height: " + tileEntity.height, 50, 30, 0x00CD00); fontRenderer.drawString("Mult: " + getTempMult(), 50, 39, 0x00CD00); fontRenderer.drawString("Max: " + getMaxTemp(), 50, 48, 0x00CD00); @@ -58,6 +58,26 @@ public class GuiSalinationController extends GuiMekanism super.drawGuiContainerForegroundLayer(mouseX, mouseY); } + private String getStruct() + { + if(tileEntity.structured) + { + return "Structured"; + } + else if(!tileEntity.structured) + { + if(tileEntity.controllerConflict) + { + return "Conflict"; + } + else { + return "Incomplete"; + } + } + + return null; + } + private String getTemp() { float temp = (float)Math.round((tileEntity.getTemperature()*200)*10)/10F; diff --git a/common/mekanism/common/Mekanism.java b/common/mekanism/common/Mekanism.java index 524e3ebb5..8eb497ce0 100644 --- a/common/mekanism/common/Mekanism.java +++ b/common/mekanism/common/Mekanism.java @@ -527,6 +527,12 @@ public class Mekanism CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(MachineBlock2, 1, 5), new Object[] { "ICI", "ASA", "ICI", Character.valueOf('I'), "ingotIron", Character.valueOf('C'), "circuitBasic", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('S'), new ItemStack(BasicBlock, 1, 8) })); + CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 1, 14), new Object[] { + "CGC", "IBI", "CGC", Character.valueOf('C'), "circuitBasic", Character.valueOf('G'), Block.thinGlass, Character.valueOf('I'), new ItemStack(BasicBlock, 1, 8), Character.valueOf('B'), "blockCopper" + })); + CraftingManager.getInstance().getRecipeList().add(new MekanismRecipe(new ItemStack(BasicBlock, 1, 15), new Object[] { + "ITI", "CBC", "ITI", Character.valueOf('I'), "ingotCopper", Character.valueOf('T'), new ItemStack(BasicBlock, 1, 11), Character.valueOf('C'), "circuitBasic", Character.valueOf('B'), new ItemStack(BasicBlock, 1, 8) + })); for(RecipeType type : RecipeType.values()) { diff --git a/common/mekanism/common/tile/TileEntitySalinationController.java b/common/mekanism/common/tile/TileEntitySalinationController.java index eac0a8380..b80b9b752 100644 --- a/common/mekanism/common/tile/TileEntitySalinationController.java +++ b/common/mekanism/common/tile/TileEntitySalinationController.java @@ -300,22 +300,19 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp return false; } } - - if((x == 1 || x == 2) && (z == 1 || z == 2)) - { - if(!pointer.isAirBlock(worldObj)) - { - return false; - } - } else { - TileEntity pointerTile = pointer.getTileEntity(worldObj); - - if(!addTankPart(pointerTile)) + if((x == 1 || x == 2) && (z == 1 || z == 2)) { - if(pointerTile != this && pointerTile instanceof TileEntitySalinationController) + if(!pointer.isAirBlock(worldObj)) + { + return false; + } + } + else { + TileEntity pointerTile = pointer.getTileEntity(worldObj); + + if(!addTankPart(pointerTile)) { - controllerConflict = true; return false; } } @@ -372,7 +369,9 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp } } else { - if(!addTankPart(pointer.getTileEntity(worldObj))) + TileEntity pointerTile = pointer.getTileEntity(worldObj); + + if(!addTankPart(pointerTile)) { return false; } @@ -441,7 +440,7 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp if(!addTankPart(tile)) { - return false; + return false; } current = current.getFromSide(back); @@ -452,14 +451,22 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp public boolean addTankPart(TileEntity tile) { - if(tile instanceof TileEntitySalinationTank && !(tile instanceof TileEntitySalinationController)) + if(tile instanceof TileEntitySalinationTank && (tile == this || !(tile instanceof TileEntitySalinationController))) { - ((TileEntitySalinationTank)tile).addToStructure(this); - tankParts.add((TileEntitySalinationTank)tile); + if(tile != this) + { + ((TileEntitySalinationTank)tile).addToStructure(this); + tankParts.add((TileEntitySalinationTank)tile); + } return true; } else { + if(tile != this && tile instanceof TileEntitySalinationController) + { + controllerConflict = true; + } + return false; } } @@ -468,7 +475,6 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp { if(tile instanceof TileEntityAdvancedSolarGenerator && !tile.isInvalid()) { - System.out.println(tile.xCoord + " " + tile.yCoord + " " + zCoord); solars[i] = (TileEntityAdvancedSolarGenerator)tile; return true; }