SteamWar/BauSystem2.0
Archiviert
12
0

Fix TimeCommand

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-07-29 13:46:50 +02:00
Ursprung 5932317f77
Commit a6775ecff5

Datei anzeigen

@ -47,6 +47,15 @@ public class TimeCommand extends SWCommand {
BauSystem.MESSAGE.sendPrefixless("OTHER_TIME_HELP_1", p); BauSystem.MESSAGE.sendPrefixless("OTHER_TIME_HELP_1", p);
} }
@Register
public void genericCommand(Player p, Time time) {
if (!Permission.hasPermission(p, Permission.WORLD)) {
BauSystem.MESSAGE.send("OTHER_TIME_NO_PERM", p);
return;
}
Bukkit.getWorlds().get(0).setTime(time.getValue());
}
@Register @Register
public void genericCommand(Player p, int time) { public void genericCommand(Player p, int time) {
if (!Permission.hasPermission(p, Permission.WORLD)) { if (!Permission.hasPermission(p, Permission.WORLD)) {
@ -60,17 +69,8 @@ public class TimeCommand extends SWCommand {
Bukkit.getWorlds().get(0).setTime(time); Bukkit.getWorlds().get(0).setTime(time);
} }
@Register
public void genericCommand(Player p, Time time) {
if (!Permission.hasPermission(p, Permission.WORLD)) {
BauSystem.MESSAGE.send("OTHER_TIME_NO_PERM", p);
return;
}
Bukkit.getWorlds().get(0).setTime(time.getValue());
}
@ClassMapper(value = int.class, local = true) @ClassMapper(value = int.class, local = true)
public TypeMapper<Integer> doubleTypeMapper() { public TypeMapper<Integer> intTypeMapper() {
return SWCommandUtils.createMapper(s -> { return SWCommandUtils.createMapper(s -> {
try { try {
return Integer.parseInt(s); return Integer.parseInt(s);
@ -80,7 +80,6 @@ public class TimeCommand extends SWCommand {
}, s -> tabCompletions); }, s -> tabCompletions);
} }
@SuppressWarnings("unused")
public enum Time { public enum Time {
NIGHT(18000), NIGHT(18000),
DAY(6000), DAY(6000),