diff options
Diffstat (limited to 'patches/api/0099-EndermanAttackPlayerEvent.patch')
-rw-r--r-- | patches/api/0099-EndermanAttackPlayerEvent.patch | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/patches/api/0099-EndermanAttackPlayerEvent.patch b/patches/api/0099-EndermanAttackPlayerEvent.patch index e634beaedd..25dc5e0c39 100644 --- a/patches/api/0099-EndermanAttackPlayerEvent.patch +++ b/patches/api/0099-EndermanAttackPlayerEvent.patch @@ -9,10 +9,10 @@ This allows you to override/extend the pumpkin/stare logic. diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..ae34e679723a2ef436da04c116038272743a8f35 +index 0000000000000000000000000000000000000000..b261e0420002da3f94862e664edc65536cd05fc8 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java -@@ -0,0 +1,101 @@ +@@ -0,0 +1,98 @@ +/* + * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License + * @@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..ae34e679723a2ef436da04c116038272 +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; +import org.jetbrains.annotations.ApiStatus; -+import org.jetbrains.annotations.NotNull; ++import org.jspecify.annotations.NullMarked; + +/** + * Fired when an Enderman determines if it should attack a player or not. @@ -52,15 +52,16 @@ index 0000000000000000000000000000000000000000..ae34e679723a2ef436da04c116038272 + * Starts off cancelled if the player is wearing a pumpkin head or is not looking + * at the Enderman, according to Vanilla rules. + */ ++@NullMarked +public class EndermanAttackPlayerEvent extends EntityEvent implements Cancellable { + + private static final HandlerList HANDLER_LIST = new HandlerList(); + -+ @NotNull private final Player player; ++ private final Player player; + private boolean cancelled; + + @ApiStatus.Internal -+ public EndermanAttackPlayerEvent(@NotNull Enderman entity, @NotNull Player player) { ++ public EndermanAttackPlayerEvent(final Enderman entity, final Player player) { + super(entity); + this.player = player; + } @@ -70,7 +71,6 @@ index 0000000000000000000000000000000000000000..ae34e679723a2ef436da04c116038272 + * + * @return The enderman considering attacking + */ -+ @NotNull + @Override + public Enderman getEntity() { + return (Enderman) super.getEntity(); @@ -81,7 +81,6 @@ index 0000000000000000000000000000000000000000..ae34e679723a2ef436da04c116038272 + * + * @return The player the Enderman is considering attacking + */ -+ @NotNull + public Player getPlayer() { + return this.player; + } @@ -100,16 +99,14 @@ index 0000000000000000000000000000000000000000..ae34e679723a2ef436da04c116038272 + * Cancels if the Enderman will attack this player + */ + @Override -+ public void setCancelled(boolean cancel) { ++ public void setCancelled(final boolean cancel) { + this.cancelled = cancel; + } + -+ @NotNull + public HandlerList getHandlers() { + return HANDLER_LIST; + } + -+ @NotNull + public static HandlerList getHandlerList() { + return HANDLER_LIST; + } |