diff options
author | Jason Mitchell <mitchej@gmail.com> | 2021-01-18 17:20:42 -0800 |
---|---|---|
committer | Jason Mitchell <mitchej@gmail.com> | 2021-01-18 17:20:42 -0800 |
commit | 94c98540f8a6044aa3e27722218f8eeb395e9cb1 (patch) | |
tree | 1c7a3b749b25e527f79c0837442412ae70a621c4 /src/main/java/gregtech/api/threads | |
parent | f3a6e82f96c2d39b6f0b1066bb2c431addfcbb7d (diff) | |
download | GT5-Unofficial-94c98540f8a6044aa3e27722218f8eeb395e9cb1.tar.gz GT5-Unofficial-94c98540f8a6044aa3e27722218f8eeb395e9cb1.tar.bz2 GT5-Unofficial-94c98540f8a6044aa3e27722218f8eeb395e9cb1.zip |
Include getBlock and getBlockMetadata in the lock
Diffstat (limited to 'src/main/java/gregtech/api/threads')
-rw-r--r-- | src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java b/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java index 494b21de1f..09b2801c79 100644 --- a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java +++ b/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java @@ -121,7 +121,8 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { // This might load a chunk... which might load a TileEntity... which might get added to `loadedTileEntityList`... which might be in the process // of being iterated over during `UpdateEntities()`... which might cause a ConcurrentModificationException. So, lock that shit. lock.lock(); - TileEntity tTileEntity = world.getTileEntity(aCoords.posX, aCoords.posY, aCoords.posZ); + final TileEntity tTileEntity = world.getTileEntity(aCoords.posX, aCoords.posY, aCoords.posZ); + final boolean isMachineBlock = GregTech_API.isMachineBlock(world.getBlock(aCoords.posX, aCoords.posY, aCoords.posZ), world.getBlockMetadata(aCoords.posX, aCoords.posY, aCoords.posZ)); lock.unlock(); // See if the block itself needs an update @@ -134,7 +135,7 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { // 3) If the block at the coordinates is marked as a machine block if (visited.size() < 5 || (tTileEntity instanceof IMachineBlockUpdateable && ((IMachineBlockUpdateable) tTileEntity).isMachineBlockUpdateRecursive()) - || GregTech_API.isMachineBlock(world.getBlock(aCoords.posX, aCoords.posY, aCoords.posZ), world.getBlockMetadata(aCoords.posX, aCoords.posY, aCoords.posZ))) + || isMachineBlock) { ChunkCoordinates tCoords; |