Skip to content

Commit

Permalink
use chunkpos unpacking helper methods for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
thiakil committed Sep 3, 2024
1 parent 8aad2bc commit 2c1ef90
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private void releaseChunkTickets(@NotNull ServerLevel world, @NotNull BlockPos p
LOGGER.debug("Attempting to remove {} chunk tickets. Pos: {} World: {}", tickets, pos, world.dimension().location());
if (tickets > 0) {
for (long chunkPos : chunkSet) {
TICKET_CONTROLLER.forceChunk(world, pos, (int) chunkPos, (int) (chunkPos >> 32), false, forceTicks);
TICKET_CONTROLLER.forceChunk(world, pos, ChunkPos.getX(chunkPos), ChunkPos.getZ(chunkPos), false, forceTicks);
}
chunkSet.clear();
markDirty();
Expand Down Expand Up @@ -146,7 +146,7 @@ private void refreshChunkTickets(@NotNull ServerLevel world, @NotNull BlockPos p
if (!newChunks.contains(chunkPos)) {
//If the chunk is no longer in our chunks we want loaded
// then we need to unforce the chunk and remove it
TICKET_CONTROLLER.forceChunk(world, pos, (int) chunkPos, (int) (chunkPos >> 32), false, forceTicks);
TICKET_CONTROLLER.forceChunk(world, pos, ChunkPos.getX(chunkPos), ChunkPos.getZ(chunkPos), false, forceTicks);
chunkIt.remove();
removed++;
}
Expand All @@ -156,7 +156,7 @@ private void refreshChunkTickets(@NotNull ServerLevel world, @NotNull BlockPos p
if (chunkSet.add(chunkPos)) {
//If we didn't already have it in our chunk set and added actually added it as it is new
// then we also need to force the chunk
TICKET_CONTROLLER.forceChunk(world, pos, (int) chunkPos, (int) (chunkPos >> 32), true, forceTicks);
TICKET_CONTROLLER.forceChunk(world, pos, ChunkPos.getX(chunkPos), ChunkPos.getZ(chunkPos), true, forceTicks);
added++;
}
}
Expand Down Expand Up @@ -323,7 +323,7 @@ private void validateTickets(ServerLevel world, ResourceLocation worldName, Bloc
if (chunkLoader.chunkSet.add(chunkPos) || ticking != chunkLoader.forceTicks) {
//If we didn't already have it in our chunk set and added, or we had removed it due to it fully ticking changing,
// then we also need to force the chunk
TICKET_CONTROLLER.forceChunk(world, pos, (int) chunkPos, (int) (chunkPos >> 32), true, chunkLoader.forceTicks);
TICKET_CONTROLLER.forceChunk(world, pos, ChunkPos.getX(chunkPos), ChunkPos.getZ(chunkPos), true, chunkLoader.forceTicks);
added++;
}
}
Expand Down

0 comments on commit 2c1ef90

Please sign in to comment.