Search in sources :

Example 51 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project MechanicsMain by WeaponMechanics.

the class Scope_1_15_R1 method removeNightVision.

@Override
public void removeNightVision(Player player) {
    if (player.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
        EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
        // Simply remove the entity effect
        PacketPlayOutRemoveEntityEffect removeEntityEffect = new PacketPlayOutRemoveEntityEffect(player.getEntityId(), MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
        entityPlayer.playerConnection.sendPacket(removeEntityEffect);
        // resend the existing one
        MobEffect mobEffect = entityPlayer.getEffect(MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
        PacketPlayOutEntityEffect entityEffect = new PacketPlayOutEntityEffect(player.getEntityId(), mobEffect);
        ((CraftPlayer) player).getHandle().playerConnection.sendPacket(entityEffect);
        return;
    }
    // Simply remove the entity effect
    PacketPlayOutRemoveEntityEffect removeEntityEffect = new PacketPlayOutRemoveEntityEffect(player.getEntityId(), MobEffectList.fromId(PotionEffectType.NIGHT_VISION.getId()));
    ((CraftPlayer) player).getHandle().playerConnection.sendPacket(removeEntityEffect);
}
Also used : PacketPlayOutEntityEffect(net.minecraft.server.v1_15_R1.PacketPlayOutEntityEffect) MobEffect(net.minecraft.server.v1_15_R1.MobEffect) EntityPlayer(net.minecraft.server.v1_15_R1.EntityPlayer) PacketPlayOutRemoveEntityEffect(net.minecraft.server.v1_15_R1.PacketPlayOutRemoveEntityEffect) CraftPlayer(org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer)

Example 52 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project FunnyGuilds by FunnyGuilds.

the class V1_10R1PacketAccessor method getOrInstallChannelHandler.

@Override
public FunnyGuildsChannelHandler getOrInstallChannelHandler(Player player) {
    final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    final Channel channel = entityPlayer.playerConnection.networkManager.channel;
    final ChannelPipeline pipeline = channel.pipeline();
    return this.channelHandlerInstaller.installChannelHandlerInPipeline(pipeline);
}
Also used : Channel(io.netty.channel.Channel) EntityPlayer(net.minecraft.server.v1_10_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer) ChannelPipeline(io.netty.channel.ChannelPipeline)

Example 53 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project FunnyGuilds by FunnyGuilds.

the class V1_8R3PacketAccessor method getOrInstallChannelHandler.

@Override
public FunnyGuildsChannelHandler getOrInstallChannelHandler(Player player) {
    final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    final Channel channel = entityPlayer.playerConnection.networkManager.channel;
    final ChannelPipeline pipeline = channel.pipeline();
    return this.channelHandlerInstaller.installChannelHandlerInPipeline(pipeline);
}
Also used : Channel(io.netty.channel.Channel) EntityPlayer(net.minecraft.server.v1_8_R3.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer) ChannelPipeline(io.netty.channel.ChannelPipeline)

Example 54 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project FunnyGuilds by FunnyGuilds.

the class V1_13R2PacketAccessor method getOrInstallChannelHandler.

@Override
public FunnyGuildsChannelHandler getOrInstallChannelHandler(Player player) {
    final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    final Channel channel = entityPlayer.playerConnection.networkManager.channel;
    final ChannelPipeline pipeline = channel.pipeline();
    return this.channelHandlerInstaller.installChannelHandlerInPipeline(pipeline);
}
Also used : Channel(io.netty.channel.Channel) EntityPlayer(net.minecraft.server.v1_13_R2.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer) ChannelPipeline(io.netty.channel.ChannelPipeline)

Example 55 with EntityPlayer

use of net.minecraft.server.v1_13_R2.EntityPlayer in project FunnyGuilds by FunnyGuilds.

the class V1_14R1PacketAccessor method getOrInstallChannelHandler.

@Override
public FunnyGuildsChannelHandler getOrInstallChannelHandler(Player player) {
    final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    final Channel channel = entityPlayer.playerConnection.networkManager.channel;
    final ChannelPipeline pipeline = channel.pipeline();
    return this.channelHandlerInstaller.installChannelHandlerInPipeline(pipeline);
}
Also used : Channel(io.netty.channel.Channel) EntityPlayer(net.minecraft.server.v1_14_R1.EntityPlayer) CraftPlayer(org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer) ChannelPipeline(io.netty.channel.ChannelPipeline)

Aggregations

Player (org.bukkit.entity.Player)70 ItemStack (org.bukkit.inventory.ItemStack)46 EntityPlayer (net.minecraft.server.v1_12_R1.EntityPlayer)36 EntityPlayer (net.minecraft.server.v1_16_R3.EntityPlayer)31 EntityPlayer (net.minecraft.server.v1_8_R3.EntityPlayer)31 EntityPlayer (net.minecraft.server.v1_15_R1.EntityPlayer)26 EntityPlayer (net.minecraft.server.v1_10_R1.EntityPlayer)25 EntityPlayer (net.minecraft.server.v1_11_R1.EntityPlayer)25 EntityPlayer (net.minecraft.server.v1_13_R2.EntityPlayer)25 CraftPlayer (org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer)23 CraftPlayer (org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer)22 EntityPlayer (net.minecraft.server.v1_14_R1.EntityPlayer)21 NPCHolder (net.citizensnpcs.npc.ai.NPCHolder)19 SkinnableEntity (net.citizensnpcs.npc.skin.SkinnableEntity)19 CraftPlayer (org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer)19 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)18 GameProfile (com.mojang.authlib.GameProfile)16 MyPet (de.Keyle.MyPet.api.entity.MyPet)16 CraftPlayer (org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)16 EntityPlayer (net.minecraft.server.v1_16_R1.EntityPlayer)15