mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Reset flying with elytra when the player is on the ground
This commit is contained in:
parent
34d428be10
commit
cd988f1271
@ -2223,6 +2223,10 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
||||
|
||||
public void refreshOnGround(boolean onGround) {
|
||||
this.onGround = onGround;
|
||||
if(this.onGround && this.isFlyingWithElytra()) {
|
||||
this.setFlyingWithElytra(false);
|
||||
this.callEvent(PlayerStopFlyingWithElytraEvent.class, new PlayerStopFlyingWithElytraEvent(this));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,12 @@
|
||||
package net.minestom.server.event.player;
|
||||
|
||||
import net.minestom.server.entity.Player;
|
||||
import net.minestom.server.event.PlayerEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class PlayerStopFlyingWithElytraEvent extends PlayerEvent {
|
||||
|
||||
public PlayerStopFlyingWithElytraEvent(@NotNull Player player) {
|
||||
super(player);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user