diff options
Diffstat (limited to 'patches/api/0035-Add-PlayerUseUnknownEntityEvent.patch')
-rw-r--r-- | patches/api/0035-Add-PlayerUseUnknownEntityEvent.patch | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/patches/api/0035-Add-PlayerUseUnknownEntityEvent.patch b/patches/api/0035-Add-PlayerUseUnknownEntityEvent.patch index e0d410dc6e..49715a5255 100644 --- a/patches/api/0035-Add-PlayerUseUnknownEntityEvent.patch +++ b/patches/api/0035-Add-PlayerUseUnknownEntityEvent.patch @@ -10,10 +10,10 @@ Co-authored-by: Nassim Jahnke <[email protected]> diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..dbb635686e9108b9d3df5d373e6972cca07c0621 +index 0000000000000000000000000000000000000000..9ff2bbf7f99df45cc626cad60bec4d14a8a04e3e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java -@@ -0,0 +1,86 @@ +@@ -0,0 +1,85 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.entity.Player; @@ -23,8 +23,8 @@ index 0000000000000000000000000000000000000000..dbb635686e9108b9d3df5d373e6972cc +import org.bukkit.inventory.EquipmentSlot; +import org.bukkit.util.Vector; +import org.jetbrains.annotations.ApiStatus; -+import org.jetbrains.annotations.NotNull; -+import org.jetbrains.annotations.Nullable; ++import org.jspecify.annotations.NullMarked; ++import org.jspecify.annotations.Nullable; + +/** + * Represents an event that is called when a player right-clicks an unknown entity. @@ -33,17 +33,18 @@ index 0000000000000000000000000000000000000000..dbb635686e9108b9d3df5d373e6972cc + * This event may be called multiple times per interaction with different interaction hands + * and with or without the clicked position. + */ ++@NullMarked +public class PlayerUseUnknownEntityEvent extends PlayerEvent { + + private static final HandlerList HANDLER_LIST = new HandlerList(); + + private final int entityId; + private final boolean attack; -+ private final @NotNull EquipmentSlot hand; ++ private final EquipmentSlot hand; + private final @Nullable Vector clickedPosition; + + @ApiStatus.Internal -+ public PlayerUseUnknownEntityEvent(@NotNull Player player, int entityId, boolean attack, @NotNull EquipmentSlot hand, @Nullable Vector clickedPosition) { ++ public PlayerUseUnknownEntityEvent(final Player player, final int entityId, final boolean attack, final EquipmentSlot hand, final @Nullable Vector clickedPosition) { + super(player); + this.entityId = entityId; + this.attack = attack; @@ -74,7 +75,7 @@ index 0000000000000000000000000000000000000000..dbb635686e9108b9d3df5d373e6972cc + * + * @return the hand used to interact + */ -+ public @NotNull EquipmentSlot getHand() { ++ public EquipmentSlot getHand() { + return this.hand; + } + @@ -89,13 +90,11 @@ index 0000000000000000000000000000000000000000..dbb635686e9108b9d3df5d373e6972cc + return this.clickedPosition != null ? this.clickedPosition.clone() : null; + } + -+ @NotNull + @Override + public HandlerList getHandlers() { + return HANDLER_LIST; + } + -+ @NotNull + public static HandlerList getHandlerList() { + return HANDLER_LIST; + } |