Skip to content

Commit

Permalink
Aggressively remove player scoreboards
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Jun 14, 2016
1 parent 130abfc commit 99362f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 13 additions & 8 deletions src/main/java/net/citizensnpcs/npc/CitizensNPC.java
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,19 @@ public void update() {
if (getEntity() instanceof Player
&& Bukkit.getScoreboardManager().getMainScoreboard().getTeam(teamName) != null) {
Team team = Bukkit.getScoreboardManager().getMainScoreboard().getTeam(teamName);
team.setOption(Option.NAME_TAG_VISIBILITY, nameVisibility);
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 (!Setting.USE_SCOREBOARD_TEAMS.asBoolean()) {
team.unregister();
data().remove(NPC.SCOREBOARD_FAKE_TEAM_NAME_METADATA);
} else {
team.setOption(Option.NAME_TAG_VISIBILITY, nameVisibility);
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());
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ protected Entity createEntity(final Location at, final NPC npc) {
skin.apply(handle);
}

handle.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getYaw(), at.getPitch());

Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
@Override
public void run() {
Expand Down

0 comments on commit 99362f3

Please sign in to comment.