From 732fa8e4aa247e60cb7b408ecbe8c9ac6ddba312 Mon Sep 17 00:00:00 2001 From: "dev@ftbsc" Date: Sat, 28 Jan 2023 18:04:45 +0100 Subject: fix: strip leading /, reduce fullbright duration --- src/main/java/co/fantabos/bscv/BoSCoVicino.java | 10 +++++----- src/main/java/co/fantabos/bscv/Fullbright.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/co/fantabos/bscv/BoSCoVicino.java b/src/main/java/co/fantabos/bscv/BoSCoVicino.java index f139294..de3cc3a 100644 --- a/src/main/java/co/fantabos/bscv/BoSCoVicino.java +++ b/src/main/java/co/fantabos/bscv/BoSCoVicino.java @@ -7,6 +7,7 @@ import net.minecraft.command.CommandSource; import net.minecraftforge.client.event.ClientChatEvent; import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.RegisterCommandsEvent; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.InterModComms; @@ -98,9 +99,7 @@ public class BoSCoVicino { // @SubscribeEvent // public void onRegisterCommand(RegisterCommandsEvent event) { - // for (Module mod : BoSCoVicino.mods) { - // mod.registerCommands(event.getDispatcher()); - // } + // this.dispatcher. // } @SubscribeEvent @@ -108,10 +107,11 @@ public class BoSCoVicino { if (event.getMessage().startsWith("/")) { CommandSource source = BoSCoVicino.minecraft.player.createCommandSourceStack(); try { - this.dispatcher.execute(event.getMessage(), source); + LOGGER.info(String.format("Running command %s", event.getMessage())); + this.dispatcher.execute(event.getMessage().substring(1), source); event.setCanceled(true); } catch (CommandSyntaxException e) { - LOGGER.error("Syntax error in command : %s", e.toString()); + LOGGER.error(String.format("Syntax error in command : %s", e.toString())); } } } diff --git a/src/main/java/co/fantabos/bscv/Fullbright.java b/src/main/java/co/fantabos/bscv/Fullbright.java index bd5fe27..04a1abc 100644 --- a/src/main/java/co/fantabos/bscv/Fullbright.java +++ b/src/main/java/co/fantabos/bscv/Fullbright.java @@ -24,7 +24,7 @@ public class Fullbright extends Module { 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)); + BoSCoVicino.minecraft.player.addEffect(new EffectInstance(Effect.byId(16), 2)); } } } -- cgit v1.2.3-56-ga3b1