-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
413f258
commit feb7fb4
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: violetc <[email protected]> | ||
Date: Mon, 24 Jul 2023 15:54:18 +0800 | ||
Subject: [PATCH] Bow infinity fix | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/world/item/BowItem.java b/src/main/java/net/minecraft/world/item/BowItem.java | ||
index 08d597db1a5345a343777a01427655e6bf2c926b..d4127e4b437960670d5c91179a726b433659b317 100644 | ||
--- a/src/main/java/net/minecraft/world/item/BowItem.java | ||
+++ b/src/main/java/net/minecraft/world/item/BowItem.java | ||
@@ -130,7 +130,7 @@ public class BowItem extends ProjectileWeaponItem implements Vanishable { | ||
@Override | ||
public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) { | ||
ItemStack itemstack = user.getItemInHand(hand); | ||
- boolean flag = !user.getProjectile(itemstack).isEmpty(); | ||
+ boolean flag = !user.getProjectile(itemstack).isEmpty() || (top.leavesmc.leaves.LeavesConfig.bowInfinityFix && EnchantmentHelper.getItemEnchantmentLevel(Enchantments.INFINITY_ARROWS, itemstack) > 0); | ||
|
||
if (!user.getAbilities().instabuild && !flag) { | ||
return InteractionResultHolder.fail(itemstack); |