use of com.ebicep.warlords.player.Settings in project Warlords by ebicep.
the class ParticleQualityCommand method onCommand.
@Override
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
Player player = BaseCommand.requirePlayer(sender);
if (player != null) {
if (args.length == 0) {
player.sendMessage(ChatColor.GREEN + "Possible Values: LOW, MEDIUM, HIGH");
return true;
}
if (args[0] != null) {
if (Arrays.stream(Settings.ParticleQuality.values()).anyMatch((t) -> t.name().equals(args[0].toUpperCase()))) {
Settings.ParticleQuality newParticleQuality = Settings.ParticleQuality.valueOf(args[0].toUpperCase());
PlayerSettings settings = Warlords.getPlayerSettings(player.getUniqueId());
settings.setParticleQuality(newParticleQuality);
DatabasePlayer databasePlayer = DatabaseManager.playerService.findByUUID(player.getUniqueId());
databasePlayer.setParticleQuality(newParticleQuality);
DatabaseManager.updatePlayerAsync(databasePlayer);
sender.sendMessage(ChatColor.GREEN + "Particle Quality set to " + args[0].toUpperCase());
return true;
}
}
sender.sendMessage(ChatColor.RED + "Not found. Possible Values: LOW, MEDIUM, HIGH");
return true;
}
return true;
}
Aggregations