From 90368580175e2d6d7dad232f5b6a80c790dd943f Mon Sep 17 00:00:00 2001 From: MauveCloud Date: Wed, 27 Apr 2016 17:31:20 -0700 Subject: [PATCH 1/2] Improved output bus handling --- .../GT_MetaTileEntity_MultiBlockBase.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index a06b96b3..fad4ab15 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -562,16 +562,21 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { aStack = GT_Utility.copy(aStack); // FluidStack aLiquid = GT_Utility.getFluidForFilledItem(aStack, true); // if (aLiquid == null) { - for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) { - if (isValidMetaTileEntity(tHatch)) { - for (int i = tHatch.getSizeInventory() - 1; i >= 0; i--) { - if (tHatch.getBaseMetaTileEntity().addStackToSlot(i, aStack)) return true; + boolean outputSuccess = true; + while (outputSuccess && aStack.stackSize > 0) { + outputSuccess = false; + ItemStack single = aStack.splitStack(1); + for (GT_MetaTileEntity_Hatch_OutputBus tHatch : mOutputBusses) { + if (!outputSuccess && isValidMetaTileEntity(tHatch)) { + for (int i = tHatch.getSizeInventory() - 1; i >= 0 && !outputSuccess; i--) { + if (tHatch.getBaseMetaTileEntity().addStackToSlot(i, single)) outputSuccess = true; + } } } - } - for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { - if (isValidMetaTileEntity(tHatch) && tHatch.outputsItems()) { - if (tHatch.getBaseMetaTileEntity().addStackToSlot(1, aStack)) return true; + for (GT_MetaTileEntity_Hatch_Output tHatch : mOutputHatches) { + if (!outputSuccess && isValidMetaTileEntity(tHatch) && tHatch.outputsItems()) { + if (tHatch.getBaseMetaTileEntity().addStackToSlot(1, single)) outputSuccess = true; + } } } // }else { @@ -584,7 +589,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity { // } // } // } - return false; + return outputSuccess; } public boolean depleteInput(ItemStack aStack) { From a88988770b9810c37331380b430fdae068a5d2b8 Mon Sep 17 00:00:00 2001 From: MauveCloud Date: Thu, 28 Apr 2016 11:30:00 -0700 Subject: [PATCH 2/2] Improved brittle charcoal handling. --- .../java/gregtech/common/blocks/GT_Block_Reinforced.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index cd4ab71e..801cdbd3 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -40,7 +40,7 @@ import java.util.Random; public class GT_Block_Reinforced extends GT_Generic_Block { public GT_Block_Reinforced(String aName) { - super(GT_Item_Storage.class, aName, Material.rock); + super(GT_Item_Storage.class, aName, new Material(net.minecraft.block.material.MapColor.stoneColor)); setStepSound(soundTypeStone); setCreativeTab(GregTech_API.TAB_GREGTECH); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Bronzeplate Reinforced Block"); @@ -65,7 +65,8 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } public String getHarvestTool(int aMeta) { - if (aMeta == 4||aMeta == 5) return "axe"; + if (aMeta == 4) return "shovel"; + if (aMeta == 5) return "axe"; return "pickaxe"; } @@ -98,6 +99,9 @@ public class GT_Block_Reinforced extends GT_Generic_Block { if (aWorld == null) { return 0.0F; } + if (aWorld.isAirBlock(aX, aY, aZ)) { + return 0.0F; + } int tMeta = aWorld.getBlockMetadata(aX, aY, aZ); if (tMeta == 0) { return 60.0F;