Perform if checks on team handling, potentially tiny tiny tiny performance boost.

This commit is contained in:
libraryaddict 2021-05-16 17:48:21 +12:00
parent 98b6aa0185
commit d306ab0d85

View File

@ -119,18 +119,23 @@ public class DisguiseUtilities {
team.setOption(Option.NAME_TAG_VISIBILITY, nameVisible ? OptionStatus.ALWAYS : OptionStatus.NEVER);
}
team.setOption(Option.COLLISION_RULE, OptionStatus.NEVER);
if (team.getOption(Option.COLLISION_RULE) != OptionStatus.NEVER) {
team.setOption(Option.COLLISION_RULE, OptionStatus.NEVER);
}
if (disguise.getWatcher().getGlowColor() != null) {
if (disguise.getWatcher().getGlowColor() != team.getColor()) {
team.setColor(disguise.getWatcher().getGlowColor());
}
if (NmsVersion.v1_13.isSupported()) {
team.setPrefix("Colorize");
team.setSuffix("Colorize");
} else {
team.setPrefix(getPrefix());
team.setSuffix(getSuffix());
String prefix = NmsVersion.v1_13.isSupported() ? "Colorize" : getPrefix();
String suffix = NmsVersion.v1_13.isSupported() ? "Colorize" : getSuffix();
if (!prefix.equals(team.getPrefix())) {
team.setPrefix(prefix);
}
if (!suffix.equals(team.getSuffix())) {
team.setSuffix(suffix);
}
}
}