Search in sources :

Example 16 with PacketPlayOutAnimation

use of net.minecraft.server.v1_9_R2.PacketPlayOutAnimation in project Citizens2 by CitizensDev.

the class PlayerlistTrackerEntry method updateLastPlayer.

public void updateLastPlayer() {
    if (lastUpdatedPlayer == null)
        return;
    final Entity tracker = getTracker(this);
    final EntityPlayer entityplayer = lastUpdatedPlayer;
    NMS.sendTabListAdd(entityplayer.getBukkitEntity(), (Player) tracker.getBukkitEntity());
    lastUpdatedPlayer = null;
    if (!Setting.DISABLE_TABLIST.asBoolean())
        return;
    Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {

        @Override
        public void run() {
            NMSImpl.sendPacket(entityplayer.getBukkitEntity(), new PacketPlayOutAnimation(tracker, 0));
            NMS.sendTabListRemove(entityplayer.getBukkitEntity(), (Player) tracker.getBukkitEntity());
        }
    }, Setting.TABLIST_REMOVE_PACKET_DELAY.asInt());
}
Also used : Entity(net.minecraft.server.v1_8_R3.Entity) Player(org.bukkit.entity.Player) EntityPlayer(net.minecraft.server.v1_8_R3.EntityPlayer) EntityPlayer(net.minecraft.server.v1_8_R3.EntityPlayer) PacketPlayOutAnimation(net.minecraft.server.v1_8_R3.PacketPlayOutAnimation)

Example 17 with PacketPlayOutAnimation

use of net.minecraft.server.v1_9_R2.PacketPlayOutAnimation in project Citizens2 by CitizensDev.

the class PlayerAnimationImpl method playDefaultAnimation.

protected static void playDefaultAnimation(EntityPlayer player, int radius, int code) {
    PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, code);
    sendPacketNearby(packet, player, radius);
}
Also used : PacketPlayOutAnimation(net.minecraft.server.v1_16_R3.PacketPlayOutAnimation)

Example 18 with PacketPlayOutAnimation

use of net.minecraft.server.v1_9_R2.PacketPlayOutAnimation in project Citizens2 by CitizensDev.

the class PlayerlistTracker method updateLastPlayer.

public void updateLastPlayer() {
    if (tracker.dead)
        return;
    final EntityPlayer entityplayer = lastUpdatedPlayer;
    if (entityplayer == null)
        return;
    NMS.sendTabListAdd(entityplayer.getBukkitEntity(), (Player) tracker.getBukkitEntity());
    if (!Setting.DISABLE_TABLIST.asBoolean())
        return;
    Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {

        @Override
        public void run() {
            NMSImpl.sendPacket(entityplayer.getBukkitEntity(), new PacketPlayOutAnimation(tracker, 0));
            NMS.sendTabListRemove(entityplayer.getBukkitEntity(), (Player) tracker.getBukkitEntity());
        }
    }, Setting.TABLIST_REMOVE_PACKET_DELAY.asInt());
}
Also used : Player(org.bukkit.entity.Player) EntityPlayer(net.minecraft.server.v1_16_R3.EntityPlayer) EntityPlayer(net.minecraft.server.v1_16_R3.EntityPlayer) PacketPlayOutAnimation(net.minecraft.server.v1_16_R3.PacketPlayOutAnimation)

Example 19 with PacketPlayOutAnimation

use of net.minecraft.server.v1_9_R2.PacketPlayOutAnimation in project DragonsOnline by UniverseCraft.

the class PlayerNPC116R3 method playAnimation.

public void playAnimation(byte animation) {
    PacketPlayOutAnimation packet = new PacketPlayOutAnimation();
    this.setField(packet, "a", handle.getId());
    this.setField(packet, "b", animation);
    this.sendPacket(packet);
}
Also used : PacketPlayOutAnimation(net.minecraft.server.v1_16_R3.PacketPlayOutAnimation)

Example 20 with PacketPlayOutAnimation

use of net.minecraft.server.v1_9_R2.PacketPlayOutAnimation in project Warlords by ebicep.

the class AbstractChainBase method onActivate.

@Override
public boolean onActivate(@Nonnull WarlordsPlayer warlordsPlayer, @Nonnull Player player) {
    int hitCounter = getHitCounterAndActivate(warlordsPlayer, player);
    if (hitCounter != 0) {
        PacketPlayOutAnimation playOutAnimation = new PacketPlayOutAnimation(((CraftPlayer) player).getHandle(), 0);
        ((CraftPlayer) player).getHandle().playerConnection.sendPacket(playOutAnimation);
        warlordsPlayer.subtractEnergy(energyCost);
        onHit(warlordsPlayer, player, hitCounter);
        return true;
    }
    return false;
}
Also used : CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer) PacketPlayOutAnimation(net.minecraft.server.v1_8_R3.PacketPlayOutAnimation)

Aggregations

PacketPlayOutAnimation (net.minecraft.server.v1_8_R3.PacketPlayOutAnimation)9 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)7 PacketPlayOutAnimation (net.minecraft.server.v1_16_R3.PacketPlayOutAnimation)4 WarlordsPlayer (com.ebicep.warlords.player.WarlordsPlayer)3 GameRunnable (com.ebicep.warlords.util.warlords.GameRunnable)3 PacketPlayOutAnimation (net.minecraft.server.v1_15_R1.PacketPlayOutAnimation)3 Location (org.bukkit.Location)3 Player (org.bukkit.entity.Player)3 ItemStack (org.bukkit.inventory.ItemStack)3 PacketPlayOutAnimation (net.minecraft.server.v1_10_R1.PacketPlayOutAnimation)2 PacketPlayOutAnimation (net.minecraft.server.v1_11_R1.PacketPlayOutAnimation)2 PacketPlayOutAnimation (net.minecraft.server.v1_12_R1.PacketPlayOutAnimation)2 PacketPlayOutAnimation (net.minecraft.server.v1_13_R2.PacketPlayOutAnimation)2 PacketPlayOutAnimation (net.minecraft.server.v1_14_R1.PacketPlayOutAnimation)2 EntityPlayer (net.minecraft.server.v1_15_R1.EntityPlayer)2 EntityPlayer (net.minecraft.server.v1_16_R3.EntityPlayer)2 EntityPlayer (net.minecraft.server.v1_8_R3.EntityPlayer)2 CraftPlayer (org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer)2 ArmorStand (org.bukkit.entity.ArmorStand)2 CooldownFilter (com.ebicep.warlords.player.cooldowns.CooldownFilter)1