Merge pull request #499 from MauveCloud/experimental

Improved output bus handling
This commit is contained in:
Blood-Asp 2016-04-29 20:42:55 +02:00
commit 27eb1c67e4
2 changed files with 20 additions and 11 deletions

View file

@ -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) {
boolean outputSuccess = true;
while (outputSuccess && aStack.stackSize > 0) {
outputSuccess = false;
ItemStack single = aStack.splitStack(1);
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;
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;
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) {

View file

@ -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;