From f887c642796d77adb7a5baf559092807d8274f81 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Tue, 29 May 2018 14:58:07 +1000 Subject: $ More work on threaded super buffers. $ Fixed the infinite item holder. --- .../implementations/GT_MetaTileEntity_ThreadedBuffer.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity') diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ThreadedBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ThreadedBuffer.java index 20e1d726d3..c7914331b7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ThreadedBuffer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ThreadedBuffer.java @@ -16,7 +16,7 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; public abstract class GT_MetaTileEntity_ThreadedBuffer extends GT_MetaTileEntity_Buffer { - + protected GregtechBufferThread mLogicThread; public final ItemStack[] mInventorySynchro; @@ -63,7 +63,7 @@ public abstract class GT_MetaTileEntity_ThreadedBuffer extends GT_MetaTileEntity this.mTargetStackSize = 0; this.mInventorySynchro = new ItemStack[aInvSlotCount]; } - + public synchronized final GregtechBufferThread getLogicThread() { if (mLogicThread != null) { return mLogicThread; @@ -297,7 +297,8 @@ public abstract class GT_MetaTileEntity_ThreadedBuffer extends GT_MetaTileEntity } public synchronized void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTimer) { - getLogicThread().onPostTick(aBaseMetaTileEntity, aTimer, this); + if (aBaseMetaTileEntity.isServerSide()) + getLogicThread().onPostTick(aBaseMetaTileEntity, aTimer, this); } public void onFirstTick(final IGregTechTileEntity aBaseMetaTileEntity) { @@ -307,7 +308,8 @@ public abstract class GT_MetaTileEntity_ThreadedBuffer extends GT_MetaTileEntity } protected synchronized void moveItems(final IGregTechTileEntity aBaseMetaTileEntity, final long aTimer) { - getLogicThread().moveItems(aBaseMetaTileEntity, aTimer, this); + if (aBaseMetaTileEntity.isServerSide()) + getLogicThread().moveItems(aBaseMetaTileEntity, aTimer, this); } public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, @@ -323,9 +325,9 @@ public abstract class GT_MetaTileEntity_ThreadedBuffer extends GT_MetaTileEntity public boolean allowGeneralRedstoneOutput() { return true; } - + //Custom inventory handler - + @Override public synchronized ItemStack[] getRealInventory() { return this.mInventorySynchro; -- cgit