Search in sources :

Example 1 with EntityTracker

use of net.minecraft.server.v1_14_R1.PlayerChunkMap.EntityTracker in project Citizens2 by CitizensDev.

the class NMSImpl method replaceTrackerEntry.

@Override
public void replaceTrackerEntry(Player player) {
    WorldServer server = (WorldServer) NMSImpl.getHandle(player).getWorld();
    EntityTracker entry = server.getChunkProvider().playerChunkMap.trackedEntities.get(player.getEntityId());
    if (entry == null)
        return;
    PlayerlistTracker replace = new PlayerlistTracker(server.getChunkProvider().playerChunkMap, entry);
    server.getChunkProvider().playerChunkMap.trackedEntities.put(player.getEntityId(), replace);
    if (getHandle(player) instanceof EntityHumanNPC) {
        ((EntityHumanNPC) getHandle(player)).setTracked(replace);
    }
}
Also used : EntityTracker(net.minecraft.server.v1_15_R1.PlayerChunkMap.EntityTracker) WorldServer(net.minecraft.server.v1_15_R1.WorldServer) EntityHumanNPC(net.citizensnpcs.nms.v1_15_R1.entity.EntityHumanNPC)

Example 2 with EntityTracker

use of net.minecraft.server.v1_14_R1.PlayerChunkMap.EntityTracker in project Citizens2 by CitizensDev.

the class NMSImpl method replaceTrackerEntry.

@Override
public void replaceTrackerEntry(Player player) {
    WorldServer server = (WorldServer) NMSImpl.getHandle(player).getWorld();
    EntityTracker entry = server.getChunkProvider().playerChunkMap.trackedEntities.get(player.getEntityId());
    if (entry == null)
        return;
    PlayerlistTracker replace = new PlayerlistTracker(server.getChunkProvider().playerChunkMap, entry);
    server.getChunkProvider().playerChunkMap.trackedEntities.put(player.getEntityId(), replace);
    if (getHandle(player) instanceof EntityHumanNPC) {
        ((EntityHumanNPC) getHandle(player)).setTracked(replace);
    }
}
Also used : EntityTracker(net.minecraft.server.v1_14_R1.PlayerChunkMap.EntityTracker) WorldServer(net.minecraft.server.v1_14_R1.WorldServer) EntityHumanNPC(net.citizensnpcs.nms.v1_14_R1.entity.EntityHumanNPC)

Example 3 with EntityTracker

use of net.minecraft.server.v1_14_R1.PlayerChunkMap.EntityTracker in project Citizens2 by CitizensDev.

the class NMSImpl method replaceTrackerEntry.

@Override
public void replaceTrackerEntry(Player player) {
    WorldServer server = (WorldServer) NMSImpl.getHandle(player).getWorld();
    EntityTracker entry = server.getChunkProvider().playerChunkMap.trackedEntities.get(player.getEntityId());
    if (entry == null)
        return;
    PlayerlistTracker replace = new PlayerlistTracker(server.getChunkProvider().playerChunkMap, entry);
    server.getChunkProvider().playerChunkMap.trackedEntities.put(player.getEntityId(), replace);
    if (getHandle(player) instanceof EntityHumanNPC) {
        ((EntityHumanNPC) getHandle(player)).setTracked(replace);
    }
}
Also used : EntityTracker(net.minecraft.server.v1_16_R3.PlayerChunkMap.EntityTracker) WorldServer(net.minecraft.server.v1_16_R3.WorldServer) EntityHumanNPC(net.citizensnpcs.nms.v1_16_R3.entity.EntityHumanNPC)

Aggregations

EntityHumanNPC (net.citizensnpcs.nms.v1_14_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_15_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_16_R3.entity.EntityHumanNPC)1 EntityTracker (net.minecraft.server.v1_14_R1.PlayerChunkMap.EntityTracker)1 WorldServer (net.minecraft.server.v1_14_R1.WorldServer)1 EntityTracker (net.minecraft.server.v1_15_R1.PlayerChunkMap.EntityTracker)1 WorldServer (net.minecraft.server.v1_15_R1.WorldServer)1 EntityTracker (net.minecraft.server.v1_16_R3.PlayerChunkMap.EntityTracker)1 WorldServer (net.minecraft.server.v1_16_R3.WorldServer)1