Search in sources :

Example 11 with PlayerConnection

use of net.minecraft.server.v1_15_R1.PlayerConnection in project WLib by WizardlyBump17.

the class EntityAdapter method sendPacket.

@Override
public void sendPacket(Object... packets) {
    if (!(entity instanceof Player))
        return;
    EntityPlayer player = ((CraftPlayer) entity).getHandle();
    PlayerConnection connection = player.playerConnection;
    for (Object packet : packets) {
        if (!(packet instanceof Packet))
            continue;
        connection.sendPacket(((Packet<?>) packet));
    }
}
Also used : Packet(net.minecraft.server.v1_16_R3.Packet) Player(org.bukkit.entity.Player) EntityPlayer(net.minecraft.server.v1_16_R3.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer) EntityPlayer(net.minecraft.server.v1_16_R3.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer) PlayerConnection(net.minecraft.server.v1_16_R3.PlayerConnection)

Example 12 with PlayerConnection

use of net.minecraft.server.v1_15_R1.PlayerConnection in project WLib by WizardlyBump17.

the class EntityAdapter method sendPacket.

@Override
public void sendPacket(Object... packets) {
    if (!(entity instanceof Player))
        return;
    EntityPlayer player = ((CraftPlayer) entity).getHandle();
    PlayerConnection connection = player.playerConnection;
    for (Object packet : packets) {
        if (!(packet instanceof Packet))
            continue;
        connection.sendPacket(((Packet<?>) packet));
    }
}
Also used : Packet(net.minecraft.server.v1_13_R2.Packet) CraftPlayer(org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer) Player(org.bukkit.entity.Player) EntityPlayer(net.minecraft.server.v1_13_R2.EntityPlayer) EntityPlayer(net.minecraft.server.v1_13_R2.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer) PlayerConnection(net.minecraft.server.v1_13_R2.PlayerConnection)

Aggregations

Player (org.bukkit.entity.Player)6 EntityPlayer (net.minecraft.server.v1_16_R3.EntityPlayer)3 PlayerConnection (net.minecraft.server.v1_16_R3.PlayerConnection)3 CraftPlayer (org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer)3 CraftPlayer (org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer)3 GameProfile (com.mojang.authlib.GameProfile)2 EntityPlayer (net.minecraft.server.v1_15_R1.EntityPlayer)2 PacketPlayOutEntityLook (net.minecraft.server.v1_15_R1.PacketPlayOutEntity.PacketPlayOutEntityLook)2 PlayerConnection (net.minecraft.server.v1_15_R1.PlayerConnection)2 PlayerConnection (net.minecraft.server.v1_8_R3.PlayerConnection)2 World (org.bukkit.World)2 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)2 ParallelUniverse (thpmc.engine.api.world.parallel.ParallelUniverse)2 ParallelWorld (thpmc.engine.api.world.parallel.ParallelWorld)2 Property (com.mojang.authlib.properties.Property)1 IOException (java.io.IOException)1 Socket (java.net.Socket)1 EmptyNetHandler (net.citizensnpcs.nms.v1_15_R1.network.EmptyNetHandler)1 EmptyNetworkManager (net.citizensnpcs.nms.v1_15_R1.network.EmptyNetworkManager)1 EmptySocket (net.citizensnpcs.nms.v1_15_R1.network.EmptySocket)1