Skip to content

Commit

Permalink
fix: chunk loading, if chunks are not at 0
Browse files Browse the repository at this point in the history
  • Loading branch information
RealBauHD committed Nov 26, 2023
1 parent d6b460e commit 3551beb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ public void calculateChunks(final Position from, final Position to, boolean chec

public void calculateChunks(final Position from, final Position to,
boolean check, boolean checkAlreadyLoaded,
int range, int oldRange) {
byte range, byte oldRange) {
final var fromChunkX = chunkCoordinate(from.x());
final var fromChunkZ = chunkCoordinate(from.z());
final var chunkX = chunkCoordinate(to.x());
Expand All @@ -420,8 +420,8 @@ public void calculateChunks(final Position from, final Position to,
if (fromChunkX == chunkX && fromChunkZ == chunkZ) {
return;
}
this.send(new CenterChunk(chunkX, chunkZ));
}
this.send(new CenterChunk(chunkX, chunkZ));
final var chunks = new ArrayList<SculkChunk>((range * 2 + 1) * (range * 2 + 1));
this.connection.forChunksInRange(chunkX, chunkZ, range, (x, z) -> {
final var chunk = world.chunk(x, z);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.github.sculkpowered.server.protocol.Buffer;
import io.github.sculkpowered.server.protocol.packet.Packet;
import io.github.sculkpowered.server.protocol.packet.PacketHandler;

public final class ConfirmTeleportation implements Packet {

Expand All @@ -12,6 +13,11 @@ public void decode(Buffer buf) {
this.teleportId = buf.readVarInt();
}

@Override
public boolean handle(PacketHandler handler) {
return handler.handle(this);
}

@Override
public String toString() {
return "ConfirmTeleportation{" +
Expand Down

0 comments on commit 3551beb

Please sign in to comment.