mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 17:57:38 +00:00
Gave //fast an on|off parameter and adjusted its message to reflect a future change.
This commit is contained in:
parent
542aed6ffd
commit
ef88c04550
@ -63,23 +63,35 @@ public class GeneralCommands {
|
|||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
aliases = { "/fast" },
|
aliases = { "/fast" },
|
||||||
usage = "",
|
usage = "[on|off]",
|
||||||
desc = "Toggle fast mode",
|
desc = "Toggle fast mode",
|
||||||
min = 0,
|
min = 0,
|
||||||
max = 0
|
max = 1
|
||||||
)
|
)
|
||||||
@CommandPermissions("worldedit.fast")
|
@CommandPermissions("worldedit.fast")
|
||||||
public static void fast(CommandContext args, WorldEdit we,
|
public static void fast(CommandContext args, WorldEdit we,
|
||||||
LocalSession session, LocalPlayer player, EditSession editSession)
|
LocalSession session, LocalPlayer player, EditSession editSession)
|
||||||
throws WorldEditException {
|
throws WorldEditException {
|
||||||
|
|
||||||
session.setFastMode(!session.hasFastMode());
|
String newState = args.getString(0, null);
|
||||||
|
|
||||||
if (session.hasFastMode()) {
|
if (session.hasFastMode()) {
|
||||||
player.print("Fast mode enabled. You may need to rejoin to see changes.");
|
if ("on".equals(newState)) {
|
||||||
} else {
|
player.printError("Fast mode already enabled.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
session.setFastMode(false);
|
||||||
player.print("Fast mode disabled.");
|
player.print("Fast mode disabled.");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if ("off".equals(newState)) {
|
||||||
|
player.printError("Fast mode already disabled.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
session.setFastMode(true);
|
||||||
|
player.print("Fast mode enabled. Lighting in the affected chunks may be wrong and/or you may need to rejoin to see changes.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
|
Loading…
Reference in New Issue
Block a user