@@ -734,7 +734,7 @@ private void processBlockChanges() {
734
734
Map <Key , Map <BlockVector , BlockChangeMessage >> chunks = new HashMap <>();
735
735
for (BlockChangeMessage message : messages ) {
736
736
if (message != null ) {
737
- Key key = new Key (message .getX () >> 4 , message .getZ () >> 4 );
737
+ Key key = GlowChunk . ChunkKeyStore . get (message .getX () >> 4 , message .getZ () >> 4 );
738
738
if (canSeeChunk (key )) {
739
739
Map <BlockVector , BlockChangeMessage > map = chunks .computeIfAbsent (key , k -> new HashMap <>());
740
740
map .put (new BlockVector (message .getX (), message .getY (), message .getZ ()), message );
@@ -772,7 +772,7 @@ private void streamBlocks() {
772
772
int radius = Math .min (server .getViewDistance (), 1 + settings .getViewDistance ());
773
773
for (int x = centralX - radius ; x <= centralX + radius ; x ++) {
774
774
for (int z = centralZ - radius ; z <= centralZ + radius ; z ++) {
775
- Key key = new Key (x , z );
775
+ Key key = GlowChunk . ChunkKeyStore . get (x , z );
776
776
if (knownChunks .contains (key )) {
777
777
previousChunks .remove (key );
778
778
} else {
@@ -2188,7 +2188,7 @@ public void sendBlockChange(Location loc, int material, byte data) {
2188
2188
2189
2189
public void sendBlockChange (BlockChangeMessage message ) {
2190
2190
// only send message if the chunk is within visible range
2191
- Key key = new Key (message .getX () >> 4 , message .getZ () >> 4 );
2191
+ Key key = GlowChunk . ChunkKeyStore . get (message .getX () >> 4 , message .getZ () >> 4 );
2192
2192
if (canSeeChunk (key )) {
2193
2193
blockChanges .add (message );
2194
2194
}
@@ -2953,7 +2953,7 @@ private void sendBlockBreakAnimation(Location loc, int destroyStage) {
2953
2953
}
2954
2954
2955
2955
private void broadcastBlockBreakAnimation (GlowBlock block , int destroyStage ) {
2956
- GlowChunk .Key key = new GlowChunk .Key (block .getChunk ().getX (), block .getChunk ().getZ ());
2956
+ GlowChunk .Key key = GlowChunk .ChunkKeyStore . get (block .getChunk ().getX (), block .getChunk ().getZ ());
2957
2957
block .getWorld ().getRawPlayers ().stream ()
2958
2958
.filter (player -> player .canSeeChunk (key ) && player != this )
2959
2959
.forEach (player -> player .sendBlockBreakAnimation (block .getLocation (), destroyStage ));
0 commit comments