fixed generation ofo elytrarace
This commit is contained in:
+10
@@ -24,6 +24,7 @@ import net.minestom.server.event.player.PlayerMoveEvent;
|
||||
import net.minestom.server.event.player.PlayerStartFlyingWithElytraEvent;
|
||||
import net.minestom.server.event.player.PlayerStopFlyingWithElytraEvent;
|
||||
import net.minestom.server.event.player.PlayerUseItemEvent;
|
||||
import net.minestom.server.instance.Chunk;
|
||||
import net.minestom.server.instance.batch.AbsoluteBlockBatch;
|
||||
import net.minestom.server.instance.block.Block;
|
||||
import net.minestom.server.item.ItemStack;
|
||||
@@ -209,7 +210,16 @@ public class ElytraRace extends StatelessGame {
|
||||
point -> batch.setBlock(point, Block.AIR)
|
||||
);
|
||||
|
||||
int minChunkX = (ringPos.blockX() - 100) >> 4;
|
||||
int maxChunkX = (ringPos.blockX() + 100) >> 4;
|
||||
int chunkZ = ringPos.blockZ() >> 4;
|
||||
|
||||
BatchUtil.loadAndApplyBatch(batch, this, () -> {
|
||||
for(int cx = minChunkX; cx <= maxChunkX; cx++) {
|
||||
Chunk chunk = this.getChunk(cx, chunkZ);
|
||||
if(chunk == null) continue;
|
||||
this.getPlayers().forEach(chunk::sendChunk);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user