diff options
author | Walker Selby <git@walkerselby.com> | 2023-01-26 23:37:59 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-27 16:37:59 +0900 |
commit | b748a4fab2150021b486b4972e91f94416567b30 (patch) | |
tree | 927a22e034cb174f000b1cdb745bfcbf0992ff95 /mod/src/main/java/kr/syeyoung/dungeonsguide | |
parent | 3a3f741b79448fec0336047a3a810c6f726146c5 (diff) | |
download | Skyblock-Dungeons-Guide-b748a4fab2150021b486b4972e91f94416567b30.tar.gz Skyblock-Dungeons-Guide-b748a4fab2150021b486b4972e91f94416567b30.tar.bz2 Skyblock-Dungeons-Guide-b748a4fab2150021b486b4972e91f94416567b30.zip |
Add variable fullbright support (#282)
Add alias "fullbight" to "gimmebright"
Add optional argument for Gamma, defaults to 1000 if not specified.
Diffstat (limited to 'mod/src/main/java/kr/syeyoung/dungeonsguide')
-rw-r--r-- | mod/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDgDebug.java | 65 |
1 files changed, 43 insertions, 22 deletions
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(); + } + } } |