From e7e510c160e15b05e2d51eb2d59a0a5942021eee Mon Sep 17 00:00:00 2001 From: Flo56958 Date: Wed, 27 Sep 2023 20:38:32 +0200 Subject: [PATCH] Add RequireSneaking option to Ender --- .../java/de/flo56958/minetinker/modifiers/types/Ender.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/flo56958/minetinker/modifiers/types/Ender.java b/src/main/java/de/flo56958/minetinker/modifiers/types/Ender.java index 358bcc6c..b361829d 100644 --- a/src/main/java/de/flo56958/minetinker/modifiers/types/Ender.java +++ b/src/main/java/de/flo56958/minetinker/modifiers/types/Ender.java @@ -35,6 +35,7 @@ public class Ender extends Modifier implements Listener { private boolean giveNauseaOnUse; private int nauseaDuration; private boolean giveBlindnessOnUse; + private boolean requireSneaking; private int blindnessDuration; private Ender() { @@ -81,6 +82,7 @@ public void reload() { config.addDefault("EnchantCost", 10); config.addDefault("Enchantable", false); config.addDefault("MinimumToolLevelRequirement", 1); + config.addDefault("RequireSneaking", true); config.addDefault("Recipe.Enabled", true); config.addDefault("Recipe.Top", "PPP"); @@ -104,6 +106,7 @@ public void reload() { this.nauseaDuration = config.getInt("NauseaDuration", 5) * 20; this.giveBlindnessOnUse = config.getBoolean("GiveBlindnessOnUse", true); this.blindnessDuration = config.getInt("BlindnessDuration", 3) * 20; + this.requireSneaking = config.getBoolean("RequireSneaking", true); } @EventHandler(ignoreCancelled = true) @@ -125,7 +128,7 @@ public void effect(ProjectileLaunchEvent event) { return; } - if (!player.isSneaking()) { + if (this.requireSneaking && !player.isSneaking()) { return; }