diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_ThreadedBuffer.java | 37 |
1 files changed, 37 insertions, 0 deletions
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 855b856f49..9642ff63ee 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 @@ -7,6 +7,7 @@ import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.minecraft.BlockPos; +import gtPlusPlus.core.util.data.ArrayUtils; import gtPlusPlus.xmod.gregtech.api.objects.GregtechBufferThread; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -378,4 +379,40 @@ public abstract class GT_MetaTileEntity_ThreadedBuffer extends GT_MetaTileEntity this.mInventorySynchro[aIndex] = aStack; } } + + private synchronized void cleanup() { + if (this.mLogicThread != null) { + this.mLogicThread.destroy(); + this.mLogicThread = null; + } + } + + @Override + public void onExplosion() { + cleanup(); + super.onExplosion(); + } + + @Override + public void onRemoval() { + cleanup(); + super.onRemoval(); + } + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public String[] getInfoData() { + String mResult[] = super.getInfoData(); + String mAdditive[] = new String[] { + "info" + }; + for (String s : mAdditive) { + ArrayUtils.expandArray(mResult, s); + } + return mResult; + } }
\ No newline at end of file |