diff options
author | syeyoung <cyong06@naver.com> | 2020-12-24 11:39:29 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2020-12-24 11:39:29 +0900 |
commit | 9d82a605330cb1993a0518f6168d01e7df411ad5 (patch) | |
tree | c5caf7316c9342a4eca954d5f6fdfd5628648dd0 /src/main/java/kr/syeyoung/dungeonsguide/commands | |
parent | 4bf3172187396e9eedb852a887f98d7eb276f459 (diff) | |
download | Skyblock-Dungeons-Guide-9d82a605330cb1993a0518f6168d01e7df411ad5.tar.gz Skyblock-Dungeons-Guide-9d82a605330cb1993a0518f6168d01e7df411ad5.tar.bz2 Skyblock-Dungeons-Guide-9d82a605330cb1993a0518f6168d01e7df411ad5.zip |
commando
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/commands')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java index a9308f4c..fefc3723 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java @@ -1,10 +1,14 @@ package kr.syeyoung.dungeonsguide.commands; +import kr.syeyoung.dungeonsguide.config.GuiConfig; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry; import kr.syeyoung.dungeonsguide.e; +import net.minecraft.client.Minecraft; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; import javax.crypto.BadPaddingException; import javax.crypto.IllegalBlockSizeException; @@ -29,6 +33,7 @@ public class CommandDungeonsGuide extends CommandBase { public void processCommand(ICommandSender sender, String[] args) { if (args.length == 0) { // open config + openConfig = true; } else if (args[0].equalsIgnoreCase("saverooms")) { DungeonRoomInfoRegistry.saveAll(e.getDungeonsGuide().getConfigDir()); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §fSuccessfully saved user generated roomdata")); @@ -60,6 +65,21 @@ public class CommandDungeonsGuide extends CommandBase { sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg loadrooms §7-§f Reloads dungeon roomdata.")); } } + + private boolean openConfig = false; + + @SubscribeEvent + public void onTick(TickEvent.ClientTickEvent e) { + try { + if (openConfig && e.phase == TickEvent.Phase.START ) { + openConfig = false; + Minecraft.getMinecraft().displayGuiScreen(new GuiConfig()); + } + } catch (Throwable t) { + t.printStackTrace(); + } + } + @Override public int getRequiredPermissionLevel() { return 0; |