diff options
Diffstat (limited to 'patches/api/0228-Add-EntityLoadCrossbowEvent.patch')
-rw-r--r-- | patches/api/0228-Add-EntityLoadCrossbowEvent.patch | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/patches/api/0228-Add-EntityLoadCrossbowEvent.patch b/patches/api/0228-Add-EntityLoadCrossbowEvent.patch index 2a60c84538..d0cf6dbf2c 100644 --- a/patches/api/0228-Add-EntityLoadCrossbowEvent.patch +++ b/patches/api/0228-Add-EntityLoadCrossbowEvent.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add EntityLoadCrossbowEvent diff --git a/src/main/java/io/papermc/paper/event/entity/EntityLoadCrossbowEvent.java b/src/main/java/io/papermc/paper/event/entity/EntityLoadCrossbowEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..8434ea803e3135380f9351c82a414ccb65c478a9 +index 0000000000000000000000000000000000000000..f7631a5ac0f2ccfa6b81bea9ab54b30fbb3278dd --- /dev/null +++ b/src/main/java/io/papermc/paper/event/entity/EntityLoadCrossbowEvent.java -@@ -0,0 +1,96 @@ +@@ -0,0 +1,92 @@ +package io.papermc.paper.event.entity; + +import org.bukkit.entity.LivingEntity; @@ -19,11 +19,12 @@ index 0000000000000000000000000000000000000000..8434ea803e3135380f9351c82a414ccb +import org.bukkit.inventory.EquipmentSlot; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.ApiStatus; -+import org.jetbrains.annotations.NotNull; ++import org.jspecify.annotations.NullMarked; + +/** + * Called when a LivingEntity loads a crossbow with a projectile. + */ ++@NullMarked +public class EntityLoadCrossbowEvent extends EntityEvent implements Cancellable { + + private static final HandlerList HANDLER_LIST = new HandlerList(); @@ -35,13 +36,12 @@ index 0000000000000000000000000000000000000000..8434ea803e3135380f9351c82a414ccb + private boolean cancelled; + + @ApiStatus.Internal -+ public EntityLoadCrossbowEvent(@NotNull LivingEntity entity, @NotNull ItemStack crossbow, @NotNull EquipmentSlot hand) { ++ public EntityLoadCrossbowEvent(final LivingEntity entity, final ItemStack crossbow, final EquipmentSlot hand) { + super(entity); + this.crossbow = crossbow; + this.hand = hand; + } + -+ @NotNull + @Override + public LivingEntity getEntity() { + return (LivingEntity) super.getEntity(); @@ -52,7 +52,6 @@ index 0000000000000000000000000000000000000000..8434ea803e3135380f9351c82a414ccb + * + * @return the crossbow involved in this event + */ -+ @NotNull + public ItemStack getCrossbow() { + return this.crossbow; + } @@ -62,7 +61,6 @@ index 0000000000000000000000000000000000000000..8434ea803e3135380f9351c82a414ccb + * + * @return the hand + */ -+ @NotNull + public EquipmentSlot getHand() { + return this.hand; + } @@ -77,7 +75,7 @@ index 0000000000000000000000000000000000000000..8434ea803e3135380f9351c82a414ccb + /** + * @param consume should the item be consumed + */ -+ public void setConsumeItem(boolean consume) { ++ public void setConsumeItem(final boolean consume) { + this.consumeItem = consume; + } + @@ -91,17 +89,15 @@ index 0000000000000000000000000000000000000000..8434ea803e3135380f9351c82a414ccb + * projectile that would be loaded into the crossbow will not be consumed. + */ + @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; + } |