diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-05-29 19:10:36 +1000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-05-29 19:10:36 +1000 |
commit | 29258132152e2b0b6670fffc366598ccc2b00351 (patch) | |
tree | 5cb2e3e71b7e95f5b0a5838d2ba0b1247a38e5e6 /src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity | |
parent | 272cd6156d1dc92985b613511b4cae62ef516bb1 (diff) | |
download | GT5-Unofficial-29258132152e2b0b6670fffc366598ccc2b00351.tar.gz GT5-Unofficial-29258132152e2b0b6670fffc366598ccc2b00351.tar.bz2 GT5-Unofficial-29258132152e2b0b6670fffc366598ccc2b00351.zip |
+ Added a display string to the GUI of the threaded buffers, showing seconds remaining before the thread belonging to this buffer is released. This will also show ms/25 lag info someday.
+ Added invokeGC() to SystemUtils.java.
$ More thread safety.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity')
-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 |