use of org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer 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 org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer in project FireAPI by FireBlade-Serv.
the class FireBossBar method gen.
public void gen(String title) {
EntityEnderDragon ew = new EntityEnderDragon(((CraftWorld) this.p.getWorld()).getHandle());
Location loc = this.p.getLocation();
ew.setInvisible(true);
ew.setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getPitch(), loc.getYaw());
ew.setCustomName(title);
PacketPlayOutSpawnEntityLiving pel = new PacketPlayOutSpawnEntityLiving(ew);
((CraftPlayer) this.p).getHandle().playerConnection.sendPacket(pel);
}
use of org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer in project FireAPI by FireBlade-Serv.
the class PingCommand method onCommand.
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player p = (Player) sender;
int ping = ((CraftPlayer) p).getHandle().ping;
p.sendMessage("§6[§ePing§6]§r Ton ping §eserveur§r est de §e" + ping + " ms§r !");
try {
c.sendPacket(new PacketPlayerPing(p.getName(), PingState.INIT_SERVER));
} catch (IOException e) {
e.printStackTrace();
}
} else {
sender.sendMessage("§6[§ePing§6]§r §cErreur, vous devez être en jeu pour pouvoir executer cette commande !");
}
return false;
}
use of org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer in project FireAPI by FireBlade-Serv.
the class FireBukkitActionBar method send.
public void send(String message) {
IChatBaseComponent cbc = ChatSerializer.a("{\"text\": \"" + message + "\"}");
PacketPlayOutChat ppoc = new PacketPlayOutChat(cbc, (byte) 2);
((CraftPlayer) this.player).getHandle().playerConnection.sendPacket(ppoc);
}
use of org.bukkit.craftbukkit.v1_4_6.entity.CraftPlayer in project Citizens2 by CitizensDev.
the class NMSImpl method sendTabListAdd.
@Override
public void sendTabListAdd(Player recipient, Player listPlayer) {
Preconditions.checkNotNull(recipient);
Preconditions.checkNotNull(listPlayer);
EntityPlayer entity = ((CraftPlayer) listPlayer).getHandle();
NMSImpl.sendPacket(recipient, new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, entity));
}
Aggregations