Browse Source

Woops needed to unlock later in the code

Gregorius Techneticies 3 months ago
parent
commit
b31af56fcb
Signed by: Gregorius Techneticies <gregoriustech@gmail.com> GPG Key ID: 1B693EA14F2FD70F

+ 3
- 1
src/main/java/gregapi/tileentity/ITileEntityMachineBlockUpdateable.java View File

@@ -127,9 +127,9 @@ public interface ITileEntityMachineBlockUpdateable {
127 127
 				// Wait for the updateEntities Thread to be done because fucking Mojang and race conditions in loading Chunks.
128 128
 				TICK_LOCK.lock();
129 129
 				TileEntity tTileEntity = WD.te(aWorld, aCoords, T);
130
-				TICK_LOCK.unlock();
131 130
 				if (tTileEntity instanceof ITileEntityMachineBlockUpdateable) ((ITileEntityMachineBlockUpdateable)tTileEntity).onMachineBlockUpdate(mCoords, mBlock, mMeta, mRemoved);
132 131
 				if (aSet.size() < 5 || tTileEntity instanceof ITileEntityMachineBlockUpdateable || isMachineBlock(aWorld.getBlock(aCoords.posX, aCoords.posY, aCoords.posZ), aWorld.getBlockMetadata(aCoords.posX, aCoords.posY, aCoords.posZ))) {
132
+					TICK_LOCK.unlock();
133 133
 					ChunkCoordinates tCoords;
134 134
 					if (aSet.add(tCoords = new ChunkCoordinates(aCoords.posX+1, aCoords.posY  , aCoords.posZ  ))) stepToUpdateMachine(aWorld, tCoords, aSet);
135 135
 					if (aSet.add(tCoords = new ChunkCoordinates(aCoords.posX-1, aCoords.posY  , aCoords.posZ  ))) stepToUpdateMachine(aWorld, tCoords, aSet);
@@ -137,6 +137,8 @@ public interface ITileEntityMachineBlockUpdateable {
137 137
 					if (aSet.add(tCoords = new ChunkCoordinates(aCoords.posX  , aCoords.posY-1, aCoords.posZ  ))) stepToUpdateMachine(aWorld, tCoords, aSet);
138 138
 					if (aSet.add(tCoords = new ChunkCoordinates(aCoords.posX  , aCoords.posY  , aCoords.posZ+1))) stepToUpdateMachine(aWorld, tCoords, aSet);
139 139
 					if (aSet.add(tCoords = new ChunkCoordinates(aCoords.posX  , aCoords.posY  , aCoords.posZ-1))) stepToUpdateMachine(aWorld, tCoords, aSet);
140
+				} else {
141
+					TICK_LOCK.unlock();
140 142
 				}
141 143
 			}
142 144
 		}

Loading…
Cancel
Save