SteamWar/BauSystem2.0
Archiviert
12
0

Fix CancelPacketHandleException in SmartPlaceListener
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-12-22 09:24:49 +01:00
Ursprung ec10b0fe71
Commit 2cfed8b84d

Datei anzeigen

@ -103,9 +103,14 @@ public class SmartPlaceListener implements Plain, Listener {
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> { Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
if (sneaking) SMART_PLACING.add(player); if (sneaking) SMART_PLACING.add(player);
player.setSneaking(shouldSneak || sneaking); player.setSneaking(shouldSneak || sneaking);
packetExecutor.invoke(playerConnection.get(getHandle.invoke(player)), packet); try {
SMART_PLACING.remove(player); packetExecutor.invoke(playerConnection.get(getHandle.invoke(player)), packet);
player.setSneaking(sneaking); } catch (Exception e) {
return;
} finally {
SMART_PLACING.remove(player);
player.setSneaking(sneaking);
}
if (!WAS_EXECUTED.contains(player) && first) { if (!WAS_EXECUTED.contains(player) && first) {
run(player, packet, false, sneaking, shouldSneak); run(player, packet, false, sneaking, shouldSneak);