Spigot v1_8_R1 NPC not showing up?

Discussion in 'Spigot Plugin Development' started by Heretere, May 11, 2016.

  1. Code (Text):

        public NPCEntity(Player p, World world, Location location, GameProfile profile, NPCNetworkManager networkManager) {
            super(((CraftServer) Bukkit.getServer()).getServer(), ((CraftWorld) world).getHandle(), profile, new PlayerInteractManager(((CraftWorld) world).getHandle()));
            this.playerInteractManager.b(EnumGamemode.SURVIVAL);
            this.playerConnection = new NPCPlayerConnection(networkManager, this);
            this.fauxSleeping = true;
            this.bukkitEntity = new CraftPlayer((CraftServer) Bukkit.getServer(), this);

            WorldServer worldServer = ((CraftWorld) world).getHandle();
            this.setPositionRotation(location.getX(), location.getY(), location.getZ(), 0, 0);
            worldServer.addEntity(this);
            worldServer.players.remove(this);

            Reflections.sendPlayerPacket(p, new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, this));
            Reflections.sendPlayerPacket(p, new PacketPlayOutNamedEntitySpawn(this));
            Reflections.sendPlayerPacket(p, new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, this));
        }
     
    I am currently working on wrappers so I can spawn fake players from version 1.8 to 1.9.2. I was able to make it the player visible on v1_8_R2, v1_8_R3, v1_9_R1 but I can't seem to make the play visible on v1_8_R1 could someone tell me what I am doing wrong above?
     
  2. MiniDigger

    Supporter

    take a look how the packets changed between 8R1 and 8R2 and apply that to your stuff