Skip to content

Commit ce5d4ce

Browse files
committed
Add clearOnServerSwitch parameter to the Title example command
1 parent 3b90d55 commit ce5d4ce

File tree

1 file changed

+11
-2
lines changed
  • bukkit-example-common/src/main/java/com/lunarclient/apollo/example/command

1 file changed

+11
-2
lines changed

bukkit-example-common/src/main/java/com/lunarclient/apollo/example/command/TitleCommand.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,22 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
4141
}
4242

4343
Player player = (Player) sender;
44+
TitleExample titleExample = ApolloExamplePlugin.getInstance().getTitleExample();
45+
46+
if (args.length == 2 && args[0].equalsIgnoreCase("clearOnServerSwitch")) {
47+
boolean value = Boolean.parseBoolean(args[1]);
48+
titleExample.setClearTitleOnServerSwitch(value);
49+
50+
player.sendMessage("Clear title on server switch has been set to " + value);
51+
return true;
52+
}
4453

4554
if (args.length != 1) {
4655
player.sendMessage("Usage: /title <display|displayInterpolated|reset>");
56+
player.sendMessage("Usage: /title <clearOnServerSwitch> <value>");
4757
return true;
4858
}
4959

50-
TitleExample titleExample = ApolloExamplePlugin.getInstance().getTitleExample();
51-
5260
switch (args[0].toLowerCase()) {
5361
case "display": {
5462
titleExample.displayTitleExample(player);
@@ -70,6 +78,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
7078

7179
default: {
7280
player.sendMessage("Usage: /title <display|displayInterpolated|reset>");
81+
player.sendMessage("Usage: /title <clearOnServerSwitch> <value>");
7382
break;
7483
}
7584
}

0 commit comments

Comments
 (0)