From b588e82ef749c1f047182a7b230c157a3965c42e Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Fri, 16 Jun 2017 01:40:16 +0200 Subject: [PATCH] Fix buffer and regulator RS signals --- .../implementations/GT_MetaTileEntity_Buffer.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java index 3fcef913..dabb9f3f 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java @@ -224,13 +224,16 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified() || aTimer % 200 == 0 || mSuccess > 0)) { mSuccess--; moveItems(aBaseMetaTileEntity, aTimer); - aBaseMetaTileEntity.setGenericRedstoneOutput(bInvert); + for(byte b = 0;b<6;b++) + aBaseMetaTileEntity.setInternalOutputRedstoneSignal(b,bInvert ? (byte)15 : (byte)0); if (bRedstoneIfFull) { - aBaseMetaTileEntity.setGenericRedstoneOutput(!bInvert); + for(byte b = 0;b<6;b++) + aBaseMetaTileEntity.setInternalOutputRedstoneSignal(b,bInvert ? (byte)0 : (byte)15); for (int i = 0; i < mInventory.length; i++) if (isValidSlot(i)) { if (mInventory[i] == null) { - aBaseMetaTileEntity.setGenericRedstoneOutput(bInvert); + for(byte b = 0;b<6;b++) + aBaseMetaTileEntity.setInternalOutputRedstoneSignal(b,bInvert ? (byte)15 : (byte)0); aBaseMetaTileEntity.decreaseStoredEnergyUnits(1, true); break; } @@ -239,6 +242,12 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM } } + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + for(byte b = 0;b<6;b++) + aBaseMetaTileEntity.setInternalOutputRedstoneSignal(b,(byte)0); + } + protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { int tCost = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()), aBaseMetaTileEntity.getBackFacing(), aBaseMetaTileEntity.getFrontFacing(), null, false, mTargetStackSize == 0 ? 64 : (byte) mTargetStackSize, mTargetStackSize == 0 ? 1 : (byte) mTargetStackSize, (byte) 64, (byte) 1); if (tCost > 0 || aBaseMetaTileEntity.hasInventoryBeenModified()) {