Make Sleep 'CaSeInDePeNdEnCe'
Make Sleep Command like Bukkit Command (String.split(" "))
Dieser Commit ist enthalten in:
Ursprung
5b73ec5305
Commit
15570cab7c
@ -67,16 +67,20 @@ public class ScriptListener implements Listener {
|
|||||||
while (index < commands.size()) {
|
while (index < commands.size()) {
|
||||||
String command = commands.get(index++);
|
String command = commands.get(index++);
|
||||||
|
|
||||||
if (command.startsWith("sleep")) {
|
String[] strings = command.split(" ");
|
||||||
String sleepTimeString = command.substring(5).trim();
|
if (strings.length > 0) {
|
||||||
int sleepTime = 1;
|
if (strings[0].equalsIgnoreCase("sleep")) {
|
||||||
try {
|
int sleepTime = 1;
|
||||||
sleepTime = Integer.parseInt(sleepTimeString);
|
if (strings.length > 1) {
|
||||||
} catch (NumberFormatException e) {
|
try {
|
||||||
// Ignored
|
sleepTime = Integer.parseInt(strings[1]);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
// Ignored
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), this::resume, sleepTime);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getPlugin(), this::resume, sleepTime);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerCommandPreprocessEvent preprocessEvent = new PlayerCommandPreprocessEvent(player, "/" + command);
|
PlayerCommandPreprocessEvent preprocessEvent = new PlayerCommandPreprocessEvent(player, "/" + command);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren