mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 02:55:45 +01:00
Aggressively remove player scoreboards
This commit is contained in:
parent
3dc814ef8c
commit
f942b1eded
@ -291,14 +291,19 @@ public class CitizensNPC extends AbstractNPC {
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -86,8 +86,6 @@ public class HumanController extends AbstractEntityController {
|
||||
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() {
|
||||
|
Loading…
Reference in New Issue
Block a user