From db053d5aa9ea3172ffd89a5b025543c7a206afbf Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Tue, 30 Sep 2025 12:47:05 -0400 Subject: [PATCH] Fix incorrect coords passing --- .../org/dreeam/leaf/world/DespawnMap.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/leaf-server/src/main/java/org/dreeam/leaf/world/DespawnMap.java b/leaf-server/src/main/java/org/dreeam/leaf/world/DespawnMap.java index a9728e19..61e357b9 100644 --- a/leaf-server/src/main/java/org/dreeam/leaf/world/DespawnMap.java +++ b/leaf-server/src/main/java/org/dreeam/leaf/world/DespawnMap.java @@ -34,18 +34,18 @@ public final class DespawnMap implements Consumer { } boolean fallback = false; for (Map.Entry e : worldConfiguration.entities.spawning.despawnRanges.entrySet()) { - OptionalInt a = e.getValue().soft().verticalLimit.value(); - OptionalInt b = e.getValue().soft().horizontalLimit.value(); - OptionalInt c = e.getValue().hard().verticalLimit.value(); - OptionalInt d = e.getValue().hard().horizontalLimit.value(); - if (a.isPresent() && b.isPresent() && a.getAsInt() == b.getAsInt()) { - sort[e.getKey().ordinal()] = a.getAsInt(); - } else if (a.isPresent() || b.isPresent()) { + OptionalInt softVertical = e.getValue().soft().verticalLimit.value(); + OptionalInt softHorizontal = e.getValue().soft().horizontalLimit.value(); + OptionalInt hardVertical = e.getValue().hard().verticalLimit.value(); + OptionalInt hardHorizontal = e.getValue().hard().horizontalLimit.value(); + if (softVertical.isPresent() && softHorizontal.isPresent() && softVertical.getAsInt() == softHorizontal.getAsInt()) { + sort[e.getKey().ordinal()] = softVertical.getAsInt(); + } else if (softVertical.isPresent() || softHorizontal.isPresent()) { fallback = true; } - if (c.isPresent() && d.isPresent() && c.getAsInt() == d.getAsInt()) { - hard[e.getKey().ordinal()] = c.getAsInt(); - } else if (c.isPresent() || d.isPresent()) { + if (hardVertical.isPresent() && hardHorizontal.isPresent() && hardVertical.getAsInt() == hardHorizontal.getAsInt()) { + hard[e.getKey().ordinal()] = hardVertical.getAsInt(); + } else if (hardVertical.isPresent() || hardHorizontal.isPresent()) { fallback = true; } } @@ -78,7 +78,7 @@ public final class DespawnMap implements Consumer { for (int j = 0; j < i; j++) { indices[j] = j; } - tree.build(new double[][]{pxl, pzl, pyl}, indices); + tree.build(new double[][]{pxl, pyl, pzl}, indices); this.difficultyIsPeaceful = world.getDifficulty() == Difficulty.PEACEFUL; if (fallback) { entityTickList.forEach(entity -> entity.leaf$checkDespawnFallback(this));