Correctly overload

This commit is contained in:
Bjarne Koll 2024-10-02 14:50:14 +02:00
parent 1ec581040c
commit 861aaff363
No known key found for this signature in database
GPG key ID: 27F6CCCF55D2EE62

View file

@ -75,7 +75,7 @@ index ac983b6f0bd3d3294481d08831063b6e232e5ef6..6e38d4592dcff69e52fbd0f3bae75da9
CriteriaTriggers.SHOT_CROSSBOW.trigger(serverPlayer, stack);
serverPlayer.awardStat(Stats.ITEM_USED.get(stack.getItem()));
diff --git a/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java b/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java
index 56595dd3a0b7df4b5f9819ade797212278c8fd40..8154773fd74d76e83a65e518e6f6959f1012033c 100644
index 56595dd3a0b7df4b5f9819ade797212278c8fd40..91cf693afb95893a2e2d6c7259a3372b0169da7c 100644
--- a/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java
+++ b/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java
@@ -46,7 +46,35 @@ public abstract class ProjectileWeaponItem extends Item {
@ -150,7 +150,7 @@ index 56595dd3a0b7df4b5f9819ade797212278c8fd40..8154773fd74d76e83a65e518e6f6959f
protected static List<ItemStack> draw(ItemStack stack, ItemStack projectileStack, LivingEntity shooter) {
+ // Paper start - improve bow shoot event - delayed consumption to allow for consumption cancellation
+ return draw(stack, projectileStack, shooter);
+ return draw(stack, projectileStack, shooter, ProjectileDrawingItemConsumption.IMMEDIATELY);
+ }
+ protected enum ProjectileDrawingItemConsumption {
+ // Will immediately consume from the passed projectile stack, like vanilla would