EntityLoadCrossbowEvent#shouldConsumeItem

This commit is contained in:
Shane Freeder
2021-01-14 15:53:42 +00:00
parent d0d21ba718
commit 2da0e4a287
2 changed files with 31 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private final ItemStack crossbow;
+ private final EquipmentSlot hand;
+ private boolean cancelled;
+ private boolean consumeItem = true;
+
+ public EntityLoadCrossbowEvent(@NotNull LivingEntity entity, @Nullable ItemStack crossbow, @NotNull EquipmentSlot hand) {
+ super(entity);
@@ -63,6 +64,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return hand;
+ }
+
+ /**
+ *
+ * @return should the itemstack be consumed
+ */
+ public boolean shouldConsumeItem() {
+ return consumeItem;
+ }
+
+ /**
+ *
+ * @param consume should the item be consumed
+ */
+ public void setConsumeItem(boolean consume) {
+ this.consumeItem = consume;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;