отсутствие чанка не должно генерировать exception's
This commit is contained in:
@@ -25,9 +25,11 @@ public class CoreEventListener {
|
|||||||
|
|
||||||
Chunk chunk;
|
Chunk chunk;
|
||||||
chunk = event.getPlayer().getWorld().getChunk(event.getOldLocation()); // Old chunk
|
chunk = event.getPlayer().getWorld().getChunk(event.getOldLocation()); // Old chunk
|
||||||
|
if (chunk == null) return;
|
||||||
int ccX = chunk.getX();
|
int ccX = chunk.getX();
|
||||||
int ccZ = chunk.getZ();
|
int ccZ = chunk.getZ();
|
||||||
chunk = event.getPlayer().getWorld().getChunk(event.getNewLocation()); // Next chunk
|
chunk = event.getPlayer().getWorld().getChunk(event.getNewLocation()); // Next chunk
|
||||||
|
if (chunk == null) return;
|
||||||
int ncX = chunk.getX();
|
int ncX = chunk.getX();
|
||||||
int ncZ = chunk.getZ();
|
int ncZ = chunk.getZ();
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class PlayerEventListener {
|
|||||||
for(Integer compressXZ : event.getNeedLoadChunks()) {
|
for(Integer compressXZ : event.getNeedLoadChunks()) {
|
||||||
int[] xz = CompactedCoords.uncompressXZ(compressXZ);
|
int[] xz = CompactedCoords.uncompressXZ(compressXZ);
|
||||||
Chunk chunk = event.getPlayer().getWorld().getChunk(xz[0], xz[1]);
|
Chunk chunk = event.getPlayer().getWorld().getChunk(xz[0], xz[1]);
|
||||||
|
if (chunk == null) continue;
|
||||||
|
|
||||||
ChunkDataPacket packet = new ChunkDataPacket();
|
ChunkDataPacket packet = new ChunkDataPacket();
|
||||||
packet.setX(xz[0]);
|
packet.setX(xz[0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user