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.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()); team.setColor(disguise.getWatcher().getGlowColor());
} }
if (NmsVersion.v1_13.isSupported()) { String prefix = NmsVersion.v1_13.isSupported() ? "Colorize" : getPrefix();
team.setPrefix("Colorize"); String suffix = NmsVersion.v1_13.isSupported() ? "Colorize" : getSuffix();
team.setSuffix("Colorize");
} else { if (!prefix.equals(team.getPrefix())) {
team.setPrefix(getPrefix()); team.setPrefix(prefix);
team.setSuffix(getSuffix()); }
if (!suffix.equals(team.getSuffix())) {
team.setSuffix(suffix);
} }
} }
} }