From 27d2219fb848ab616fbf64436c6e26147b5763aa Mon Sep 17 00:00:00 2001 From: BuildTools Date: Wed, 4 Aug 2021 22:58:33 +0800 Subject: [PATCH] Fix dimension --- src/main/java/net/minestom/server/entity/Player.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/minestom/server/entity/Player.java b/src/main/java/net/minestom/server/entity/Player.java index f8b38da7e..43a0553b2 100644 --- a/src/main/java/net/minestom/server/entity/Player.java +++ b/src/main/java/net/minestom/server/entity/Player.java @@ -568,6 +568,10 @@ public class Player extends LivingEntity implements CommandSender, Localizable, super.setInstance(instance, spawnPosition); + if (dimensionChange) { + sendDimension(instance.getDimensionType()); + } + if (updateChunks) { // Warning: loop to remove once `refreshVisibleChunks` manage it this.viewableChunks.forEach(chunk -> @@ -576,9 +580,6 @@ public class Player extends LivingEntity implements CommandSender, Localizable, } if (dimensionChange || firstSpawn) { - if (dimensionChange) { - sendDimension(instance.getDimensionType()); - } synchronizePosition(true); // So the player doesn't get stuck this.inventory.update(); }