From 8d36e9a1529bf5f7f53fcfef80eebccd52b88b24 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Mon, 14 Jul 2014 16:20:52 +0100 Subject: [PATCH 1/5] Fix a bizarre bug I introduced ages ago. --- src/main/java/mekanism/client/gui/GuiDigitalMiner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/mekanism/client/gui/GuiDigitalMiner.java b/src/main/java/mekanism/client/gui/GuiDigitalMiner.java index 9115c5d5b..f1a5f6eb9 100644 --- a/src/main/java/mekanism/client/gui/GuiDigitalMiner.java +++ b/src/main/java/mekanism/client/gui/GuiDigitalMiner.java @@ -342,7 +342,7 @@ public class GuiDigitalMiner extends GuiMekanism { if(stack.getItem() instanceof ItemBlock) { - if(Block.getBlockFromItem(stack.getItem()) == Blocks.bedrock) + if(Block.getBlockFromItem(stack.getItem()) != Blocks.bedrock) { toUse = stack.copy(); toUse.stackSize = 1; From a24bd2e7ad5192d8695868a55c2a9891f95c1467 Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Mon, 14 Jul 2014 12:57:57 -0400 Subject: [PATCH 2/5] A bit of work on teleporter localization. There's something weird going on, though. --- .../common/tile/TileEntityTeleporter.java | 15 ++++++++------- .../resources/assets/mekanism/lang/en_US.lang | 8 ++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/main/java/mekanism/common/tile/TileEntityTeleporter.java b/src/main/java/mekanism/common/tile/TileEntityTeleporter.java index 0526c0caa..1aa660ffe 100644 --- a/src/main/java/mekanism/common/tile/TileEntityTeleporter.java +++ b/src/main/java/mekanism/common/tile/TileEntityTeleporter.java @@ -17,6 +17,7 @@ import mekanism.common.block.BlockMachine.MachineType; import mekanism.common.network.PacketPortalFX.PortalFXMessage; import mekanism.common.network.PacketTileEntity.TileEntityMessage; import mekanism.common.util.ChargeUtils; +import mekanism.common.util.MekanismUtils; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.player.EntityPlayerMP; @@ -57,7 +58,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements IPe public boolean prevShouldRender; /** This teleporter's current status. */ - public String status = (EnumColor.DARK_RED + "Not ready."); + public String status = (EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.notReady")); public TileEntityTeleporter() { @@ -99,22 +100,22 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements IPe switch(canTeleport()) { case 1: - status = EnumColor.DARK_GREEN + "Ready."; + status = EnumColor.DARK_GREEN + MekanismUtils.localize("gui.teleporter.ready"); break; case 2: - status = EnumColor.DARK_RED + "No frame."; + status = EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.noFrame"); break; case 3: - status = EnumColor.DARK_RED + "No link found."; + status = EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.noLink"); break; case 4: - status = EnumColor.DARK_RED + "Links > 2."; + status = EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.exceeds"); break; case 5: - status = EnumColor.DARK_RED + "Needs energy."; + status = EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.needsEnergy"); break; case 6: - status = EnumColor.DARK_GREEN + "Idle."; + status = EnumColor.DARK_GREEN + MekanismUtils.localize("gui.teleporter.idle"); break; } diff --git a/src/main/resources/assets/mekanism/lang/en_US.lang b/src/main/resources/assets/mekanism/lang/en_US.lang index 537df7f52..ba655ed45 100644 --- a/src/main/resources/assets/mekanism/lang/en_US.lang +++ b/src/main/resources/assets/mekanism/lang/en_US.lang @@ -423,6 +423,14 @@ gui.logisticalSorter.roundRobin=Round-robin gui.electricChest.editPassword=Edit Password +gui.teleporter.notReady=Not ready +gui.teleporter.ready=Ready +gui.teleporter.noFrame=No frame +gui.teleporter.noLink=No link +gui.teleporter.exceeds=Links > 2 +gui.teleporter.needsEnergy=Needs energy +gui.teleporter.idle=Idle + gui.digitalMinerConfig=Digital Miner Config gui.digitalMiner.autoPull=Auto-pull From 249638ef41618ec9869096a7445a4ed6b72a18bb Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Mon, 14 Jul 2014 20:41:13 +0100 Subject: [PATCH 3/5] Fix somehow having 2 mcmod.info files in the Mekanism jar. --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 60ab069c1..ca949e853 100644 --- a/build.gradle +++ b/build.gradle @@ -78,7 +78,7 @@ task coreJar(type: Jar) { } from zipTree(reobf.outputs.getFiles().getSingleFile()).matching { - exclude 'mekanism/tools/**', 'mekanism/generators/**' + exclude 'mekanism/tools/**', 'mekanism/generators/**', 'mcmod.info' } } From c0099401402708a56277759203bd49b30a140c5f Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Mon, 14 Jul 2014 20:47:45 +0100 Subject: [PATCH 4/5] Fix Railcraft Dependency This is such a pain. --- src/main/java/mekanism/common/Mekanism.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/mekanism/common/Mekanism.java b/src/main/java/mekanism/common/Mekanism.java index 989576be9..40a7fe8c7 100644 --- a/src/main/java/mekanism/common/Mekanism.java +++ b/src/main/java/mekanism/common/Mekanism.java @@ -162,7 +162,7 @@ import cpw.mods.fml.common.registry.GameRegistry; */ @Mod(modid = "Mekanism", name = "Mekanism", version = "7.0.0", guiFactory = "mekanism.client.gui.ConfigGuiFactory", dependencies = "after:ForgeMultipart;after:BuildCraftAPI|power;after:BuildCraftAPI|tools;after:BuildCraftAPI|transport;after:IC2API;after:CoFHAPI|energy;after:ComputerCraft;after:Galacticraft API;" + - "after:MineFactoryReloaded;after:MetallurgyCore;after:EnderIO;after:ExtraUtilities") + "after:MineFactoryReloaded;after:MetallurgyCore;after:EnderIO;after:ExtraUtilities;after:Railcraft") public class Mekanism { /** Mekanism Packet Pipeline */ From 146d974479ea96d9db387e564deff060e04b7766 Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Mon, 14 Jul 2014 17:14:32 -0400 Subject: [PATCH 5/5] Fixed Teleporter localization, fixed balloons placing on non-solid sides, added AE processing recipes, improve tele porter efficiency --- .../mekanism/client/gui/GuiTeleporter.java | 2 +- .../common/integration/OreDictManager.java | 40 ++++++++++++++ .../mekanism/common/item/ItemBalloon.java | 5 ++ .../common/item/ItemPortableTeleporter.java | 2 +- .../common/tile/TileEntityTeleporter.java | 55 ++++++++++--------- .../resources/assets/mekanism/lang/en_US.lang | 7 --- 6 files changed, 75 insertions(+), 36 deletions(-) diff --git a/src/main/java/mekanism/client/gui/GuiTeleporter.java b/src/main/java/mekanism/client/gui/GuiTeleporter.java index fd0975bd2..af99eeebf 100644 --- a/src/main/java/mekanism/client/gui/GuiTeleporter.java +++ b/src/main/java/mekanism/client/gui/GuiTeleporter.java @@ -41,7 +41,7 @@ public class GuiTeleporter extends GuiMekanism fontRendererObj.drawString(tileEntity.getInventoryName(), 45, 6, 0x404040); fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040); - fontRendererObj.drawString(tileEntity.status, 66, 19, 0x00CD00); + fontRendererObj.drawString(tileEntity.getStatusDisplay(), 66, 19, 0x00CD00); if(xAxis >= 165 && xAxis <= 169 && yAxis >= 17 && yAxis <= 69) { diff --git a/src/main/java/mekanism/common/integration/OreDictManager.java b/src/main/java/mekanism/common/integration/OreDictManager.java index 4e45cd55b..d38d930b6 100644 --- a/src/main/java/mekanism/common/integration/OreDictManager.java +++ b/src/main/java/mekanism/common/integration/OreDictManager.java @@ -307,6 +307,46 @@ public final class OreDictManager } catch(Exception e) {} } + for(ItemStack ore : OreDictionary.getOres("oreCertusQuartz")) + { + try { + RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), StackUtils.size(OreDictionary.getOres("dustCertusQuartz").get(0), 4)); + } catch(Exception e) {} + } + + for(ItemStack ore : OreDictionary.getOres("crystalCertusQuartz")) + { + try { + RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), StackUtils.size(OreDictionary.getOres("dustCertusQuartz").get(0), 1)); + } catch(Exception e) {} + } + + for(ItemStack ore : OreDictionary.getOres("dustCertusQuartz")) + { + try { + RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), StackUtils.size(OreDictionary.getOres("crystalCertusQuartz").get(0), 1)); + } catch(Exception e) {} + } + + for(ItemStack ore : OreDictionary.getOres("gemQuartz")) + { + try { + RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), StackUtils.size(OreDictionary.getOres("dustNetherQuartz").get(0), 1)); + } catch(Exception e) {} + } + + for(ItemStack ore : OreDictionary.getOres("dustNetherQuartz")) + { + try { + RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), StackUtils.size(OreDictionary.getOres("gemQuartz").get(0), 1)); + } catch(Exception e) {} + } + + for(ItemStack ore : OreDictionary.getOres("oreQuartz")) + { + RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Items.quartz, 6)); + } + for(ItemStack ore : OreDictionary.getOres("ingotCopper")) { RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 6)); diff --git a/src/main/java/mekanism/common/item/ItemBalloon.java b/src/main/java/mekanism/common/item/ItemBalloon.java index 30179407a..50c697ce2 100644 --- a/src/main/java/mekanism/common/item/ItemBalloon.java +++ b/src/main/java/mekanism/common/item/ItemBalloon.java @@ -104,6 +104,11 @@ public class ItemBalloon extends ItemMekanism { obj.yCoord--; } + + if(!world.isSideSolid(x, y, z, ForgeDirection.UP)) + { + return true; + } if(canReplace(world, obj.xCoord, obj.yCoord+1, obj.zCoord) && canReplace(world, obj.xCoord, obj.yCoord+2, obj.zCoord)) { diff --git a/src/main/java/mekanism/common/item/ItemPortableTeleporter.java b/src/main/java/mekanism/common/item/ItemPortableTeleporter.java index 3e976ebfd..1b962bb28 100644 --- a/src/main/java/mekanism/common/item/ItemPortableTeleporter.java +++ b/src/main/java/mekanism/common/item/ItemPortableTeleporter.java @@ -56,7 +56,7 @@ public class ItemPortableTeleporter extends ItemEnergized case 2: return EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.needsEnergy"); case 3: - return EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.linksCapacity"); + return EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.exceeds"); case 4: return EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.noLink"); default: diff --git a/src/main/java/mekanism/common/tile/TileEntityTeleporter.java b/src/main/java/mekanism/common/tile/TileEntityTeleporter.java index 1aa660ffe..1a113a34a 100644 --- a/src/main/java/mekanism/common/tile/TileEntityTeleporter.java +++ b/src/main/java/mekanism/common/tile/TileEntityTeleporter.java @@ -58,7 +58,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements IPe public boolean prevShouldRender; /** This teleporter's current status. */ - public String status = (EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.notReady")); + public byte status = 0; public TileEntityTeleporter() { @@ -96,30 +96,10 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements IPe newCoords.add(Coord4D.get(this)); Mekanism.teleporters.put(code, newCoords); } + + status = canTeleport(); - switch(canTeleport()) - { - case 1: - status = EnumColor.DARK_GREEN + MekanismUtils.localize("gui.teleporter.ready"); - break; - case 2: - status = EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.noFrame"); - break; - case 3: - status = EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.noLink"); - break; - case 4: - status = EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.exceeds"); - break; - case 5: - status = EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.needsEnergy"); - break; - case 6: - status = EnumColor.DARK_GREEN + MekanismUtils.localize("gui.teleporter.idle"); - break; - } - - if(canTeleport() == 1 && teleDelay == 0) + if(status == 1 && teleDelay == 0) { teleport(); } @@ -129,8 +109,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements IPe cleanTeleportCache(); } - byte b = canTeleport(); - shouldRender = b == 1 || b > 4; + shouldRender = status == 1 || status > 4; if(shouldRender != prevShouldRender) { @@ -144,6 +123,27 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements IPe ChargeUtils.discharge(0, this); } + + public String getStatusDisplay() + { + switch(status) + { + case 1: + return EnumColor.DARK_GREEN + MekanismUtils.localize("gui.teleporter.ready"); + case 2: + return EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.noFrame"); + case 3: + return EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.noLink"); + case 4: + return EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.exceeds"); + case 5: + return EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.needsEnergy"); + case 6: + return EnumColor.DARK_GREEN + MekanismUtils.localize("gui.idle"); + } + + return EnumColor.DARK_RED + MekanismUtils.localize("gui.teleporter.noLink"); + } public void cleanTeleportCache() { @@ -488,12 +488,13 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements IPe { code.digitFour = dataStream.readInt(); } + return; } super.handlePacketData(dataStream); - status = PacketHandler.readString(dataStream).trim(); + status = dataStream.readByte(); code.digitOne = dataStream.readInt(); code.digitTwo = dataStream.readInt(); code.digitThree = dataStream.readInt(); diff --git a/src/main/resources/assets/mekanism/lang/en_US.lang b/src/main/resources/assets/mekanism/lang/en_US.lang index ba655ed45..2adc3bbfe 100644 --- a/src/main/resources/assets/mekanism/lang/en_US.lang +++ b/src/main/resources/assets/mekanism/lang/en_US.lang @@ -389,12 +389,6 @@ gui.materialFilter.details=Using material of gui.portableTeleporter=Portable Teleporter -gui.teleporter.notReady=Not Ready -gui.teleporter.ready=Ready -gui.teleporter.needsEnergy=Needs energy -gui.teleporter.linksCapacity=Links > 2 -gui.teleporter.noLink=No link found - gui.robit=Robit entity.Robit.name=Robit gui.robit.smelting=Robit Smelting @@ -429,7 +423,6 @@ gui.teleporter.noFrame=No frame gui.teleporter.noLink=No link gui.teleporter.exceeds=Links > 2 gui.teleporter.needsEnergy=Needs energy -gui.teleporter.idle=Idle gui.digitalMinerConfig=Digital Miner Config