diff --git a/src/main/java/io/github/a5h73y/parkour/configuration/impl/StringsConfig.java b/src/main/java/io/github/a5h73y/parkour/configuration/impl/StringsConfig.java index f11faf25..c8ee9df8 100644 --- a/src/main/java/io/github/a5h73y/parkour/configuration/impl/StringsConfig.java +++ b/src/main/java/io/github/a5h73y/parkour/configuration/impl/StringsConfig.java @@ -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"); diff --git a/src/main/java/io/github/a5h73y/parkour/gui/impl/JoinCoursesGui.java b/src/main/java/io/github/a5h73y/parkour/gui/impl/JoinCoursesGui.java index ead28c9c..513b83cb 100644 --- a/src/main/java/io/github/a5h73y/parkour/gui/impl/JoinCoursesGui.java +++ b/src/main/java/io/github/a5h73y/parkour/gui/impl/JoinCoursesGui.java @@ -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); diff --git a/src/main/java/io/github/a5h73y/parkour/listener/PlayerInteractListener.java b/src/main/java/io/github/a5h73y/parkour/listener/PlayerInteractListener.java index 332025ad..7b451c37 100644 --- a/src/main/java/io/github/a5h73y/parkour/listener/PlayerInteractListener.java +++ b/src/main/java/io/github/a5h73y/parkour/listener/PlayerInteractListener.java @@ -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())); } diff --git a/src/main/java/io/github/a5h73y/parkour/type/player/PlayerManager.java b/src/main/java/io/github/a5h73y/parkour/type/player/PlayerManager.java index 9389a82c..d76c9384 100644 --- a/src/main/java/io/github/a5h73y/parkour/type/player/PlayerManager.java +++ b/src/main/java/io/github/a5h73y/parkour/type/player/PlayerManager.java @@ -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");