Skip to content

Commit

Permalink
Merge pull request #337 from steve4744/master
Browse files Browse the repository at this point in the history
fix for hideall parkour tool
  • Loading branch information
A5H73Y authored Nov 19, 2022
2 parents 6479032 + a81f46e commit e2c9434
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ public StringsConfig(File file) {
this.setDefault("GUI.JoinCourses.Description", "&fJoin &b%VALUE%");
this.setDefault("GUI.JoinCourses.Players", "Players: &b%VALUE%");
this.setDefault("GUI.JoinCourses.Checkpoints", "Checkpoints: &b%VALUE%");
this.setDefault("GUI.JoinCourses.Completed", "Completed: &b%VALUE%");
this.setDefault("GUI.CourseSettings.Heading", "%VALUE% Settings");
this.setDefault("GUI.CourseSettings.Setup.Line1", "qwertyui ");
this.setDefault("GUI.CourseSettings.Setup.Line2", "asdfghjkl");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ public void addContent(InventoryGui parent, Player player) {
.getNumberOfPlayersOnCourse(course)), false),
TranslationUtils.getValueTranslation("GUI.JoinCourses.Checkpoints",
String.valueOf(parkour.getConfigManager().getCourseConfig(course)
.getCheckpointAmount()), false)
.getCheckpointAmount()), false),
TranslationUtils.getValueTranslation("GUI.JoinCourses.Completed",
String.valueOf(parkour.getDatabaseManager().hasPlayerAchievedTime(player, course)), false)
));
}
parent.addElement(group);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,22 @@ public PlayerInteractListener(final Parkour parkour) {
DefaultConfig config = parkour.getParkourConfig();
registerParkourTool(config.getLastCheckpointTool(), "LastCheckpoint",
(player, event) -> parkour.getPlayerManager().playerDie(player));

registerParkourTool(config.getHideAllDisabledTool(), "HideAll",
(player, event) -> handleHideAllTool(player));
registerParkourTool(config.getHideAllDisabledTool(), "HideAll",

registerParkourTool(config.getHideAllEnabledTool(), "HideAll",
(player, event) -> handleHideAllTool(player));

registerParkourTool(config.getLeaveTool(), "Leave",
(player, event) -> parkour.getPlayerManager().leaveCourse(player));

registerParkourTool(config.getRestartTool(), "Restart",
(player, event) -> handleRestartTool(player));

registerParkourTool(config.getRocketTool(), "Rockets", true, false, ParkourMode.ROCKETS,
(player, event) -> handleRocketTool(player));

registerParkourTool(config.getFreedomTool(), "Freedom", false, false, ParkourMode.FREEDOM,
(player, event) -> handleFreedomTool(player, event.getAction()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,9 @@ private void populatePlayersInventory(Player player) {
}

giveParkourTool(player, "ParkourTool.LastCheckpoint");
giveParkourTool(player, "ParkourTool.HideAll");
String configPath = parkour.getParkourSessionManager().hasHiddenPlayers(player)
? "ParkourTool.HideAllEnabled" : "ParkourTool.HideAll";
giveParkourTool(player, configPath);
giveParkourTool(player, "ParkourTool.Leave");
giveParkourTool(player, "ParkourTool.Restart");

Expand Down

0 comments on commit e2c9434

Please sign in to comment.