mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 02:25:57 +01:00
Don't downcast to Set since some forks change collection type
This commit is contained in:
parent
8f6e65c4e2
commit
627811ca7a
@ -1068,7 +1068,7 @@ public class NMSImpl implements NMSBridge {
|
||||
server.getTracker().trackedEntities.a(entity.getEntityId(), replace);
|
||||
if (TRACKED_ENTITY_SET != null) {
|
||||
try {
|
||||
Set<Object> set = (Set<Object>) TRACKED_ENTITY_SET.get(server.getTracker());
|
||||
Collection<Object> set = (Collection<Object>) TRACKED_ENTITY_SET.get(server.getTracker());
|
||||
set.remove(entry);
|
||||
set.add(replace);
|
||||
} catch (IllegalArgumentException e) {
|
||||
|
@ -1126,7 +1126,7 @@ public class NMSImpl implements NMSBridge {
|
||||
server.getTracker().trackedEntities.a(entity.getEntityId(), replace);
|
||||
if (TRACKED_ENTITY_SET != null) {
|
||||
try {
|
||||
Set<Object> set = (Set<Object>) TRACKED_ENTITY_SET.get(server.getTracker());
|
||||
Collection<Object> set = (Collection<Object>) TRACKED_ENTITY_SET.get(server.getTracker());
|
||||
set.remove(entry);
|
||||
set.add(replace);
|
||||
} catch (IllegalArgumentException e) {
|
||||
|
@ -1138,7 +1138,7 @@ public class NMSImpl implements NMSBridge {
|
||||
server.getTracker().trackedEntities.a(entity.getEntityId(), replace);
|
||||
if (TRACKED_ENTITY_SET != null) {
|
||||
try {
|
||||
Set<Object> set = (Set<Object>) TRACKED_ENTITY_SET.get(server.getTracker());
|
||||
Collection<Object> set = (Collection<Object>) TRACKED_ENTITY_SET.get(server.getTracker());
|
||||
set.remove(entry);
|
||||
set.add(replace);
|
||||
} catch (IllegalArgumentException e) {
|
||||
|
@ -1175,7 +1175,7 @@ public class NMSImpl implements NMSBridge {
|
||||
server.getTracker().trackedEntities.a(entity.getEntityId(), replace);
|
||||
if (TRACKED_ENTITY_SET != null) {
|
||||
try {
|
||||
Set<Object> set = (Set<Object>) TRACKED_ENTITY_SET.get(server.getTracker());
|
||||
Collection<Object> set = (Collection<Object>) TRACKED_ENTITY_SET.get(server.getTracker());
|
||||
set.remove(entry);
|
||||
set.add(replace);
|
||||
} catch (IllegalArgumentException e) {
|
||||
|
@ -999,7 +999,7 @@ public class NMSImpl implements NMSBridge {
|
||||
server.getTracker().trackedEntities.a(entity.getEntityId(), replace);
|
||||
if (TRACKED_ENTITY_SET != null) {
|
||||
try {
|
||||
Set<Object> set = (Set<Object>) TRACKED_ENTITY_SET.get(server.getTracker());
|
||||
Collection<Object> set = (Collection<Object>) TRACKED_ENTITY_SET.get(server.getTracker());
|
||||
set.remove(entry);
|
||||
set.add(replace);
|
||||
} catch (IllegalArgumentException e) {
|
||||
|
@ -45,8 +45,10 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry {
|
||||
() -> NMSImpl.sendPacket(entityplayer.getBukkitEntity(), new PacketPlayOutAnimation(tracker, 0)),
|
||||
1);
|
||||
}
|
||||
|
||||
if (!Setting.DISABLE_TABLIST.asBoolean())
|
||||
return;
|
||||
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), () -> {
|
||||
NMS.sendTabListRemove(entityplayer.getBukkitEntity(), (Player) tracker.getBukkitEntity());
|
||||
}, Setting.TABLIST_REMOVE_PACKET_DELAY.asTicks());
|
||||
|
Loading…
Reference in New Issue
Block a user