From 867a5f5f622c6a4c969ef43f16e99949169ec6f4 Mon Sep 17 00:00:00 2001 From: alemidev Date: Mon, 30 Jan 2023 20:59:42 +0100 Subject: chore: restructured --- src/main/java/co/fantabos/bscv/BoSCoVicino.java | 6 +- src/main/java/co/fantabos/bscv/Module.java | 152 -------------------- .../co/fantabos/bscv/modules/FastInteract.java | 46 ------- .../java/co/fantabos/bscv/modules/Fullbright.java | 45 ------ .../java/co/fantabos/bscv/modules/HudModule.java | 48 +++++++ src/main/java/co/fantabos/bscv/modules/Module.java | 153 +++++++++++++++++++++ .../co/fantabos/bscv/modules/VanillaFlight.java | 40 ------ .../co/fantabos/bscv/modules/hud/HudModule.java | 48 ------- .../bscv/modules/motion/VanillaFlight.java | 40 ++++++ .../fantabos/bscv/modules/self/FastInteract.java | 46 +++++++ .../fantabos/bscv/modules/vision/Fullbright.java | 45 ++++++ 11 files changed, 337 insertions(+), 332 deletions(-) delete mode 100644 src/main/java/co/fantabos/bscv/Module.java delete mode 100644 src/main/java/co/fantabos/bscv/modules/FastInteract.java delete mode 100644 src/main/java/co/fantabos/bscv/modules/Fullbright.java create mode 100644 src/main/java/co/fantabos/bscv/modules/HudModule.java create mode 100644 src/main/java/co/fantabos/bscv/modules/Module.java delete mode 100644 src/main/java/co/fantabos/bscv/modules/VanillaFlight.java delete mode 100644 src/main/java/co/fantabos/bscv/modules/hud/HudModule.java create mode 100644 src/main/java/co/fantabos/bscv/modules/motion/VanillaFlight.java create mode 100644 src/main/java/co/fantabos/bscv/modules/self/FastInteract.java create mode 100644 src/main/java/co/fantabos/bscv/modules/vision/Fullbright.java (limited to 'src/main/java/co') diff --git a/src/main/java/co/fantabos/bscv/BoSCoVicino.java b/src/main/java/co/fantabos/bscv/BoSCoVicino.java index 23c1d48..10ae94b 100644 --- a/src/main/java/co/fantabos/bscv/BoSCoVicino.java +++ b/src/main/java/co/fantabos/bscv/BoSCoVicino.java @@ -27,12 +27,16 @@ import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; -import co.fantabos.bscv.modules.*; +import co.fantabos.bscv.modules.vision.*; +import co.fantabos.bscv.modules.motion.*; +import co.fantabos.bscv.modules.self.*; import co.fantabos.bscv.modules.hud.*; // The value here should match an entry in the META-INF/mods.toml file @Mod("bscv") public class BoSCoVicino { + public static String MOD_ID = "bscv"; + // Directly reference a log4j logger. public static final Logger LOGGER = LogManager.getLogger(); diff --git a/src/main/java/co/fantabos/bscv/Module.java b/src/main/java/co/fantabos/bscv/Module.java deleted file mode 100644 index 7cb6a30..0000000 --- a/src/main/java/co/fantabos/bscv/Module.java +++ /dev/null @@ -1,152 +0,0 @@ -package co.fantabos.bscv; - -import com.mojang.brigadier.CommandDispatcher; -import com.mojang.brigadier.arguments.ArgumentType; - -import net.minecraft.command.CommandSource; -import net.minecraft.command.Commands; -import net.minecraftforge.common.ForgeConfigSpec; -import net.minecraftforge.common.MinecraftForge; - -import static co.fantabos.bscv.BoSCoVicino.log; - -public abstract class Module { - public enum Group { - CORE, - HUD, - BUILD, - DEFENSE, - VISION, - } - - public final String name; - public final Group group; - public final ForgeConfigSpec.ConfigValue enabled; - - protected Module(String name, Group group, ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { - this.name = name; - this.group = group; - - builder.push(this.name.toLowerCase()); - this.enabled = builder - .comment(String.format("Enables %s", this.name)) - .define("enabled", false); - - dispatcher.register( - Commands.literal(this.name.toLowerCase()) - .then( - Commands.literal("toggle") - .executes(ctx -> { - this.toggle(); - return 1; - }) - ) - .executes(ctx -> { - log(String.format("=[ %s ]%s", this.name, this.enabled.get() ? "+" : "")); - // TODO: print all mod options! - return 1; - }) - ); - } - - - // TODO can I merge these two option into one? Maybe redo with builder pattern? - - public > ForgeConfigSpec.EnumValue optionEnum( - String name, - String comment, - T fallback, - ArgumentType argument, - Class clazz, - ForgeConfigSpec.Builder builder, - CommandDispatcher dispatcher - ) { - ForgeConfigSpec.EnumValue conf = builder - .comment(comment) - .defineEnum(name, fallback); - - dispatcher.register( - Commands.literal(this.name.toLowerCase()) - .then( - Commands.literal(name) - .then( - Commands.argument(name, argument) - .executes( ctx -> { - T value = ctx.getArgument(name, clazz); - conf.set(value); - conf.save(); - log(String.format("> %s -> %s", String.join(".", conf.getPath()), conf.get().toString())); - return 1; - })) - .executes(ctx -> { - log(String.format("> %s: %s", String.join(".", conf.getPath()), conf.get().toString())); - return 1; - }) - ) - ); - - return conf; - } - - public ForgeConfigSpec.ConfigValue option( - String name, - String comment, - T fallback, - ArgumentType argument, - Class clazz, - ForgeConfigSpec.Builder builder, - CommandDispatcher dispatcher - ) { - ForgeConfigSpec.ConfigValue conf = builder - .comment(comment) - .define(name, fallback); - - dispatcher.register( - Commands.literal(this.name.toLowerCase()) - .then( - Commands.literal(name) - .then( - Commands.argument(name, argument) - .executes( ctx -> { - T value = ctx.getArgument(name, clazz); - conf.set(value); - conf.save(); - log(String.format("> %s -> %s", String.join(".", conf.getPath()), conf.get().toString())); - return 1; - })) - .executes(ctx -> { - log(String.format("> %s: %s", name, conf.get().toString())); - return 1; - }) - ) - ); - - return conf; - } - - protected void onEnabled() {} - protected void onDisabled() {} - - public final void toggle() { - if (this.enabled.get()) this.disable(); - else this.enable(); - } - - public final void enable() { - MinecraftForge.EVENT_BUS.register(this); - this.enabled.set(true); - // this.enabled.save(); - this.onEnabled(); - log(String.format("%s enabled", this.name)); - BoSCoVicino.LOGGER.info(String.format("%s enabled", this.name)); - } - - public final void disable() { - MinecraftForge.EVENT_BUS.unregister(this); - this.enabled.set(false); - // this.enabled.save(); - this.onDisabled(); - log(String.format("%s disabled", this.name)); - BoSCoVicino.LOGGER.info(String.format("%s disabled", this.name)); - } -} diff --git a/src/main/java/co/fantabos/bscv/modules/FastInteract.java b/src/main/java/co/fantabos/bscv/modules/FastInteract.java deleted file mode 100644 index f9d9d29..0000000 --- a/src/main/java/co/fantabos/bscv/modules/FastInteract.java +++ /dev/null @@ -1,46 +0,0 @@ -package co.fantabos.bscv.modules; - -import static co.fantabos.bscv.BoSCoVicino.log; - -import java.lang.reflect.Field; - -import com.mojang.brigadier.CommandDispatcher; - -import net.minecraft.command.CommandSource; -import net.minecraftforge.common.ForgeConfigSpec; -import net.minecraftforge.event.TickEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; - -import co.fantabos.bscv.Module; -import co.fantabos.bscv.BoSCoVicino; - -public class FastInteract extends Module { - - Field delayField; - - public FastInteract(ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { - super("FastInteract", Group.CORE, builder, dispatcher); - } - - @Override - protected void onEnabled() { - try { - delayField = BoSCoVicino.minecraft.getClass().getDeclaredField("field_71467_ac"); - delayField.setAccessible(true); - } catch (NoSuchFieldException e) { - log("! failed accessing delay field"); - this.disable(); - } - } - - @SubscribeEvent - public void onTick(TickEvent.ClientTickEvent event) { - if (BoSCoVicino.minecraft == null) return; - try { - this.delayField.set(BoSCoVicino.minecraft, 0); - } catch (IllegalAccessException e) { - log("! failed accessing delay field"); - this.disable(); - } - } -} diff --git a/src/main/java/co/fantabos/bscv/modules/Fullbright.java b/src/main/java/co/fantabos/bscv/modules/Fullbright.java deleted file mode 100644 index 300dce9..0000000 --- a/src/main/java/co/fantabos/bscv/modules/Fullbright.java +++ /dev/null @@ -1,45 +0,0 @@ -package co.fantabos.bscv.modules; - -import com.mojang.brigadier.CommandDispatcher; -import com.mojang.brigadier.arguments.StringArgumentType; - -import net.minecraft.command.CommandSource; -import net.minecraft.potion.Effect; -import net.minecraft.potion.EffectInstance; -import net.minecraftforge.common.ForgeConfigSpec; -import net.minecraftforge.event.TickEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; - -import co.fantabos.bscv.Module; -import co.fantabos.bscv.BoSCoVicino; - -public class Fullbright extends Module { - - private final ForgeConfigSpec.ConfigValue mode; - - public Fullbright(ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { - super("Fullbright", Group.VISION, builder, dispatcher); - - this.mode = this.option( - "mode", "either potion or potion", "potion", - StringArgumentType.string(), String.class, - builder, dispatcher - ); - } - - @SubscribeEvent - public void onTick(TickEvent.ClientTickEvent event) { - if (BoSCoVicino.minecraft == null) return; - if (BoSCoVicino.minecraft.player == null) return; - if (this.mode.get().equals("potion")) { - BoSCoVicino.minecraft.player.addEffect(new EffectInstance(Effect.byId(16), 5204)); - } - } - - @Override - protected void onDisabled() { - if (this.mode.get().equals("potion")) { - BoSCoVicino.minecraft.player.removeEffect(Effect.byId(16)); - } - } -} diff --git a/src/main/java/co/fantabos/bscv/modules/HudModule.java b/src/main/java/co/fantabos/bscv/modules/HudModule.java new file mode 100644 index 0000000..0327d78 --- /dev/null +++ b/src/main/java/co/fantabos/bscv/modules/HudModule.java @@ -0,0 +1,48 @@ +package co.fantabos.bscv.modules.hud; + +import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.arguments.DoubleArgumentType; +import com.mojang.brigadier.arguments.IntegerArgumentType; + +import co.fantabos.bscv.Module; +import co.fantabos.bscv.tools.Anchor; +import net.minecraft.command.CommandSource; +import net.minecraftforge.common.ForgeConfigSpec; +import net.minecraftforge.server.command.EnumArgument; + +public abstract class HudModule extends Module { + + public final ForgeConfigSpec.ConfigValue x; + public final ForgeConfigSpec.ConfigValue y; + public final ForgeConfigSpec.ConfigValue scale; + public final ForgeConfigSpec.EnumValue anchor; + + protected HudModule(String name, ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { + super(name, Group.HUD, builder, dispatcher); + + this.x = this.option( + "x", "horizontal offset", 0, + IntegerArgumentType.integer(0), Integer.class, + builder, dispatcher + ); + + this.y = this.option( + "y", "vertical offset", 0, + IntegerArgumentType.integer(0), Integer.class, + builder, dispatcher + ); + + this.scale = this.option( + "scale", "scale of element", 1.0, + DoubleArgumentType.doubleArg(0.0), Double.class, + builder, dispatcher + ); + + this.anchor = this.optionEnum( + "anchor", "origin point for coordinates", Anchor.TOPLEFT, + EnumArgument.enumArgument(Anchor.class), Anchor.class, + builder, dispatcher + ); + } + +} diff --git a/src/main/java/co/fantabos/bscv/modules/Module.java b/src/main/java/co/fantabos/bscv/modules/Module.java new file mode 100644 index 0000000..c6f4522 --- /dev/null +++ b/src/main/java/co/fantabos/bscv/modules/Module.java @@ -0,0 +1,153 @@ +package co.fantabos.bscv; + +import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.arguments.ArgumentType; + +import net.minecraft.command.CommandSource; +import net.minecraft.command.Commands; +import net.minecraftforge.common.ForgeConfigSpec; +import net.minecraftforge.common.MinecraftForge; + +import static co.fantabos.bscv.BoSCoVicino.log; + +public abstract class Module { + public enum Group { + SELF, + HUD, + BUILD, + DEFENSE, + VISION, + MOTION, + } + + public final String name; + public final Group group; + public final ForgeConfigSpec.ConfigValue enabled; + + protected Module(String name, Group group, ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { + this.name = name; + this.group = group; + + builder.push(this.name.toLowerCase()); + this.enabled = builder + .comment(String.format("Enables %s", this.name)) + .define("enabled", false); + + dispatcher.register( + Commands.literal(this.name.toLowerCase()) + .then( + Commands.literal("toggle") + .executes(ctx -> { + this.toggle(); + return 1; + }) + ) + .executes(ctx -> { + log(String.format("=[ %s ]%s", this.name, this.enabled.get() ? "+" : "")); + // TODO: print all mod options! + return 1; + }) + ); + } + + + // TODO can I merge these two option into one? Maybe redo with builder pattern? + + public > ForgeConfigSpec.EnumValue optionEnum( + String name, + String comment, + T fallback, + ArgumentType argument, + Class clazz, + ForgeConfigSpec.Builder builder, + CommandDispatcher dispatcher + ) { + ForgeConfigSpec.EnumValue conf = builder + .comment(comment) + .defineEnum(name, fallback); + + dispatcher.register( + Commands.literal(this.name.toLowerCase()) + .then( + Commands.literal(name) + .then( + Commands.argument(name, argument) + .executes( ctx -> { + T value = ctx.getArgument(name, clazz); + conf.set(value); + conf.save(); + log(String.format("> %s -> %s", String.join(".", conf.getPath()), conf.get().toString())); + return 1; + })) + .executes(ctx -> { + log(String.format("> %s: %s", String.join(".", conf.getPath()), conf.get().toString())); + return 1; + }) + ) + ); + + return conf; + } + + public ForgeConfigSpec.ConfigValue option( + String name, + String comment, + T fallback, + ArgumentType argument, + Class clazz, + ForgeConfigSpec.Builder builder, + CommandDispatcher dispatcher + ) { + ForgeConfigSpec.ConfigValue conf = builder + .comment(comment) + .define(name, fallback); + + dispatcher.register( + Commands.literal(this.name.toLowerCase()) + .then( + Commands.literal(name) + .then( + Commands.argument(name, argument) + .executes( ctx -> { + T value = ctx.getArgument(name, clazz); + conf.set(value); + conf.save(); + log(String.format("> %s -> %s", String.join(".", conf.getPath()), conf.get().toString())); + return 1; + })) + .executes(ctx -> { + log(String.format("> %s: %s", name, conf.get().toString())); + return 1; + }) + ) + ); + + return conf; + } + + protected void onEnabled() {} + protected void onDisabled() {} + + public final void toggle() { + if (this.enabled.get()) this.disable(); + else this.enable(); + } + + public final void enable() { + MinecraftForge.EVENT_BUS.register(this); + this.enabled.set(true); + // this.enabled.save(); + this.onEnabled(); + log(String.format("%s enabled", this.name)); + BoSCoVicino.LOGGER.info(String.format("%s enabled", this.name)); + } + + public final void disable() { + MinecraftForge.EVENT_BUS.unregister(this); + this.enabled.set(false); + // this.enabled.save(); + this.onDisabled(); + log(String.format("%s disabled", this.name)); + BoSCoVicino.LOGGER.info(String.format("%s disabled", this.name)); + } +} diff --git a/src/main/java/co/fantabos/bscv/modules/VanillaFlight.java b/src/main/java/co/fantabos/bscv/modules/VanillaFlight.java deleted file mode 100644 index 767bfff..0000000 --- a/src/main/java/co/fantabos/bscv/modules/VanillaFlight.java +++ /dev/null @@ -1,40 +0,0 @@ -package co.fantabos.bscv.modules; - -import com.mojang.brigadier.CommandDispatcher; - -import co.fantabos.bscv.BoSCoVicino; -import co.fantabos.bscv.Module; -import net.minecraft.command.CommandSource; -import net.minecraftforge.common.ForgeConfigSpec; -import net.minecraftforge.event.TickEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; - -public class VanillaFlight extends Module { - - public VanillaFlight(ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { - super("VanillaFlight", Group.CORE, builder, dispatcher); - } - - private boolean couldFlyBefore = false; - - @SubscribeEvent - public void onTick(TickEvent.ClientTickEvent event) { - if (BoSCoVicino.minecraft.player != null) { - BoSCoVicino.minecraft.player.abilities.mayfly = true; - } - } - - @Override - protected void onEnabled() { - if (BoSCoVicino.minecraft.player != null) { - this.couldFlyBefore = BoSCoVicino.minecraft.player.abilities.mayfly; - } - } - - @Override - protected void onDisabled() { - if (BoSCoVicino.minecraft.player != null) { - BoSCoVicino.minecraft.player.abilities.mayfly = this.couldFlyBefore; - } - } -} diff --git a/src/main/java/co/fantabos/bscv/modules/hud/HudModule.java b/src/main/java/co/fantabos/bscv/modules/hud/HudModule.java deleted file mode 100644 index 0327d78..0000000 --- a/src/main/java/co/fantabos/bscv/modules/hud/HudModule.java +++ /dev/null @@ -1,48 +0,0 @@ -package co.fantabos.bscv.modules.hud; - -import com.mojang.brigadier.CommandDispatcher; -import com.mojang.brigadier.arguments.DoubleArgumentType; -import com.mojang.brigadier.arguments.IntegerArgumentType; - -import co.fantabos.bscv.Module; -import co.fantabos.bscv.tools.Anchor; -import net.minecraft.command.CommandSource; -import net.minecraftforge.common.ForgeConfigSpec; -import net.minecraftforge.server.command.EnumArgument; - -public abstract class HudModule extends Module { - - public final ForgeConfigSpec.ConfigValue x; - public final ForgeConfigSpec.ConfigValue y; - public final ForgeConfigSpec.ConfigValue scale; - public final ForgeConfigSpec.EnumValue anchor; - - protected HudModule(String name, ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { - super(name, Group.HUD, builder, dispatcher); - - this.x = this.option( - "x", "horizontal offset", 0, - IntegerArgumentType.integer(0), Integer.class, - builder, dispatcher - ); - - this.y = this.option( - "y", "vertical offset", 0, - IntegerArgumentType.integer(0), Integer.class, - builder, dispatcher - ); - - this.scale = this.option( - "scale", "scale of element", 1.0, - DoubleArgumentType.doubleArg(0.0), Double.class, - builder, dispatcher - ); - - this.anchor = this.optionEnum( - "anchor", "origin point for coordinates", Anchor.TOPLEFT, - EnumArgument.enumArgument(Anchor.class), Anchor.class, - builder, dispatcher - ); - } - -} diff --git a/src/main/java/co/fantabos/bscv/modules/motion/VanillaFlight.java b/src/main/java/co/fantabos/bscv/modules/motion/VanillaFlight.java new file mode 100644 index 0000000..070b123 --- /dev/null +++ b/src/main/java/co/fantabos/bscv/modules/motion/VanillaFlight.java @@ -0,0 +1,40 @@ +package co.fantabos.bscv.modules.motion; + +import com.mojang.brigadier.CommandDispatcher; + +import co.fantabos.bscv.BoSCoVicino; +import co.fantabos.bscv.Module; +import net.minecraft.command.CommandSource; +import net.minecraftforge.common.ForgeConfigSpec; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; + +public class VanillaFlight extends Module { + + public VanillaFlight(ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { + super("VanillaFlight", Group.MOTION, builder, dispatcher); + } + + private boolean couldFlyBefore = false; + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (BoSCoVicino.minecraft.player != null) { + BoSCoVicino.minecraft.player.abilities.mayfly = true; + } + } + + @Override + protected void onEnabled() { + if (BoSCoVicino.minecraft.player != null) { + this.couldFlyBefore = BoSCoVicino.minecraft.player.abilities.mayfly; + } + } + + @Override + protected void onDisabled() { + if (BoSCoVicino.minecraft.player != null) { + BoSCoVicino.minecraft.player.abilities.mayfly = this.couldFlyBefore; + } + } +} diff --git a/src/main/java/co/fantabos/bscv/modules/self/FastInteract.java b/src/main/java/co/fantabos/bscv/modules/self/FastInteract.java new file mode 100644 index 0000000..3d9d034 --- /dev/null +++ b/src/main/java/co/fantabos/bscv/modules/self/FastInteract.java @@ -0,0 +1,46 @@ +package co.fantabos.bscv.modules.self; + +import static co.fantabos.bscv.BoSCoVicino.log; + +import java.lang.reflect.Field; + +import com.mojang.brigadier.CommandDispatcher; + +import net.minecraft.command.CommandSource; +import net.minecraftforge.common.ForgeConfigSpec; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; + +import co.fantabos.bscv.Module; +import co.fantabos.bscv.BoSCoVicino; + +public class FastInteract extends Module { + + Field delayField; + + public FastInteract(ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { + super("FastInteract", Group.SELF, builder, dispatcher); + } + + @Override + protected void onEnabled() { + try { + delayField = BoSCoVicino.minecraft.getClass().getDeclaredField("field_71467_ac"); + delayField.setAccessible(true); + } catch (NoSuchFieldException e) { + log("! failed accessing delay field"); + this.disable(); + } + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (BoSCoVicino.minecraft == null) return; + try { + this.delayField.set(BoSCoVicino.minecraft, 0); + } catch (IllegalAccessException e) { + log("! failed accessing delay field"); + this.disable(); + } + } +} diff --git a/src/main/java/co/fantabos/bscv/modules/vision/Fullbright.java b/src/main/java/co/fantabos/bscv/modules/vision/Fullbright.java new file mode 100644 index 0000000..70199d9 --- /dev/null +++ b/src/main/java/co/fantabos/bscv/modules/vision/Fullbright.java @@ -0,0 +1,45 @@ +package co.fantabos.bscv.modules.vision; + +import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.arguments.StringArgumentType; + +import net.minecraft.command.CommandSource; +import net.minecraft.potion.Effect; +import net.minecraft.potion.EffectInstance; +import net.minecraftforge.common.ForgeConfigSpec; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; + +import co.fantabos.bscv.Module; +import co.fantabos.bscv.BoSCoVicino; + +public class Fullbright extends Module { + + private final ForgeConfigSpec.ConfigValue mode; + + public Fullbright(ForgeConfigSpec.Builder builder, CommandDispatcher dispatcher) { + super("Fullbright", Group.VISION, builder, dispatcher); + + this.mode = this.option( + "mode", "either potion or potion", "potion", + StringArgumentType.string(), String.class, + builder, dispatcher + ); + } + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent event) { + if (BoSCoVicino.minecraft == null) return; + if (BoSCoVicino.minecraft.player == null) return; + if (this.mode.get().equals("potion")) { + BoSCoVicino.minecraft.player.addEffect(new EffectInstance(Effect.byId(16), 5204)); + } + } + + @Override + protected void onDisabled() { + if (this.mode.get().equals("potion")) { + BoSCoVicino.minecraft.player.removeEffect(Effect.byId(16)); + } + } +} -- cgit v1.2.3-56-ga3b1