Java Code Examples for net.minecraft.entity.player.EntityPlayer.getDataWatcher()

The following are Jave code examples for showing how to use getDataWatcher() of the net.minecraft.entity.player.EntityPlayer class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: BaseClient   File: S0CPacketSpawnPlayer.java   Source Code and License Vote up 5 votes
public S0CPacketSpawnPlayer(EntityPlayer player)
{
    this.entityId = player.getEntityId();
    this.playerId = player.getGameProfile().getId();
    this.x = MathHelper.floor_double(player.posX * 32.0D);
    this.y = MathHelper.floor_double(player.posY * 32.0D);
    this.z = MathHelper.floor_double(player.posZ * 32.0D);
    this.yaw = (byte)((int)(player.rotationYaw * 256.0F / 360.0F));
    this.pitch = (byte)((int)(player.rotationPitch * 256.0F / 360.0F));
    ItemStack itemstack = player.inventory.getCurrentItem();
    this.currentItem = itemstack == null ? 0 : Item.getIdFromItem(itemstack.getItem());
    this.watcher = player.getDataWatcher();
}
 
Example 2
Project: BaseClient   File: S0CPacketSpawnPlayer.java   Source Code and License Vote up 5 votes
public S0CPacketSpawnPlayer(EntityPlayer player)
{
    this.entityId = player.getEntityId();
    this.playerId = player.getGameProfile().getId();
    this.x = MathHelper.floor_double(player.posX * 32.0D);
    this.y = MathHelper.floor_double(player.posY * 32.0D);
    this.z = MathHelper.floor_double(player.posZ * 32.0D);
    this.yaw = (byte)((int)(player.rotationYaw * 256.0F / 360.0F));
    this.pitch = (byte)((int)(player.rotationPitch * 256.0F / 360.0F));
    ItemStack itemstack = player.inventory.getCurrentItem();
    this.currentItem = itemstack == null ? 0 : Item.getIdFromItem(itemstack.getItem());
    this.watcher = player.getDataWatcher();
}