Skip to content

Commit

Permalink
Merge pull request #499 from MauveCloud/experimental
Browse files Browse the repository at this point in the history
Improved output bus handling
  • Loading branch information
Blood-Asp committed Apr 29, 2016
2 parents 5c8eec8 + b69385d commit 27eb1c6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,16 +562,21 @@ public boolean addOutput(ItemStack aStack) {
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 {
Expand All @@ -584,7 +589,7 @@ public boolean addOutput(ItemStack aStack) {
// }
// }
// }
return false;
return outputSuccess;
}

public boolean depleteInput(ItemStack aStack) {
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
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");
Expand All @@ -65,7 +65,8 @@ public GT_Block_Reinforced(String aName) {
}

public String getHarvestTool(int aMeta) {
if (aMeta == 4||aMeta == 5) return "axe";
if (aMeta == 4) return "shovel";
if (aMeta == 5) return "axe";
return "pickaxe";
}

Expand Down Expand Up @@ -98,6 +99,9 @@ public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
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;
Expand Down

0 comments on commit 27eb1c6

Please sign in to comment.