Skip to content

Commit

Permalink
Fix /npc glowing --color
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Jul 12, 2019
1 parent 0e328ee commit f767c2b
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions main/src/main/java/net/citizensnpcs/npc/CitizensNPC.java
Expand Up @@ -403,10 +403,21 @@ private void updateCustomName() {
}

if (data().has(NPC.GLOWING_COLOR_METADATA)) {
if (team.getPrefix() == null || team.getPrefix().length() == 0 || (data().has("previous-glowing-color")
&& !team.getPrefix().equals(data().get("previous-glowing-color")))) {
team.setPrefix(ChatColor.valueOf(data().<String> get(NPC.GLOWING_COLOR_METADATA)).toString());
data().set("previous-glowing-color", team.getPrefix());
if (SUPPORT_GLOWING_COLOR) {
try {
if (team.getColor() == null || (data().has("previous-glowing-color")
&& !team.getColor().name().equals(data().get("previous-glowing-color")))) {
team.setColor(ChatColor.valueOf(data().<String> get(NPC.GLOWING_COLOR_METADATA)));
}
} catch (NoSuchMethodError err) {
SUPPORT_GLOWING_COLOR = false;
}
} else {
if (team.getPrefix() == null || team.getPrefix().length() == 0 || (data().has("previous-glowing-color")
&& !team.getPrefix().equals(data().get("previous-glowing-color")))) {
team.setPrefix(ChatColor.valueOf(data().<String> get(NPC.GLOWING_COLOR_METADATA)).toString());
data().set("previous-glowing-color", team.getPrefix());
}
}
}
}
Expand All @@ -421,8 +432,10 @@ private void updateFlyableState() {
}

private static final SetMultimap<ChunkCoord, NPC> CHUNK_LOADERS = HashMultimap.create();

private static final String NPC_METADATA_MARKER = "NPC";
private static boolean SUPPORT_GLOWING = true;
private static boolean SUPPORT_GLOWING_COLOR = true;
private static boolean SUPPORT_SILENT = true;
private static boolean SUPPORT_TEAM_SETOPTION = true;
}

0 comments on commit f767c2b

Please sign in to comment.