13
0
geforkt von Mirrors/Paper

Adds PlayerArmSwingEvent

Dieser Commit ist enthalten in:
Jake Potrebic 2021-03-12 19:20:03 -08:00
Ursprung a2a581ba6b
Commit 1284f0bf53
2 geänderte Dateien mit 30 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -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;
}
}

Datei anzeigen

@ -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();