diff --git a/common/mekanism/client/gui/GuiElectrolyticSeparator.java b/common/mekanism/client/gui/GuiElectrolyticSeparator.java index f5fa9c71e..cc196e1ba 100644 --- a/common/mekanism/client/gui/GuiElectrolyticSeparator.java +++ b/common/mekanism/client/gui/GuiElectrolyticSeparator.java @@ -66,10 +66,12 @@ public class GuiElectrolyticSeparator extends GuiContainer int yAxis = (mouseY - (height - ySize) / 2); fontRenderer.drawString(tileEntity.getInvName(), 45, 6, 0x404040); - String name = tileEntity.leftTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.leftTank.getGas().getGas().getLocalizedName(); + + String name = tileEntity.dumpLeft ? "Dumping..." : tileEntity.leftTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.leftTank.getGas().getGas().getLocalizedName(); fontRenderer.drawString(name, 21, 73, 0x404040); - name = tileEntity.rightTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.rightTank.getGas().getGas().getLocalizedName(); - fontRenderer.drawString(name, 152-(name.length()*5), 73, 0x404040); + + name = tileEntity.dumpRight ? "Dumping..." : tileEntity.rightTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.rightTank.getGas().getGas().getLocalizedName(); + fontRenderer.drawString(name, 156-fontRenderer.getStringWidth(name), 73, 0x404040); if(xAxis >= 6 && xAxis <= 22 && yAxis >= 11 && yAxis <= 69) { diff --git a/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java b/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java index e484e4428..dfcbb55b6 100644 --- a/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java +++ b/common/mekanism/client/nei/MetallurgicInfuserRecipeHandler.java @@ -1,6 +1,11 @@ package mekanism.client.nei; +import static codechicken.core.gui.GuiDraw.changeTexture; +import static codechicken.core.gui.GuiDraw.drawTexturedModalRect; + import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; @@ -19,7 +24,6 @@ import org.lwjgl.opengl.GL11; import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; import codechicken.nei.recipe.TemplateRecipeHandler; -import static codechicken.core.gui.GuiDraw.*; public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler { @@ -54,17 +58,19 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler return "mekanism.infuser"; } - public ItemStack getInfuseStack(InfuseType type) + public List getInfuseStacks(InfuseType type) { + List ret = new ArrayList(); + for(Map.Entry obj : InfuseRegistry.getObjectMap().entrySet()) { if(obj.getValue().type == type) { - return obj.getKey(); + ret.add(obj.getKey()); } } - return null; + return ret; } public Set> getRecipes() @@ -119,7 +125,7 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler { for(Map.Entry irecipe : getRecipes()) { - arecipes.add(new CachedIORecipe(irecipe, getInfuseStack(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType)); + arecipes.add(new CachedIORecipe(irecipe, getInfuseStacks(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType)); } } else { @@ -140,7 +146,7 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler { if(NEIServerUtils.areStacksSameTypeCrafting(((InfusionOutput)irecipe.getValue()).resource, result)) { - arecipes.add(new CachedIORecipe(irecipe, getInfuseStack(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType)); + arecipes.add(new CachedIORecipe(irecipe, getInfuseStacks(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType)); } } } @@ -152,16 +158,17 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler { if(NEIServerUtils.areStacksSameTypeCrafting(((InfusionInput)irecipe.getKey()).inputStack, ingredient)) { - arecipes.add(new CachedIORecipe(irecipe, getInfuseStack(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType)); + arecipes.add(new CachedIORecipe(irecipe, getInfuseStacks(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType)); } } } public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe { + public List infuseStacks; + public PositionedStack inputStack; public PositionedStack outputStack; - public PositionedStack infuseStack; public InfuseType infusionType; @@ -180,27 +187,24 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler @Override public PositionedStack getOtherStack() { - return infuseStack; + return new PositionedStack(infuseStacks.get(cycleticks/40 % infuseStacks.size()), 12, 20); } - public CachedIORecipe(ItemStack input, ItemStack output, ItemStack infuse, InfuseType type) + public CachedIORecipe(ItemStack input, ItemStack output, List infuses, InfuseType type) { super(); inputStack = new PositionedStack(input, 46, 28); outputStack = new PositionedStack(output, 104, 28); - if(infuse != null) - { - infuseStack = new PositionedStack(infuse, 12, 20); - } + infuseStacks = infuses; infusionType = type; } - public CachedIORecipe(Map.Entry recipe, ItemStack infuse, InfuseType type) + public CachedIORecipe(Map.Entry recipe, List infuses, InfuseType type) { - this(((InfusionInput)recipe.getKey()).inputStack, ((InfusionOutput)recipe.getValue()).resource, infuse, type); + this(((InfusionInput)recipe.getKey()).inputStack, ((InfusionOutput)recipe.getValue()).resource, infuses, type); } } } diff --git a/common/mekanism/common/block/BlockMachine.java b/common/mekanism/common/block/BlockMachine.java index f508301d5..34060b6ee 100644 --- a/common/mekanism/common/block/BlockMachine.java +++ b/common/mekanism/common/block/BlockMachine.java @@ -1074,7 +1074,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds CHEMICAL_OXIDIZER(Mekanism.machineBlock2ID, 1, "ChemicalOxidizer", 29, 20000, TileEntityChemicalOxidizer.class, true, false), CHEMICAL_INFUSER(Mekanism.machineBlock2ID, 2, "ChemicalInfuser", 30, 20000, TileEntityChemicalInfuser.class, true, false), CHEMICAL_INJECTION_CHAMBER(Mekanism.machineBlock2ID, 3, "ChemicalInjectionChamber", 31, Mekanism.chemicalInjectionChamberUsage*400, TileEntityChemicalInjectionChamber.class, false, true), - ELECTROLYTIC_SEPARATOR(Mekanism.machineBlock2ID, 4, "ElectrolyticSeparator", 32, 20000, TileEntityElectrolyticSeparator.class, true, true); + ELECTROLYTIC_SEPARATOR(Mekanism.machineBlock2ID, 4, "ElectrolyticSeparator", 32, 20000, TileEntityElectrolyticSeparator.class, true, false); public int typeId; diff --git a/common/mekanism/common/item/ItemBlockMachine.java b/common/mekanism/common/item/ItemBlockMachine.java index 1bc84d1f4..502b37636 100644 --- a/common/mekanism/common/item/ItemBlockMachine.java +++ b/common/mekanism/common/item/ItemBlockMachine.java @@ -278,6 +278,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec if(tileEntity instanceof TileEntityFactory) { ((TileEntityFactory)tileEntity).recipeType = getRecipeType(stack); + world.notifyBlocksOfNeighborChange(x, y, z, tileEntity.getBlockType().blockID); } if(tileEntity instanceof ISustainedTank) diff --git a/common/mekanism/common/multipart/PartLogisticalTransporter.java b/common/mekanism/common/multipart/PartLogisticalTransporter.java index 4079c720e..3169bcaf4 100644 --- a/common/mekanism/common/multipart/PartLogisticalTransporter.java +++ b/common/mekanism/common/multipart/PartLogisticalTransporter.java @@ -743,7 +743,7 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti @Override public boolean onRightClick(EntityPlayer player, int side) { - player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.viewColor") + ": " + color != null ? color.getName() : "None")); + player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.viewColor") + ": " + (color != null ? color.getName() : "None"))); return true; } diff --git a/common/mekanism/common/tileentity/TileEntityAdvancedBoundingBlock.java b/common/mekanism/common/tileentity/TileEntityAdvancedBoundingBlock.java index e72927795..76103fe52 100644 --- a/common/mekanism/common/tileentity/TileEntityAdvancedBoundingBlock.java +++ b/common/mekanism/common/tileentity/TileEntityAdvancedBoundingBlock.java @@ -369,6 +369,14 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp public IAdvancedBoundingBlock getInv() { + TileEntity tile = new Coord4D(mainX, mainY, mainZ, worldObj.provider.dimensionId).getTileEntity(worldObj); + + if(!(tile instanceof IAdvancedBoundingBlock)) + { + worldObj.setBlockToAir(xCoord, yCoord, zCoord); + return null; + } + return (IAdvancedBoundingBlock)new Coord4D(mainX, mainY, mainZ, worldObj.provider.dimensionId).getTileEntity(worldObj); } } diff --git a/common/mekanism/common/tileentity/TileEntityElectrolyticSeparator.java b/common/mekanism/common/tileentity/TileEntityElectrolyticSeparator.java index 09bebe618..184269b7f 100644 --- a/common/mekanism/common/tileentity/TileEntityElectrolyticSeparator.java +++ b/common/mekanism/common/tileentity/TileEntityElectrolyticSeparator.java @@ -147,7 +147,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp if(worldObj.rand.nextInt(3) == 2) { - PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getParticlePacket(new ArrayList())), Coord4D.get(this), 40D); + PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getParticlePacket(0, new ArrayList())), Coord4D.get(this), 40D); } } } @@ -174,7 +174,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp if(worldObj.rand.nextInt(3) == 2) { - PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getParticlePacket(new ArrayList())), Coord4D.get(this), 40D); + PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getParticlePacket(1, new ArrayList())), Coord4D.get(this), 40D); } } } @@ -219,22 +219,35 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp } } - public void spawnParticle() + public void spawnParticle(int type) { - switch(facing) + if(type == 0) { - case 3: - worldObj.spawnParticle("smoke", xCoord+0.1, yCoord+1, zCoord+0.25, 0.0D, 0.0D, 0.0D); - break; - case 4: - worldObj.spawnParticle("smoke", xCoord+0.75, yCoord+1, zCoord+0.1, 0.0D, 0.0D, 0.0D); - break; - case 2: - worldObj.spawnParticle("smoke", xCoord+0.9, yCoord+1, zCoord+0.75, 0.0D, 0.0D, 0.0D); - break; - case 5: - worldObj.spawnParticle("smoke", xCoord+0.25, yCoord+1, zCoord+0.9, 0.0D, 0.0D, 0.0D); - break; + ForgeDirection side = ForgeDirection.getOrientation(facing); + + double x = xCoord + (side.offsetX == 0 ? 0.5 : Math.max(side.offsetX, 0)); + double z = zCoord + (side.offsetZ == 0 ? 0.5 : Math.max(side.offsetZ, 0)); + + worldObj.spawnParticle("smoke", x, yCoord + 0.5, z, 0.0D, 0.0D, 0.0D); + + } + else if(type == 1) + { + switch(facing) + { + case 3: + worldObj.spawnParticle("smoke", xCoord+0.9, yCoord+1, zCoord+0.75, 0.0D, 0.0D, 0.0D); + break; + case 4: + worldObj.spawnParticle("smoke", xCoord+0.25, yCoord+1, zCoord+0.9, 0.0D, 0.0D, 0.0D); + break; + case 2: + worldObj.spawnParticle("smoke", xCoord+0.1, yCoord+1, zCoord+0.25, 0.0D, 0.0D, 0.0D); + break; + case 5: + worldObj.spawnParticle("smoke", xCoord+0.75, yCoord+1, zCoord+0.1, 0.0D, 0.0D, 0.0D); + break; + } } } @@ -390,7 +403,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp } else if(type == 1) { - spawnParticle(); + spawnParticle(dataStream.readInt()); } } @@ -437,10 +450,11 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp return data; } - public ArrayList getParticlePacket(ArrayList data) + public ArrayList getParticlePacket(int type, ArrayList data) { super.getNetworkedData(data); data.add(1); + data.add(type); return data; } diff --git a/common/mekanism/common/tileentity/TileEntityFactory.java b/common/mekanism/common/tileentity/TileEntityFactory.java index efcfcf2da..08abf666a 100644 --- a/common/mekanism/common/tileentity/TileEntityFactory.java +++ b/common/mekanism/common/tileentity/TileEntityFactory.java @@ -144,6 +144,7 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IPerip { worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType().blockID); } + if(updateDelay > 0) { updateDelay--; @@ -188,6 +189,8 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IPerip recipeType = toSet.ordinal(); setSecondaryEnergy(0); + worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType().blockID); + MekanismUtils.saveChunk(this); } } diff --git a/resources/assets/mekanism/lang/ru_RU.lang b/resources/assets/mekanism/lang/ru_RU.lang index dac691164..088dc1136 100644 --- a/resources/assets/mekanism/lang/ru_RU.lang +++ b/resources/assets/mekanism/lang/ru_RU.lang @@ -155,6 +155,7 @@ item.tinIngot.name=Оловянный слиток gas.hydrogen=Водород gas.oxygen=Кислород gas.water=Водяной пар +gas.chlorine=Хлор gas.sulfurDioxideGas=Диоксид серы gas.sulfurTrioxideGas=Триоксид серы gas.sulfuricAcid=Серная кислота @@ -162,6 +163,7 @@ gas.sulfuricAcid=Серная кислота //Fluids fluid.hydrogen=Жидкий водород fluid.oxygen=Жидкий кислород +fluid.chlorine=Жидкий хлор fluid.sulfurDioxideGas=Жидкий диоксид серы fluid.sulfurTrioxideGas=Жидкий триоксид серы fluid.sulfuricAcid=Жидкая серная кислота diff --git a/resources/assets/mekanism/render/ElectrolyticSeparator.png b/resources/assets/mekanism/render/ElectrolyticSeparator.png index c00b7e5e8..1e369ee9a 100644 Binary files a/resources/assets/mekanism/render/ElectrolyticSeparator.png and b/resources/assets/mekanism/render/ElectrolyticSeparator.png differ