Search in sources :

Example 16 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project FireAPI by FireBlade-Serv.

the class FireInjector method addPlayer.

public void addPlayer(Player p) {
    try {
        EntityPlayer ep = ((CraftPlayer) p).getHandle();
        Channel ch = getChannel(getNetworkManager(ep));
        if (ch.pipeline().get("PacketInjector") == null) {
            FireHandler h = new FireHandler(p);
            ch.pipeline().addBefore("packet_handler", "PacketInjector", h);
        }
    } catch (Throwable t) {
        t.printStackTrace();
    }
}
Also used : Channel(io.netty.channel.Channel) EntityPlayer(net.minecraft.server.v1_8_R3.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)

Example 17 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project FireAPI by FireBlade-Serv.

the class FireInjector method removePlayer.

public void removePlayer(Player p) {
    try {
        EntityPlayer ep = ((CraftPlayer) p).getHandle();
        Channel ch = getChannel(getNetworkManager(ep));
        if (ch.pipeline().get("PacketInjector") != null) {
            ch.pipeline().remove("PacketInjector");
        }
    } catch (Throwable t) {
        t.printStackTrace();
    }
}
Also used : Channel(io.netty.channel.Channel) EntityPlayer(net.minecraft.server.v1_8_R3.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)

Example 18 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project DragonsOnline by UniverseCraft.

the class PlayerNPC116R3 method spawn.

public void spawn() {
    registry.unregister(this);
    uuid = UUID.randomUUID();
    this.isDestroyed = false;
    DedicatedServer server = ((CraftServer) Bukkit.getServer()).getServer();
    WorldServer world = ((CraftWorld) location.getWorld()).getHandle();
    // displayName);
    GameProfile gameProfile = new GameProfile(uuid, "");
    gameProfile.getProperties().clear();
    gameProfile.getProperties().put("textures", new Property("textures", texture, signature));
    this.handle = new EntityPlayer(server, world, gameProfile, new PlayerInteractManager(world));
    handle.persist = true;
    handle.collides = false;
    handle.setCustomNameVisible(false);
    handle.setInvulnerable(npc.isImmortal());
    handle.playerConnection = new PlayerConnection(((CraftServer) Bukkit.getServer()).getServer(), new NetworkManager(EnumProtocolDirection.SERVERBOUND), handle);
    ((CraftWorld) location.getWorld()).addEntity(handle, CreatureSpawnEvent.SpawnReason.CUSTOM);
    handle.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
    registry.register(this);
    for (Entity e : getEntity().getNearbyEntities(SPAWN_RADIUS, SPAWN_RADIUS, SPAWN_RADIUS)) {
        if (e instanceof Player) {
            registry.updateSpawns((Player) e, true);
        }
    }
}
Also used : Entity(org.bukkit.entity.Entity) PacketPlayOutEntity(net.minecraft.server.v1_16_R3.PacketPlayOutEntity) Player(org.bukkit.entity.Player) EntityPlayer(net.minecraft.server.v1_16_R3.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer) GameProfile(com.mojang.authlib.GameProfile) PlayerInteractManager(net.minecraft.server.v1_16_R3.PlayerInteractManager) EntityPlayer(net.minecraft.server.v1_16_R3.EntityPlayer) DedicatedServer(net.minecraft.server.v1_16_R3.DedicatedServer) WorldServer(net.minecraft.server.v1_16_R3.WorldServer) CraftServer(org.bukkit.craftbukkit.v1_16_R3.CraftServer) NetworkManager(net.minecraft.server.v1_16_R3.NetworkManager) CraftWorld(org.bukkit.craftbukkit.v1_16_R3.CraftWorld) Property(com.mojang.authlib.properties.Property) PlayerConnection(net.minecraft.server.v1_16_R3.PlayerConnection)

Example 19 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project CoordsOffline by elliotnash.

the class v1_16_R2 method loadOfflinePlayer.

public Player loadOfflinePlayer(OfflinePlayer player) {
    MinecraftServer minecraftserver = MinecraftServer.getServer();
    GameProfile gameprofile = new GameProfile(player.getUniqueId(), player.getName());
    EntityPlayer entity = new EntityPlayer(minecraftserver, minecraftserver.getWorldServer(World.OVERWORLD), gameprofile, new PlayerInteractManager(minecraftserver.getWorldServer(World.OVERWORLD)));
    final Player target = entity.getBukkitEntity();
    if (target != null)
        target.loadData();
    return target;
}
Also used : EntityPlayer(net.minecraft.server.v1_16_R2.EntityPlayer) Player(org.bukkit.entity.Player) OfflinePlayer(org.bukkit.OfflinePlayer) GameProfile(com.mojang.authlib.GameProfile) PlayerInteractManager(net.minecraft.server.v1_16_R2.PlayerInteractManager) EntityPlayer(net.minecraft.server.v1_16_R2.EntityPlayer) MinecraftServer(net.minecraft.server.v1_16_R2.MinecraftServer)

Example 20 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project CoordsOffline by elliotnash.

the class v1_16_R3 method loadOfflinePlayer.

public Player loadOfflinePlayer(OfflinePlayer player) {
    MinecraftServer minecraftserver = MinecraftServer.getServer();
    GameProfile gameprofile = new GameProfile(player.getUniqueId(), player.getName());
    EntityPlayer entity = new EntityPlayer(minecraftserver, minecraftserver.getWorldServer(World.OVERWORLD), gameprofile, new PlayerInteractManager(minecraftserver.getWorldServer(World.OVERWORLD)));
    final Player target = entity.getBukkitEntity();
    if (target != null)
        target.loadData();
    return target;
}
Also used : EntityPlayer(net.minecraft.server.v1_16_R3.EntityPlayer) Player(org.bukkit.entity.Player) OfflinePlayer(org.bukkit.OfflinePlayer) GameProfile(com.mojang.authlib.GameProfile) PlayerInteractManager(net.minecraft.server.v1_16_R3.PlayerInteractManager) EntityPlayer(net.minecraft.server.v1_16_R3.EntityPlayer) MinecraftServer(net.minecraft.server.v1_16_R3.MinecraftServer)

Aggregations

Player (org.bukkit.entity.Player)65 EntityPlayer (net.minecraft.server.v1_8_R3.EntityPlayer)26 EntityPlayer (net.minecraft.server.v1_12_R1.EntityPlayer)24 EntityPlayer (net.minecraft.server.v1_16_R3.EntityPlayer)23 EntityPlayer (net.minecraft.server.v1_10_R1.EntityPlayer)20 EntityPlayer (net.minecraft.server.v1_11_R1.EntityPlayer)20 NPCHolder (net.citizensnpcs.npc.ai.NPCHolder)19 SkinnableEntity (net.citizensnpcs.npc.skin.SkinnableEntity)19 EntityPlayer (net.minecraft.server.v1_13_R2.EntityPlayer)19 EntityPlayer (net.minecraft.server.v1_15_R1.EntityPlayer)18 CraftPlayer (org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer)17 GameProfile (com.mojang.authlib.GameProfile)16 MyPet (de.Keyle.MyPet.api.entity.MyPet)16 EntityPlayer (net.minecraft.server.v1_14_R1.EntityPlayer)16 OfflinePlayer (org.bukkit.OfflinePlayer)15 CraftPlayer (org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)15 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)15 EntityPlayer (net.minecraft.server.v1_9_R2.EntityPlayer)13 CraftPlayer (org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)13 CraftPlayer (org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer)13