Skip to content

Commit

Permalink
chunkOffset - Keep lock until done (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlgorithmX2 committed Mar 1, 2018
1 parent 03f93b7 commit 0770bba
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -89,16 +89,17 @@ public BlockPos chunkOffset()
{
return BlockPos.ORIGIN;
}

final int bitMask = ~0xf;
final Iterator<TileEntityBlockChiseledTESR> i = getTiles().iterator();
final BlockPos tilepos = i.hasNext() ? i.next().getPos() : BlockPos.ORIGIN;
return new BlockPos( tilepos.getX() & bitMask, tilepos.getY() & bitMask, tilepos.getZ() & bitMask );
}
finally
{
tiles.getReadLock().unlock();
}

final int bitMask = ~0xf;
final Iterator<TileEntityBlockChiseledTESR> i = getTiles().iterator();
final BlockPos tilepos = i.hasNext() ? i.next().getPos() : BlockPos.ORIGIN;
return new BlockPos( tilepos.getX() & bitMask, tilepos.getY() & bitMask, tilepos.getZ() & bitMask );
}

AxisAlignedBB renderBox = null;
Expand Down

0 comments on commit 0770bba

Please sign in to comment.