From b748a4fab2150021b486b4972e91f94416567b30 Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Thu, 26 Jan 2023 23:37:59 -0800 Subject: Add variable fullbright support (#282) Add alias "fullbight" to "gimmebright" Add optional argument for Gamma, defaults to 1000 if not specified. --- .../dungeonsguide/mod/commands/CommandDgDebug.java | 65 ++++++++++++++-------- 1 file changed, 43 insertions(+), 22 deletions(-) (limited to 'mod/src/main/java/kr') diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDgDebug.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDgDebug.java index 3bc517b7..c1e3c48e 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDgDebug.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDgDebug.java @@ -104,7 +104,10 @@ public class CommandDgDebug extends CommandBase { "dumpsettings", "readmap", "testgui", - "clearprofile" + "clearprofile", + "fullbright", + "gimmebright", + "pfall" }; @Override @@ -188,30 +191,12 @@ public class CommandDgDebug extends CommandBase { case "clearprofile": clearProfileCommand(); break; + case "fullbright": case "gimmebright": - Minecraft.getMinecraft().gameSettings.setOptionFloatValue(GameSettings.Options.GAMMA, 1000); + fullBrightCommand(args); break; case "pfall": - try { - DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); - EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; - if (thePlayer == null) { - return; - } - if (context.getBossfightProcessor() != null) { - context.getBossfightProcessor().tick(); - } - Point roomPt = context.getScaffoldParser().getDungeonMapLayout().worldPointToRoomPoint(thePlayer.getPosition()); - - DungeonRoom dungeonRoom = context.getScaffoldParser().getRoomMap().get(roomPt); - GeneralRoomProcessor grp = (GeneralRoomProcessor) dungeonRoom.getRoomProcessor(); - // performance testing (lol) - for (String s : dungeonRoom.getMechanics().keySet()) { - grp.pathfind("COMMAND-"+s, s, "navigate", FeatureRegistry.SECRET_LINE_PROPERTIES_GLOBAL.getRouteProperties()); - } - } catch (Throwable t) { - t.printStackTrace(); - } + pFallCommand(); break; case "reloadshader": ShaderManager.onResourceReload(); @@ -659,4 +644,40 @@ public class CommandDgDebug extends CommandBase { private void clearProfileCommand() { Minecraft.getMinecraft().mcProfiler.clearProfiling(); } + + private void fullBrightCommand(String[] args) { + int gammaVal = 1000; + if (args.length == 2) { + try { + gammaVal = Integer.parseInt(args[1]); + } catch (NumberFormatException e) { + e.printStackTrace(); + ChatTransmitter.addToQueue(new ChatComponentText("Invalid number, defaulting to 1000")); + } + } + Minecraft.getMinecraft().gameSettings.setOptionFloatValue(GameSettings.Options.GAMMA, gammaVal); + } + + private void pFallCommand() { + try { + DungeonContext context = DungeonsGuide.getDungeonsGuide().getDungeonFacade().getContext(); + EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; + if (thePlayer == null) { + return; + } + if (context.getBossfightProcessor() != null) { + context.getBossfightProcessor().tick(); + } + Point roomPt = context.getScaffoldParser().getDungeonMapLayout().worldPointToRoomPoint(thePlayer.getPosition()); + + DungeonRoom dungeonRoom = context.getScaffoldParser().getRoomMap().get(roomPt); + GeneralRoomProcessor grp = (GeneralRoomProcessor) dungeonRoom.getRoomProcessor(); + // performance testing (lol) + for (String s : dungeonRoom.getMechanics().keySet()) { + grp.pathfind("COMMAND-" + s, s, "navigate", FeatureRegistry.SECRET_LINE_PROPERTIES_GLOBAL.getRouteProperties()); + } + } catch (Throwable t) { + t.printStackTrace(); + } + } } -- cgit