use of net.minecraft.server.level.ChunkHolder in project Denizen-For-Bukkit by DenizenScript.
the class ChunkHelperImpl method refreshChunkSections.
@Override
public void refreshChunkSections(Chunk chunk) {
ClientboundLevelChunkPacket packet = new ClientboundLevelChunkPacket(((CraftChunk) chunk).getHandle());
ChunkPos pos = new ChunkPos(chunk.getX(), chunk.getZ());
ChunkHolder playerChunk = ((CraftWorld) chunk.getWorld()).getHandle().getChunkProvider().chunkMap.l.get(pos.toLong());
if (playerChunk == null) {
return;
}
playerChunk.playerProvider.getPlayers(pos, false).forEach(player -> {
player.connection.send(packet);
});
}
Aggregations