mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 20:55:44 +01:00
Aggressively remove player scoreboards
This commit is contained in:
parent
3dc814ef8c
commit
f942b1eded
@ -291,18 +291,23 @@ public class CitizensNPC extends AbstractNPC {
|
|||||||
if (getEntity() instanceof Player
|
if (getEntity() instanceof Player
|
||||||
&& Bukkit.getScoreboardManager().getMainScoreboard().getTeam(teamName) != null) {
|
&& Bukkit.getScoreboardManager().getMainScoreboard().getTeam(teamName) != null) {
|
||||||
Team team = Bukkit.getScoreboardManager().getMainScoreboard().getTeam(teamName);
|
Team team = Bukkit.getScoreboardManager().getMainScoreboard().getTeam(teamName);
|
||||||
|
if (!Setting.USE_SCOREBOARD_TEAMS.asBoolean()) {
|
||||||
|
team.unregister();
|
||||||
|
data().remove(NPC.SCOREBOARD_FAKE_TEAM_NAME_METADATA);
|
||||||
|
} else {
|
||||||
team.setOption(Option.NAME_TAG_VISIBILITY, nameVisibility);
|
team.setOption(Option.NAME_TAG_VISIBILITY, nameVisibility);
|
||||||
if (data().has(NPC.GLOWING_COLOR_METADATA)) {
|
if (data().has(NPC.GLOWING_COLOR_METADATA)) {
|
||||||
if (team.getPrefix() == null || team.getPrefix().length() == 0
|
if (team.getPrefix() == null || team.getPrefix().length() == 0
|
||||||
|| (data().has("previous-glowing-color")
|
|| (data().has("previous-glowing-color")
|
||||||
&& !team.getPrefix().equals(data().get("previous-glowing-color")))) {
|
&& !team.getPrefix().equals(data().get("previous-glowing-color")))) {
|
||||||
team.setPrefix(
|
team.setPrefix(ChatColor.valueOf(data().<String> get(NPC.GLOWING_COLOR_METADATA))
|
||||||
ChatColor.valueOf(data().<String> get(NPC.GLOWING_COLOR_METADATA)).toString());
|
.toString());
|
||||||
data().set("previous-glowing-color", team.getPrefix());
|
data().set("previous-glowing-color", team.getPrefix());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Player player = getEntity() instanceof Player ? (Player) getEntity() : null;
|
Player player = getEntity() instanceof Player ? (Player) getEntity() : null;
|
||||||
NMS.sendPacketNearby(player, getStoredLocation(),
|
NMS.sendPacketNearby(player, getStoredLocation(),
|
||||||
new PacketPlayOutEntityTeleport(NMS.getHandle(getEntity())));
|
new PacketPlayOutEntityTeleport(NMS.getHandle(getEntity())));
|
||||||
|
@ -86,8 +86,6 @@ public class HumanController extends AbstractEntityController {
|
|||||||
skin.apply(handle);
|
skin.apply(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
handle.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getYaw(), at.getPitch());
|
|
||||||
|
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
Loading…
Reference in New Issue
Block a user