[ci skip] Cleanup events (#10202)

This commit is contained in:
Lulu13022002
2024-02-01 10:15:57 +01:00
parent d676979ea0
commit f7e469eb2e
187 changed files with 2415 additions and 2258 deletions

View File

@@ -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) {