From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Sun, 25 Oct 2020 12:24:19 -0500 Subject: [PATCH] Infinity No Arrows diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java index 7cb937cf03551d5c265a75cb0a52413946506402..bbc71abb20cde8493ee9064b1558adcdbf2b0852 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -2144,7 +2144,7 @@ public abstract class EntityHuman extends EntityLiving { } } - return this.abilities.canInstantlyBuild ? new ItemStack(Items.ARROW) : ItemStack.b; + return this.abilities.canInstantlyBuild || (world.purpurConfig.infinityWorksWithNoArrows && EnchantmentManager.getEnchantmentLevel(Enchantments.ARROW_INFINITE, itemstack) > 0) ? new ItemStack(Items.ARROW) : ItemStack.b; // Yatopia } } } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java index e86ccbd36250f4229ce62319a59889bc0ac5befb..db6aff16237fad8484d59de607d1edb3b5a1e621 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -176,10 +176,12 @@ public class PurpurWorldConfig { public boolean infinityWorksWithNormalArrows = true; public boolean infinityWorksWithSpectralArrows = false; public boolean infinityWorksWithTippedArrows = false; + public boolean infinityWorksWithNoArrows = false; private void infinityArrowsSettings() { infinityWorksWithNormalArrows = getBoolean("gameplay-mechanics.infinity-bow.normal-arrows", infinityWorksWithNormalArrows); infinityWorksWithSpectralArrows = getBoolean("gameplay-mechanics.infinity-bow.spectral-arrows", infinityWorksWithSpectralArrows); infinityWorksWithTippedArrows = getBoolean("gameplay-mechanics.infinity-bow.tipped-arrows", infinityWorksWithTippedArrows); + infinityWorksWithNoArrows = getBoolean("gameplay-mechanics.infinity-bow.no-arrows", infinityWorksWithNoArrows); } public boolean signAllowColors = false;