SteamWar/BauSystem2.0
Archiviert
12
0

Fix SpectatorListener.resendChunks
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2024-02-17 12:22:56 +01:00
Ursprung cc15781b44
Commit a05116a16c

Datei anzeigen

@ -42,7 +42,6 @@ import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityPickupItemEvent; import org.bukkit.event.entity.EntityPickupItemEvent;
import org.bukkit.event.player.*; import org.bukkit.event.player.*;
import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
@ -115,13 +114,11 @@ public class SpectatorListener implements Listener {
} }
private static void resendChunks(Player player) { private static void resendChunks(Player player) {
int distance = player.getClientViewDistance(); Location location = player.getLocation().clone();
Location location = player.getLocation(); player.teleport(location.clone().add(16.0 * player.getClientViewDistance(), 0, 16.0 * player.getClientViewDistance()));
for (int x = (int) Math.floor(location.getX() / 16.0) - distance; x <= (int) Math.ceil(location.getX() / 16.0) + distance; x++) { Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
for (int z = (int) Math.floor(location.getZ() / 16.0) - distance; z <= (int) Math.ceil(location.getZ() / 16.0) + distance; z++) { player.teleport(location);
CraftbukkitWrapper.impl.sendChunk(player, x, z); }, 5);
}
}
} }
private boolean anySupervisorOnline(Player player) { private boolean anySupervisorOnline(Player player) {