forked from SteamWar/SteamWar
Fix TeamCommand
This commit is contained in:
@@ -495,7 +495,7 @@ TEAM_INFO_MEMBER = §7Member ({0})§8: {1}
|
|||||||
TEAM_INFO_EVENTS = §7Events ({0})§8: §e{1}
|
TEAM_INFO_EVENTS = §7Events ({0})§8: §e{1}
|
||||||
#Server Team
|
#Server Team
|
||||||
TEAM_INFO_SW_USAGE = §8/§7team info §8[§eSW§8|§eSteamWar§8]
|
TEAM_INFO_SW_USAGE = §8/§7team info §8[§eSW§8|§eSteamWar§8]
|
||||||
TEAM_INFO_SW_HEADER = §eSteam§8War Server Team
|
TEAM_INFO_SW_HEADER = §7Server Team §eSteam§8War §8[§eS§8W]
|
||||||
TEAM_INFO_SW_RANK = {0} §7({1})§8: {2}
|
TEAM_INFO_SW_RANK = {0} §7({1})§8: {2}
|
||||||
|
|
||||||
#TEAM Prefix
|
#TEAM Prefix
|
||||||
|
|||||||
@@ -465,10 +465,6 @@ TEAM_INFO_TEAM = §7Team §e{0} §8[§{1}{2}§8]
|
|||||||
TEAM_INFO_LEADER = §7Leader ({0})§8: {1}
|
TEAM_INFO_LEADER = §7Leader ({0})§8: {1}
|
||||||
TEAM_INFO_MEMBER = §7Member ({0})§8: {1}
|
TEAM_INFO_MEMBER = §7Member ({0})§8: {1}
|
||||||
TEAM_INFO_EVENTS = §7Events ({0})§8: §e{1}
|
TEAM_INFO_EVENTS = §7Events ({0})§8: §e{1}
|
||||||
#Server Team
|
|
||||||
TEAM_INFO_SW_USAGE = §8/§7team info §8[§eSW§8|§eSteamWar§8]
|
|
||||||
TEAM_INFO_SW_HEADER = §eSteam§8War Serverteam
|
|
||||||
TEAM_INFO_SW_RANK = {0} §7({1})§8: {2}
|
|
||||||
|
|
||||||
#Team Prefix
|
#Team Prefix
|
||||||
TEAM_PREFIX_USAGE = §8/§7team prefix §8[§eteam§8|§eSW§8]
|
TEAM_PREFIX_USAGE = §8/§7team prefix §8[§eteam§8|§eSW§8]
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ package de.steamwar.velocitycore;
|
|||||||
|
|
||||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import org.yaml.snakeyaml.DumperOptions;
|
||||||
import org.yaml.snakeyaml.LoaderOptions;
|
import org.yaml.snakeyaml.LoaderOptions;
|
||||||
import org.yaml.snakeyaml.TypeDescription;
|
import org.yaml.snakeyaml.TypeDescription;
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
@@ -46,7 +47,7 @@ public class Config {
|
|||||||
Constructor constructor = new Constructor(clazz, new LoaderOptions());
|
Constructor constructor = new Constructor(clazz, new LoaderOptions());
|
||||||
constructor.addTypeDescription(typeDescription);
|
constructor.addTypeDescription(typeDescription);
|
||||||
|
|
||||||
Representer representer = new Representer();
|
Representer representer = new Representer(new DumperOptions());
|
||||||
representer.getPropertyUtils().setSkipMissingProperties(true);
|
representer.getPropertyUtils().setSkipMissingProperties(true);
|
||||||
|
|
||||||
Yaml yaml = new Yaml(constructor, representer);
|
Yaml yaml = new Yaml(constructor, representer);
|
||||||
|
|||||||
@@ -362,13 +362,13 @@ public class TeamCommand extends SWCommand {
|
|||||||
@Register(value = "prefix", description = "TEAM_PREFIX_USAGE")
|
@Register(value = "prefix", description = "TEAM_PREFIX_USAGE")
|
||||||
public void prefix(@Validator("canUseTeamPrefix") Chatter sender) {
|
public void prefix(@Validator("canUseTeamPrefix") Chatter sender) {
|
||||||
boolean swPrefix = SteamwarPrefix.usesSWPrefix(sender.user());
|
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")
|
@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);
|
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)
|
@Validator(value = "canUseTeamPrefix", local = true)
|
||||||
|
|||||||
Reference in New Issue
Block a user