Fixed rollbacks not checking world when teleporting players. (Fixes #453)

This commit is contained in:
Intelli 2023-09-18 15:46:33 -06:00
parent 69c163468f
commit 9f3196dc97

View File

@ -1258,10 +1258,11 @@ public class Rollback extends Queue {
if (preview == 0) { if (preview == 0) {
for (Player player : Bukkit.getOnlinePlayers()) { for (Player player : Bukkit.getOnlinePlayers()) {
Location playerLocation = player.getLocation(); Location playerLocation = player.getLocation();
String playerWorld = playerLocation.getWorld().getName();
int chunkX = playerLocation.getBlockX() >> 4; int chunkX = playerLocation.getBlockX() >> 4;
int chunkZ = playerLocation.getBlockZ() >> 4; int chunkZ = playerLocation.getBlockZ() >> 4;
if (chunkX == finalChunkX && chunkZ == finalChunkZ) { if (bukkitRollbackWorld.getName().equals(playerWorld) && chunkX == finalChunkX && chunkZ == finalChunkZ) {
Teleport.performSafeTeleport(player, playerLocation, false); Teleport.performSafeTeleport(player, playerLocation, false);
} }
} }