Only disable the handle, if suitable.

This commit is contained in:
asofold 2018-04-02 18:42:43 +02:00
parent 59d518a6b9
commit d52138ab60
1 changed files with 5 additions and 2 deletions

View File

@ -1135,10 +1135,13 @@ public class BlockChangeTracker {
}
public void updateBlockCacheHandle() {
if (this.blockCacheHandle != null) {
final IGenericInstanceHandle<BlockCache> newHandle = NCPAPIProvider.getNoCheatPlusAPI().getGenericInstanceHandle(BlockCache.class);
// TODO: Doesn't make much sense to disable, until reference counting is fixed/implemented.
if (this.blockCacheHandle != null
&& this.blockCacheHandle != newHandle) {
this.blockCacheHandle.disableHandle();
}
this.blockCacheHandle = NCPAPIProvider.getNoCheatPlusAPI().getGenericInstanceHandle(BlockCache.class);
this.blockCacheHandle = newHandle;
}
/**