Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-25 15:50:10 +01:00
Don't cancel normal suffocation
Dieser Commit ist enthalten in:
Ursprung
ca1ba4f422
Commit
5cc421cff9
@ -102,7 +102,14 @@ public class PlayerSneakListener extends ViaBukkitListener {
|
|||||||
|
|
||||||
Player player = (Player) event.getEntity();
|
Player player = (Player) event.getEntity();
|
||||||
if (!sneakingUuids.contains(player.getUniqueId())) return;
|
if (!sneakingUuids.contains(player.getUniqueId())) return;
|
||||||
event.setCancelled(true);
|
|
||||||
|
// Don't cancel when they should actually be suffocating; Essentially cancel when the head is in the top block only ever so slightly
|
||||||
|
// ~0.041 should suffice, but gotta stay be safe
|
||||||
|
double y = player.getEyeLocation().getY() + 0.045;
|
||||||
|
y -= (int) y;
|
||||||
|
if (y < 0.09) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren