public boolean commitAsyncQueue() { boolean updated = false; PhysicsUpdate update; EffectIterator ei = new EffectIterator(); while ((update = asyncQueue.poll()) != null) { updated = true; update.getRange().initEffectIterator(ei); int x = update.getX(); int y = update.getY(); int z = update.getZ(); while (ei.hasNext()) { IntVector3 v = ei.next(); int ox = x + v.getX(); int oy = y + v.getY(); int oz = z + v.getZ(); if ((ox & MASK) == (x & MASK) && (oy & MASK) == (y & MASK) && (oz & MASK) == (z & MASK)) { queueForUpdate(ox, oy, oz, update.getOldMaterial()); } else if (ox >= 0 && ox < Region.BLOCKS.SIZE && oy >= 0 && oy < Region.BLOCKS.SIZE && oz >= 0 && oz < Region.BLOCKS.SIZE) { region.updateBlockPhysics(ox, oy, oz, update.getOldMaterial()); } else { region .getWorld() .queueBlockPhysics( region.getBlockX() + ox, region.getBlockY() + oy, region.getBlockZ() + oz, EffectRange.THIS, update.getOldMaterial()); } } } return updated; }
private void checkStages() { this.regionThread = region.getExecutionThread(); TickStage.checkStage(globalStages, localStages, regionThread); }