Set collidable scoreboard option and always test for placeholders in skin names

This commit is contained in:
fullwall 2021-11-29 20:56:13 +08:00
parent 8f341ccaf2
commit 6b30d06705
2 changed files with 13 additions and 2 deletions

View File

@ -69,6 +69,18 @@ public class ScoreboardTrait extends Trait {
SUPPORT_TEAM_SETOPTION = false;
}
}
if (SUPPORT_COLLIDABLE_SETOPTION && npc.data().has(NPC.COLLIDABLE_METADATA)) {
try {
team.setOption(Option.COLLISION_RULE,
(boolean) npc.data().get(NPC.COLLIDABLE_METADATA) ? OptionStatus.ALWAYS : OptionStatus.NEVER);
} catch (NoSuchMethodError e) {
SUPPORT_COLLIDABLE_SETOPTION = false;
} catch (NoClassDefFoundError e) {
SUPPORT_COLLIDABLE_SETOPTION = false;
}
}
if (!SUPPORT_TEAM_SETOPTION) {
NMS.setTeamNameTagVisible(team, nameVisibility);
}
@ -129,6 +141,7 @@ public class ScoreboardTrait extends Trait {
this.color = color;
}
private static boolean SUPPORT_COLLIDABLE_SETOPTION = true;
private static boolean SUPPORT_GLOWING_COLOR = true;
private static boolean SUPPORT_TAGS = true;
private static boolean SUPPORT_TEAM_SETOPTION = true;

View File

@ -127,8 +127,6 @@ public class SkinTrait extends Trait {
if (timer-- > 0)
return;
timer = Setting.PLACEHOLDER_SKIN_UPDATE_FREQUENCY.asInt();
if (filledPlaceholder == null)
return;
checkPlaceholder(true);
}