Compare commits
2 Commits
77d34b53e6
...
5533961066
Author | SHA1 | Date |
---|---|---|
fullwall | 5533961066 | |
fullwall | b09a8bae56 |
|
@ -592,7 +592,8 @@ public class HologramTrait extends Trait {
|
|||
|
||||
@Override
|
||||
public Collection<Entity> getEntities() {
|
||||
return hologram != null ? ImmutableList.of(hologram.getEntity()) : Collections.emptyList();
|
||||
return hologram != null && hologram.getEntity() != null ? ImmutableList.of(hologram.getEntity())
|
||||
: Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -42,13 +42,13 @@ public class ScoreboardTrait extends Trait {
|
|||
metadata = CitizensAPI.getLocationLookup().<Boolean> registerMetadata("scoreboard", (meta, event) -> {
|
||||
for (NPC npc : CitizensAPI.getNPCRegistry()) {
|
||||
ScoreboardTrait trait = npc.getTraitNullable(ScoreboardTrait.class);
|
||||
if (trait == null) {
|
||||
if (trait == null)
|
||||
continue;
|
||||
}
|
||||
|
||||
Team team = trait.getTeam();
|
||||
if (team == null || meta.has(event.getPlayer().getUniqueId(), team.getName())) {
|
||||
if (team == null || meta.has(event.getPlayer().getUniqueId(), team.getName()))
|
||||
continue;
|
||||
}
|
||||
|
||||
NMS.sendTeamPacket(event.getPlayer(), team, 0);
|
||||
meta.set(event.getPlayer().getUniqueId(), team.getName(), true);
|
||||
}
|
||||
|
@ -232,9 +232,9 @@ public class ScoreboardTrait extends Trait {
|
|||
if (!changed)
|
||||
return;
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
if (player.hasMetadata("NPC")) {
|
||||
if (player.hasMetadata("NPC"))
|
||||
continue;
|
||||
}
|
||||
|
||||
if (metadata.has(player.getUniqueId(), team.getName())) {
|
||||
NMS.sendTeamPacket(player, team, 2);
|
||||
} else {
|
||||
|
@ -242,6 +242,13 @@ public class ScoreboardTrait extends Trait {
|
|||
metadata.set(player.getUniqueId(), team.getName(), true);
|
||||
}
|
||||
}
|
||||
changed = false;
|
||||
}
|
||||
|
||||
public enum TeamPacketMode {
|
||||
ADD,
|
||||
REMOVE,
|
||||
UPDATE;
|
||||
}
|
||||
|
||||
private static boolean SUPPORT_COLLIDABLE_SETOPTION = true;
|
||||
|
|
|
@ -106,12 +106,6 @@ public class FoxTrait extends Trait {
|
|||
this.type = type;
|
||||
}
|
||||
|
||||
public enum FoxModifier {
|
||||
FACEPLANTED,
|
||||
INTERESTED,
|
||||
POUNCING;
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "fox --type type --sleeping [true|false] --sitting [true|false] --crouching [true|false] --interested [true|false] --pouncing [true|false] --faceplanted [true|false]",
|
||||
|
|
Loading…
Reference in New Issue