Fix SWCommand registering on new instance
Add SWCommandUtils long mapper
Dieser Commit ist enthalten in:
Ursprung
8142224f67
Commit
9dad22742e
@ -77,6 +77,7 @@ public abstract class SWCommand {
|
||||
return strings;
|
||||
}
|
||||
};
|
||||
unregister();
|
||||
register();
|
||||
|
||||
for (Method method : getClass().getDeclaredMethods()) {
|
||||
|
@ -61,6 +61,7 @@ public class SWCommandUtils {
|
||||
addMapper(float.class, Float.class, createMapper(numberMapper(Float::parseFloat), numberCompleter(Float::parseFloat)));
|
||||
addMapper(double.class, Double.class, createMapper(numberMapper(Double::parseDouble), numberCompleter(Double::parseDouble)));
|
||||
addMapper(int.class, Integer.class, createMapper(numberMapper(Integer::parseInt), numberCompleter(Integer::parseInt)));
|
||||
addMapper(long.class, Long.class, createMapper(numberMapper(Long::parseLong), numberCompleter(Long::parseLong)));
|
||||
MAPPER_FUNCTIONS.put(String.class.getTypeName(), createMapper(s -> s, Collections::singletonList));
|
||||
MAPPER_FUNCTIONS.put(Player.class.getTypeName(), createMapper(Bukkit::getPlayer, s -> Bukkit.getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toList())));
|
||||
MAPPER_FUNCTIONS.put(GameMode.class.getTypeName(), createMapper(s -> {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren