geforkt von Mirrors/Paper
Adds PlayerArmSwingEvent
Dieser Commit ist enthalten in:
Ursprung
a2a581ba6b
Commit
1284f0bf53
@ -0,0 +1,29 @@
|
||||
package io.papermc.paper.event.player;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
||||
import org.bukkit.event.player.PlayerAnimationType;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
|
||||
@NullMarked
|
||||
public class PlayerArmSwingEvent extends PlayerAnimationEvent {
|
||||
|
||||
private final EquipmentSlot equipmentSlot;
|
||||
|
||||
@ApiStatus.Internal
|
||||
public PlayerArmSwingEvent(final Player player, final EquipmentSlot equipmentSlot) {
|
||||
super(player, equipmentSlot == EquipmentSlot.HAND ? PlayerAnimationType.ARM_SWING : PlayerAnimationType.OFF_ARM_SWING);
|
||||
this.equipmentSlot = equipmentSlot;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the hand of the arm swing.
|
||||
*
|
||||
* @return the hand
|
||||
*/
|
||||
public EquipmentSlot getHand() {
|
||||
return this.equipmentSlot;
|
||||
}
|
||||
}
|
@ -7,6 +7,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Represents a player animation event
|
||||
* <br>Use {@link io.papermc.paper.event.player.PlayerArmSwingEvent} for determining which arm was swung.
|
||||
*/
|
||||
public class PlayerAnimationEvent extends PlayerEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren