Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/java/tk/shanebee/hg/HG.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ private void loadCmds() {
cmds.put("reload", new ReloadCmd());
cmds.put("setlobbywall", new SetLobbyWallCmd());
cmds.put("wand", new WandCmd());
cmds.put("kit", new KitCmd());
if (Config.enableKitSelection) {
cmds.put("kit", new KitCmd());
}
cmds.put("debug", new DebugCmd());
cmds.put("list", new ListCmd());
cmds.put("listgames", new ListGamesCmd());
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/tk/shanebee/hg/data/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class Config {
public static String forcestartitem;
public static boolean bonusRandom;
public static double bonusChance;
public static boolean enableKitSelection;

//Team info
public static boolean team_showTeamNames;
Expand Down Expand Up @@ -139,6 +140,7 @@ private void loadConfig() {
forcestartitem = config.getString("settings.force-start-item-type");
bonusRandom = config.getBoolean("settings.bonus-random");
bonusChance = config.getDouble("settings.bonus-chance");
enableKitSelection = config.getBoolean("settings.enable-kit-selection");

// Team
team_maxTeamSize = config.getInt("team.max-team-size");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tk/shanebee/hg/game/GamePlayerData.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public void join(Player player, boolean command) {
msgAll(broadcast);
}
}
if (game.kitManager.hasKits()) {
if (Config.enableKitSelection && game.kitManager.hasKits()) {
kitHelp(player);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public List<String> onTabComplete(CommandSender sender, Command command, String
if (args.length == 4 && args[0].equalsIgnoreCase("bordertimer")) {
return Collections.singletonList("<end=remaining seconds>");
}
} else if (args[0].equalsIgnoreCase("kit")) {
} else if (args[0].equalsIgnoreCase("kit") && Config.enableKitSelection) {
if (args.length == 2) {
ArrayList<String> matchesKit = new ArrayList<>();
Game game = null;
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ settings:
leave-item-type: RED_BED
# Item that is shown to force start game
force-start-item-type: NETHER_STAR
# Allow players to pick a kit with /hg kit <name>. Disabled by default.
# When disabled, the kit command is hidden entirely from players.
enable-kit-selection: false
team:
# When enabled, players will see nametags of other players on their team
# if 'hide-nametags' is disabled, this option is ignored and names will show regardless
Expand Down
Loading