aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/commands
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2020-12-24 11:39:29 +0900
committersyeyoung <cyong06@naver.com>2020-12-24 11:39:29 +0900
commit9d82a605330cb1993a0518f6168d01e7df411ad5 (patch)
treec5caf7316c9342a4eca954d5f6fdfd5628648dd0 /src/main/java/kr/syeyoung/dungeonsguide/commands
parent4bf3172187396e9eedb852a887f98d7eb276f459 (diff)
downloadSkyblock-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.java20
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;