Skip to content

Commit

Permalink
fix off-by-one for chunk spirals
Browse files Browse the repository at this point in the history
  • Loading branch information
astei committed May 24, 2022
1 parent 8a3179d commit bd3972e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

@Mixin(SharedConstants.class)
public class ResourceLeakDetectorDisableConditionalMixin {
@Redirect(method = "<clinit>", at = @At(value = "INVOKE", target = "Lio/netty/util/ResourceLeakDetector;setLevel(Lio/netty/util/ResourceLeakDetector$Level;)V"))
//@Redirect(method = "<clinit>", at = @At(value = "INVOKE", target = "Lio/netty/util/ResourceLeakDetector;setLevel(Lio/netty/util/ResourceLeakDetector$Level;)V"))
private static void clinit$resourceLeakDetectorDisableConditional(ResourceLeakDetector.Level level) {
if (System.getProperty("io.netty.leakDetection.level") == null) {
// Allow the user to override the leak detection level in the Minecraft server with the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private void sendSpiralChunkWatchPackets(ServerPlayerEntity player) {
int t = this.watchDistance * 2;
int maxI = t * t * 2;
for (int i = 0; i < maxI; i++) {
if ((-this.watchDistance <= x) && (x <= this.watchDistance) && (-this.watchDistance <= z) && (z <= this.watchDistance)) {
if ((-this.watchDistance - 1 <= x) && (x <= this.watchDistance + 1) && (-this.watchDistance - 1 <= z) && (z <= this.watchDistance + 1)) {
this.sendWatchPackets(player,
new ChunkPos(chunkPosX + x, chunkPosZ + z),
new MutableObject<>(), false, true);
Expand Down

0 comments on commit bd3972e

Please sign in to comment.