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());
}
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);
}
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());
}
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);
}
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;
}
Aggregations