mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-08 16:12:18 -07:00
[ci skip] Cleanup events (#10202)
This commit is contained in:
@@ -25,12 +25,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * Called when a LivingEntity loads a crossbow with a projectile.
|
||||
+ */
|
||||
+public class EntityLoadCrossbowEvent extends EntityEvent implements Cancellable {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ private final ItemStack crossbow;
|
||||
+ private final EquipmentSlot hand;
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ private boolean consumeItem = true;
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public EntityLoadCrossbowEvent(@NotNull LivingEntity entity, @NotNull ItemStack crossbow, @NotNull EquipmentSlot hand) {
|
||||
@@ -42,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public LivingEntity getEntity() {
|
||||
+ return (LivingEntity) entity;
|
||||
+ return (LivingEntity) super.getEntity();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -52,7 +54,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public ItemStack getCrossbow() {
|
||||
+ return crossbow;
|
||||
+ return this.crossbow;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -62,19 +64,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public EquipmentSlot getHand() {
|
||||
+ return hand;
|
||||
+ return this.hand;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ *
|
||||
+ * @return should the itemstack be consumed
|
||||
+ */
|
||||
+ public boolean shouldConsumeItem() {
|
||||
+ return consumeItem;
|
||||
+ return this.consumeItem;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ *
|
||||
+ * @param consume should the item be consumed
|
||||
+ */
|
||||
+ public void setConsumeItem(boolean consume) {
|
||||
@@ -83,14 +83,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return cancelled;
|
||||
+ return this.cancelled;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Set whether or not to cancel the crossbow being loaded. If canceled, the
|
||||
+ * Set whether to cancel the crossbow being loaded. If canceled, the
|
||||
+ * projectile that would be loaded into the crossbow will not be consumed.
|
||||
+ *
|
||||
+ * @param cancel true if you wish to cancel this event
|
||||
+ */
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
|
Reference in New Issue
Block a user