From db4adce2a8ccc85557f9a8d386705cb1563ee165 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 12 Feb 2015 19:18:16 -0600 Subject: [PATCH 1/3] Shift-click items to top (fill) slot --- .../inventory/container/ContainerGasTank.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/main/java/mekanism/common/inventory/container/ContainerGasTank.java b/src/main/java/mekanism/common/inventory/container/ContainerGasTank.java index cafbf2e18..37bd1d732 100644 --- a/src/main/java/mekanism/common/inventory/container/ContainerGasTank.java +++ b/src/main/java/mekanism/common/inventory/container/ContainerGasTank.java @@ -68,26 +68,16 @@ public class ContainerGasTank extends Container if(slotStack.getItem() instanceof IGasItem) { if(slotID != 0 && slotID != 1) - { - if(!mergeItemStack(slotStack, 1, 2, false)) - { - if(!mergeItemStack(slotStack, 0, 1, false)) - { - return null; - } - } - } - else if(slotID == 1) { if(!mergeItemStack(slotStack, 0, 1, false)) { - if(!mergeItemStack(slotStack, 2, inventorySlots.size(), false)) + if(!mergeItemStack(slotStack, 1, 2, false)) { return null; } } } - else if(slotID == 0) + else { if(!mergeItemStack(slotStack, 2, inventorySlots.size(), true)) { From dd404b4209212d22a63ea1cacd7e6489875e6a34 Mon Sep 17 00:00:00 2001 From: Ben Spiers Date: Fri, 20 Feb 2015 13:55:55 +0000 Subject: [PATCH 2/3] Let's try that again, shall we? Reimplement redstone checks to not load chunks. --- src/main/java/mekanism/common/util/MekanismUtils.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/mekanism/common/util/MekanismUtils.java b/src/main/java/mekanism/common/util/MekanismUtils.java index bf2556f55..5309a8fc1 100644 --- a/src/main/java/mekanism/common/util/MekanismUtils.java +++ b/src/main/java/mekanism/common/util/MekanismUtils.java @@ -671,9 +671,16 @@ public final class MekanismUtils { Coord4D sideCoord = coord.getFromSide(side); - if(sideCoord.exists(world)) + if(sideCoord.exists(world) && sideCoord.getFromSide(side).exists(world)) { - if(world.getIndirectPowerLevelTo(sideCoord.xCoord, sideCoord.yCoord, sideCoord.zCoord, side.ordinal()) > 0) + if(sideCoord.getFromSide(side).exists(world)) + { + if(world.getIndirectPowerLevelTo(sideCoord.xCoord, sideCoord.yCoord, sideCoord.zCoord, side.ordinal()) > 0) + { + return true; + } + } + else if(world.isBlockProvidingPowerTo(sideCoord.xCoord, sideCoord.yCoord, sideCoord.zCoord, side.ordinal()) > 0) { return true; } From 8570748ad9855ccb522a72f8e4279bd90b336b09 Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Mon, 23 Feb 2015 10:12:45 -0600 Subject: [PATCH 3/3] Fix for a gas-generator with empty tank throwing exception during onChunkLoad (bug #2148) --- .../generators/common/tile/TileEntityGasGenerator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/mekanism/generators/common/tile/TileEntityGasGenerator.java b/src/main/java/mekanism/generators/common/tile/TileEntityGasGenerator.java index ffda3ac6a..d24fc8969 100644 --- a/src/main/java/mekanism/generators/common/tile/TileEntityGasGenerator.java +++ b/src/main/java/mekanism/generators/common/tile/TileEntityGasGenerator.java @@ -266,7 +266,8 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH fuelTank.read(nbtTags.getCompoundTag("fuelTank")); - FuelGas fuel = FuelHandler.getFuel(fuelTank.getGas().getGas()); + boolean isTankEmpty = (fuelTank.getGas() == null); + FuelGas fuel = (isTankEmpty) ? null : FuelHandler.getFuel(fuelTank.getGas().getGas()); if(fuel != null) {