Search in sources :

Example 6 with EntityTrackerEntry

use of net.minecraft.server.v1_10_R1.EntityTrackerEntry in project Citizens2 by CitizensDev.

the class NMSImpl method replaceTrackerEntry.

@Override
public void replaceTrackerEntry(Player player) {
    WorldServer server = (WorldServer) NMSImpl.getHandle(player).getWorld();
    EntityTrackerEntry entry = server.getTracker().trackedEntities.get(player.getEntityId());
    if (entry == null)
        return;
    PlayerlistTrackerEntry replace = new PlayerlistTrackerEntry(entry);
    server.getTracker().trackedEntities.a(player.getEntityId(), replace);
    if (TRACKED_ENTITY_SET != null) {
        try {
            Set<Object> set = (Set<Object>) TRACKED_ENTITY_SET.get(server.getTracker());
            set.remove(entry);
            set.add(replace);
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
    }
}
Also used : EntityTrackerEntry(net.minecraft.server.v1_11_R1.EntityTrackerEntry) EnumSet(java.util.EnumSet) Set(java.util.Set) WorldServer(net.minecraft.server.v1_11_R1.WorldServer) DataWatcherObject(net.minecraft.server.v1_11_R1.DataWatcherObject)

Aggregations

Set (java.util.Set)6 EnumSet (java.util.EnumSet)4 HashSet (java.util.HashSet)2 UUID (java.util.UUID)2 CompoundTag_v1_10_R1 (net.aufdemrand.denizen.nms.impl.jnbt.CompoundTag_v1_10_R1)2 net.minecraft.server.v1_10_R1 (net.minecraft.server.v1_10_R1)2 CraftEntity (org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity)2 CraftPlayer (org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer)2 DataWatcherObject (net.minecraft.server.v1_10_R1.DataWatcherObject)1 EntityTrackerEntry (net.minecraft.server.v1_10_R1.EntityTrackerEntry)1 WorldServer (net.minecraft.server.v1_10_R1.WorldServer)1 DataWatcherObject (net.minecraft.server.v1_11_R1.DataWatcherObject)1 EntityTrackerEntry (net.minecraft.server.v1_11_R1.EntityTrackerEntry)1 WorldServer (net.minecraft.server.v1_11_R1.WorldServer)1 DataWatcherObject (net.minecraft.server.v1_12_R1.DataWatcherObject)1 EntityTrackerEntry (net.minecraft.server.v1_12_R1.EntityTrackerEntry)1 WorldServer (net.minecraft.server.v1_12_R1.WorldServer)1 EntityTrackerEntry (net.minecraft.server.v1_8_R3.EntityTrackerEntry)1 WorldServer (net.minecraft.server.v1_8_R3.WorldServer)1