Dieser Commit ist enthalten in:
Ursprung
c6a68fa2a1
Commit
5eaa87885d
@ -1 +1 @@
|
|||||||
Subproject commit b1328695a1a30c062d066ff564a9112fde668b3e
|
Subproject commit 09a9d8980b0186e7e5e17c14ef651a9684bc8651
|
@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
package de.steamwar.bungeecore.commands;
|
package de.steamwar.bungeecore.commands;
|
||||||
|
|
||||||
import de.steamwar.bungeecore.Message;
|
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
|
import de.steamwar.command.TypeValidator;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
|
||||||
import static de.steamwar.bungeecore.Storage.lastChats;
|
import static de.steamwar.bungeecore.Storage.lastChats;
|
||||||
@ -32,11 +32,18 @@ public class RCommand extends SWCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Register(description = "R_USAGE")
|
@Register(description = "R_USAGE")
|
||||||
public void genericCommand(ProxiedPlayer player, String... message) {
|
public void genericCommand(ProxiedPlayer player, @Validator String... message) {
|
||||||
if (message.length == 0) {
|
|
||||||
Message.send("R_USAGE", player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MsgCommand.msg(player, lastChats.get(player), message);
|
MsgCommand.msg(player, lastChats.get(player), message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ClassValidator(String[].class)
|
||||||
|
public TypeValidator<String[]> getValidator() {
|
||||||
|
return (sender, value, messageSender) -> {
|
||||||
|
if (value.length == 0) {
|
||||||
|
messageSender.accept("R_USAGE", new Object[0]);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,5 +21,5 @@ package de.steamwar.command;
|
|||||||
|
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
|
|
||||||
public interface Validator<T> extends AbstractValidator<CommandSender, T> {
|
public interface TypeValidator<T> extends AbstractValidator<CommandSender, T> {
|
||||||
}
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren