diff options
Diffstat (limited to 'patches/api/0040-Add-EntityZapEvent.patch')
-rw-r--r-- | patches/api/0040-Add-EntityZapEvent.patch | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/patches/api/0040-Add-EntityZapEvent.patch b/patches/api/0040-Add-EntityZapEvent.patch index 08fe17b28a..a9b79bd56b 100644 --- a/patches/api/0040-Add-EntityZapEvent.patch +++ b/patches/api/0040-Add-EntityZapEvent.patch @@ -6,34 +6,34 @@ Subject: [PATCH] Add EntityZapEvent diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityZapEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityZapEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..dc6d15975a47e68c5bd939e68ddd2773028a6ac8 +index 0000000000000000000000000000000000000000..af2b1629f845ffe1559e7d580b482636cc6441d9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityZapEvent.java -@@ -0,0 +1,69 @@ +@@ -0,0 +1,65 @@ +package com.destroystokyo.paper.event.entity; + ++import java.util.Collections; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LightningStrike; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityTransformEvent; -+ -+import java.util.Collections; +import org.jetbrains.annotations.ApiStatus; -+import org.jetbrains.annotations.NotNull; ++import org.jspecify.annotations.NullMarked; + +/** + * Fired when lightning strikes an entity + */ ++@NullMarked +public class EntityZapEvent extends EntityTransformEvent implements Cancellable { + + private static final HandlerList HANDLER_LIST = new HandlerList(); + -+ @NotNull private final LightningStrike bolt; ++ private final LightningStrike bolt; + private boolean cancelled; + + @ApiStatus.Internal -+ public EntityZapEvent(@NotNull final Entity entity, @NotNull final LightningStrike bolt, @NotNull final Entity replacementEntity) { ++ public EntityZapEvent(final Entity entity, final LightningStrike bolt, final Entity replacementEntity) { + super(entity, Collections.singletonList(replacementEntity), TransformReason.LIGHTNING); + this.bolt = bolt; + } @@ -43,7 +43,6 @@ index 0000000000000000000000000000000000000000..dc6d15975a47e68c5bd939e68ddd2773 + * + * @return The lightning bolt responsible for this event + */ -+ @NotNull + public LightningStrike getBolt() { + return this.bolt; + } @@ -53,7 +52,6 @@ index 0000000000000000000000000000000000000000..dc6d15975a47e68c5bd939e68ddd2773 + * + * @return The entity that will replace the struck entity + */ -+ @NotNull + public Entity getReplacementEntity() { + return super.getTransformedEntity(); + } @@ -64,17 +62,15 @@ index 0000000000000000000000000000000000000000..dc6d15975a47e68c5bd939e68ddd2773 + } + + @Override -+ public void setCancelled(boolean cancel) { ++ public void setCancelled(final boolean cancel) { + this.cancelled = cancel; + } + -+ @NotNull + @Override + public HandlerList getHandlers() { + return HANDLER_LIST; + } + -+ @NotNull + public static HandlerList getHandlerList() { + return HANDLER_LIST; + } |