SteamWar/BauSystem2.0
Archiviert
12
0

Fix SmartPlaceListener
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-12-22 10:19:40 +01:00
Ursprung 202e03c957
Commit 0bf27db398

Datei anzeigen

@ -112,23 +112,21 @@ public class SmartPlaceListener implements Plain, Listener {
} }
private void run(Player player, Object packet, boolean first, boolean sneaking, boolean shouldSneak) { private void run(Player player, Object packet, boolean first, boolean sneaking, boolean shouldSneak) {
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); try {
try { packetExecutor.invoke(playerConnection.get(getHandle.invoke(player)), packet);
packetExecutor.invoke(playerConnection.get(getHandle.invoke(player)), packet); } catch (Exception e) {
} catch (Exception e) { return;
return; } finally {
} finally { SMART_PLACING.remove(player);
SMART_PLACING.remove(player); player.setSneaking(sneaking);
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);
} }
WAS_EXECUTED.remove(player); WAS_EXECUTED.remove(player);
}, first ? 0 : 1);
} }
@EventHandler @EventHandler