forked from SteamWar/SteamWar
Fix TeamCommand
This commit is contained in:
@@ -21,6 +21,7 @@ package de.steamwar.velocitycore;
|
||||
|
||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||
import lombok.Getter;
|
||||
import org.yaml.snakeyaml.DumperOptions;
|
||||
import org.yaml.snakeyaml.LoaderOptions;
|
||||
import org.yaml.snakeyaml.TypeDescription;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
@@ -46,7 +47,7 @@ public class Config {
|
||||
Constructor constructor = new Constructor(clazz, new LoaderOptions());
|
||||
constructor.addTypeDescription(typeDescription);
|
||||
|
||||
Representer representer = new Representer();
|
||||
Representer representer = new Representer(new DumperOptions());
|
||||
representer.getPropertyUtils().setSkipMissingProperties(true);
|
||||
|
||||
Yaml yaml = new Yaml(constructor, representer);
|
||||
|
||||
@@ -362,13 +362,13 @@ public class TeamCommand extends SWCommand {
|
||||
@Register(value = "prefix", description = "TEAM_PREFIX_USAGE")
|
||||
public void prefix(@Validator("canUseTeamPrefix") Chatter sender) {
|
||||
boolean swPrefix = SteamwarPrefix.usesSWPrefix(sender.user());
|
||||
sender.system("TEAM_PREFIX_CURRENT", swPrefix ? STEAM_WAR : sender.parse("TEAM_PREFIX_TEAM"));
|
||||
sender.system("TEAM_PREFIX_CURRENT", swPrefix ? STEAM_WAR : sender.parseToPlain("TEAM_PREFIX_TEAM"));
|
||||
}
|
||||
|
||||
@Register(value = "prefix", description = "TEAM_PREFIX_USAGE")
|
||||
public void prefix(@Validator("canUseTeamPrefix") Chatter sender, @StaticValue(value = {SW, STEAM_WAR, "Team"}, falseValues = {2}) boolean useSWTeamTag) {
|
||||
public void prefix(@Validator("canUseTeamPrefix") Chatter sender, @StaticValue(value = {SW, STEAM_WAR, "Team"}, falseValues = {2}, allowISE = true) boolean useSWTeamTag) {
|
||||
SteamwarPrefix.setSWPrefix(sender.user(), useSWTeamTag);
|
||||
sender.system("TEAM_PREFIX_SET", useSWTeamTag ? STEAM_WAR : sender.parse("TEAM_PREFIX_TEAM"));
|
||||
sender.system("TEAM_PREFIX_SET", useSWTeamTag ? STEAM_WAR : sender.parseToPlain("TEAM_PREFIX_TEAM"));
|
||||
}
|
||||
|
||||
@Validator(value = "canUseTeamPrefix", local = true)
|
||||
|
||||
Reference in New Issue
Block a user