From 00ff33e33ee694845697f807760282c0ee22f3e5 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Sat, 6 Feb 2021 15:02:55 +0900 Subject: Bettuh cooldown and message --- src/main/java/kr/syeyoung/dungeonsguide/e.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/main/java/kr/syeyoung/dungeonsguide/e.java') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/e.java b/src/main/java/kr/syeyoung/dungeonsguide/e.java index a422c117..3666b4da 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/e.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/e.java @@ -10,10 +10,13 @@ import kr.syeyoung.dungeonsguide.features.FeatureRegistry; import kr.syeyoung.dungeonsguide.utils.AhUtils; import lombok.Getter; import net.minecraft.client.Minecraft; +import net.minecraft.command.ICommand; import net.minecraft.util.IChatComponent; import net.minecraftforge.client.ClientCommandHandler; +import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.fml.common.ObfuscationReflectionHelper; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import org.apache.commons.io.IOUtils; @@ -25,6 +28,8 @@ import java.io.*; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; +import java.util.Map; +import java.util.Set; public class e implements c { @@ -55,7 +60,15 @@ public class e implements c { MinecraftForge.EVENT_BUS.register(new DungeonListener()); ClientCommandHandler.instance.registerCommand(commandDungeonsGuide = new CommandDungeonsGuide()); MinecraftForge.EVENT_BUS.register(commandDungeonsGuide); - ClientCommandHandler.instance.registerCommand(commandReparty = new CommandReparty()); + + commandReparty = new CommandReparty(); + if(!ClientCommandHandler.instance.getCommands().containsKey("rp")) { + ((Set) ObfuscationReflectionHelper.getPrivateValue(ClientCommandHandler.class, ClientCommandHandler.instance, "CommandSet")).add(commandReparty); + ((Map)ObfuscationReflectionHelper.getPrivateValue(ClientCommandHandler.class, ClientCommandHandler.instance, "CommandMap")).put("rp", commandReparty); + } + if (FeatureRegistry.ETC_REMOVE_REPARTY.isEnabled()) + ClientCommandHandler.instance.registerCommand(commandReparty); + MinecraftForge.EVENT_BUS.register(commandReparty); MinecraftForge.EVENT_BUS.register(new FeatureListener()); MinecraftForge.EVENT_BUS.register(new PacketListener()); -- cgit