use of net.minecraft.server.v1_14_R1.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();
}
}
use of net.minecraft.server.v1_14_R1.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();
}
}
use of net.minecraft.server.v1_14_R1.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);
}
}
}
use of net.minecraft.server.v1_14_R1.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;
}
use of net.minecraft.server.v1_14_R1.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;
}
Aggregations