use of io.xol.chunkstories.net.packets.PacketHeightmap in project chunkstories by Hugobros3.
the class HeightmapImplementation method setSummaryData.
public void setSummaryData(int[] heightData, int[] voxelData) {
// texturesUpToDate.set(false);
// 512kb per summary, use of max mipmaps for heights
heights = new int[(int) Math.ceil(256 * 256 * (1 + 1 / 3D))];
ids = new int[(int) Math.ceil(256 * 256 * (1 + 1 / 3D))];
System.arraycopy(heightData, 0, heights, 0, 256 * 256);
System.arraycopy(voxelData, 0, ids, 0, 256 * 256);
recomputeMetadata();
summaryLoaded.set(true);
if (world instanceof WorldClient) {
((WorldClient) world).getWorldRenderer().getSummariesTexturesHolder().warnDataHasArrived(regionX, regionZ);
}
// Already have clients waiting for it ? Satisfy these messieurs
usersLock.lock();
for (RemotePlayer user : usersWaitingForIntialData) {
user.pushPacket(new PacketHeightmap(this));
}
usersWaitingForIntialData.clear();
usersLock.unlock();
}
Aggregations