fix: strip leading /, reduce fullbright duration

This commit is contained in:
dev@ftbsc 2023-01-28 18:04:45 +01:00
parent 9767eaffa3
commit 732fa8e4aa
2 changed files with 6 additions and 6 deletions

View file

@ -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()));
}
}
}

View file

@ -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));
}
}
}