Java 类net.minecraft.entity.DataWatcher 实例源码

项目:DecompiledMinecraft    文件:S0FPacketSpawnMob.java   
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.entityId = buf.readVarIntFromBuffer();
    this.type = buf.readByte() & 255;
    this.x = buf.readInt();
    this.y = buf.readInt();
    this.z = buf.readInt();
    this.yaw = buf.readByte();
    this.pitch = buf.readByte();
    this.headPitch = buf.readByte();
    this.velocityX = buf.readShort();
    this.velocityY = buf.readShort();
    this.velocityZ = buf.readShort();
    this.watcher = DataWatcher.readWatchedListFromPacketBuffer(buf);
}
项目:DecompiledMinecraft    文件:S0FPacketSpawnMob.java   
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.entityId = buf.readVarIntFromBuffer();
    this.type = buf.readByte() & 255;
    this.x = buf.readInt();
    this.y = buf.readInt();
    this.z = buf.readInt();
    this.yaw = buf.readByte();
    this.pitch = buf.readByte();
    this.headPitch = buf.readByte();
    this.velocityX = buf.readShort();
    this.velocityY = buf.readShort();
    this.velocityZ = buf.readShort();
    this.watcher = DataWatcher.readWatchedListFromPacketBuffer(buf);
}
项目:BaseClient    文件:S0FPacketSpawnMob.java   
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.entityId = buf.readVarIntFromBuffer();
    this.type = buf.readByte() & 255;
    this.x = buf.readInt();
    this.y = buf.readInt();
    this.z = buf.readInt();
    this.yaw = buf.readByte();
    this.pitch = buf.readByte();
    this.headPitch = buf.readByte();
    this.velocityX = buf.readShort();
    this.velocityY = buf.readShort();
    this.velocityZ = buf.readShort();
    this.watcher = DataWatcher.readWatchedListFromPacketBuffer(buf);
}
项目:BaseClient    文件:S0FPacketSpawnMob.java   
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.entityId = buf.readVarIntFromBuffer();
    this.type = buf.readByte() & 255;
    this.x = buf.readInt();
    this.y = buf.readInt();
    this.z = buf.readInt();
    this.yaw = buf.readByte();
    this.pitch = buf.readByte();
    this.headPitch = buf.readByte();
    this.velocityX = buf.readShort();
    this.velocityY = buf.readShort();
    this.velocityZ = buf.readShort();
    this.watcher = DataWatcher.readWatchedListFromPacketBuffer(buf);
}
项目:Resilience-Client-Source    文件:S0FPacketSpawnMob.java   
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer p_148837_1_) throws IOException
{
    this.field_149042_a = p_148837_1_.readVarIntFromBuffer();
    this.field_149040_b = p_148837_1_.readByte() & 255;
    this.field_149041_c = p_148837_1_.readInt();
    this.field_149038_d = p_148837_1_.readInt();
    this.field_149039_e = p_148837_1_.readInt();
    this.field_149048_i = p_148837_1_.readByte();
    this.field_149045_j = p_148837_1_.readByte();
    this.field_149046_k = p_148837_1_.readByte();
    this.field_149036_f = p_148837_1_.readShort();
    this.field_149037_g = p_148837_1_.readShort();
    this.field_149047_h = p_148837_1_.readShort();
    this.field_149044_m = DataWatcher.readWatchedListFromPacketBuffer(p_148837_1_);
}
项目:Cauldron    文件:S0CPacketSpawnPlayer.java   
public void readPacketData(PacketBuffer p_148837_1_) throws IOException
{
    this.field_148957_a = p_148837_1_.readVarIntFromBuffer();
    UUID uuid = UUID.fromString(p_148837_1_.readStringFromBuffer(36));
    this.field_148955_b = new GameProfile(uuid, p_148837_1_.readStringFromBuffer(16));
    int i = p_148837_1_.readVarIntFromBuffer();

    for (int j = 0; j < i; ++j)
    {
        String s = p_148837_1_.readStringFromBuffer(32767);
        String s1 = p_148837_1_.readStringFromBuffer(32767);
        String s2 = p_148837_1_.readStringFromBuffer(32767);
        this.field_148955_b.getProperties().put(s, new Property(s, s1, s2));
    }

    this.field_148956_c = p_148837_1_.readInt();
    this.field_148953_d = p_148837_1_.readInt();
    this.field_148954_e = p_148837_1_.readInt();
    this.field_148951_f = p_148837_1_.readByte();
    this.field_148952_g = p_148837_1_.readByte();
    this.field_148959_h = p_148837_1_.readShort();
    this.field_148958_j = DataWatcher.readWatchedListFromPacketBuffer(p_148837_1_);
}
项目:Cauldron    文件:S0CPacketSpawnPlayer.java   
public void readPacketData(PacketBuffer p_148837_1_) throws IOException
{
    this.field_148957_a = p_148837_1_.readVarIntFromBuffer();
    UUID uuid = UUID.fromString(p_148837_1_.readStringFromBuffer(36));
    this.field_148955_b = new GameProfile(uuid, p_148837_1_.readStringFromBuffer(16));
    int i = p_148837_1_.readVarIntFromBuffer();

    for (int j = 0; j < i; ++j)
    {
        String s = p_148837_1_.readStringFromBuffer(32767);
        String s1 = p_148837_1_.readStringFromBuffer(32767);
        String s2 = p_148837_1_.readStringFromBuffer(32767);
        this.field_148955_b.getProperties().put(s, new Property(s, s1, s2));
    }

    this.field_148956_c = p_148837_1_.readInt();
    this.field_148953_d = p_148837_1_.readInt();
    this.field_148954_e = p_148837_1_.readInt();
    this.field_148951_f = p_148837_1_.readByte();
    this.field_148952_g = p_148837_1_.readByte();
    this.field_148959_h = p_148837_1_.readShort();
    this.field_148958_j = DataWatcher.readWatchedListFromPacketBuffer(p_148837_1_);
}
项目:Protocol4    文件:SpawnPlayer_4.java   
void writeBuffer(PacketBuffer buffer) throws IOException {
    buffer.writeVarIntToBuffer(this.entityID);
    UUID uuid = this.profile.getId();
    buffer.writeStringToBuffer(uuid == null ? "" : uuid.toString());
    buffer.writeStringToBuffer(this.profile.getName());
    buffer.writeVarIntToBuffer(this.profile.getProperties().size());
    Iterator<?> iterator = this.profile.getProperties().values().iterator();

    while (iterator.hasNext()) {
        Property property = (Property) iterator.next();
        buffer.writeStringToBuffer(property.getName());
        buffer.writeStringToBuffer(property.getValue());
        buffer.writeStringToBuffer(property.getSignature());
    }

    buffer.writeInt(this.x);
    buffer.writeInt(this.y);
    buffer.writeInt(this.z);
    buffer.writeByte(this.yaw);
    buffer.writeByte(this.pitch);
    buffer.writeShort(this.item);
    DataWatcher.writeWatchedListToPacketBuffer(this.metadata, buffer);
}
项目:RuneCraftery    文件:EntityTrackerEntry.java   
private void func_111190_b() {
   DataWatcher var1 = this.field_73132_a.func_70096_w();
   if(var1.func_75684_a()) {
      this.func_73116_b(new Packet40EntityMetadata(this.field_73132_a.field_70157_k, var1, false));
   }

   if(this.field_73132_a instanceof EntityLivingBase) {
      ServersideAttributeMap var2 = (ServersideAttributeMap)((EntityLivingBase)this.field_73132_a).func_110140_aT();
      Set var3 = var2.func_111161_b();
      if(!var3.isEmpty()) {
         this.func_73116_b(new Packet44UpdateAttributes(this.field_73132_a.field_70157_k, var3));
      }

      var3.clear();
   }

}
项目:RuneCraftery    文件:Entity.java   
public Entity(World p_i1582_1_) {
   this.field_70157_k = field_70152_a++;
   this.field_70155_l = 1.0D;
   this.field_70121_D = AxisAlignedBB.func_72330_a(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
   this.field_70135_K = true;
   this.field_70130_N = 0.6F;
   this.field_70131_O = 1.8F;
   this.field_70150_b = 1;
   this.field_70146_Z = new Random();
   this.field_70174_ab = 1;
   this.field_70148_d = true;
   this.field_70180_af = new DataWatcher();
   this.field_96093_i = UUID.randomUUID();
   this.field_70168_am = EnumEntitySize.SIZE_2;
   this.field_70170_p = p_i1582_1_;
   this.func_70107_b(0.0D, 0.0D, 0.0D);
   if(p_i1582_1_ != null) {
      this.field_71093_bK = p_i1582_1_.field_73011_w.field_76574_g;
   }

   this.field_70180_af.func_75682_a(0, Byte.valueOf((byte)0));
   this.field_70180_af.func_75682_a(1, Short.valueOf((short)300));
   this.func_70088_a();
}
项目:RuneCraftery    文件:Packet24MobSpawn.java   
/**
 * Abstract. Reads the raw packet data from the data stream.
 */
public void readPacketData(DataInput par1DataInput) throws IOException
{
    this.entityId = par1DataInput.readInt();
    this.type = par1DataInput.readByte() & 255;
    this.xPosition = par1DataInput.readInt();
    this.yPosition = par1DataInput.readInt();
    this.zPosition = par1DataInput.readInt();
    this.yaw = par1DataInput.readByte();
    this.pitch = par1DataInput.readByte();
    this.headYaw = par1DataInput.readByte();
    this.velocityX = par1DataInput.readShort();
    this.velocityY = par1DataInput.readShort();
    this.velocityZ = par1DataInput.readShort();
    this.metadata = DataWatcher.readWatchableObjects(par1DataInput);
}
项目:BetterNutritionMod    文件:Packet24MobSpawn.java   
/**
 * Abstract. Reads the raw packet data from the data stream.
 */
public void readPacketData(DataInput par1DataInput) throws IOException
{
    this.entityId = par1DataInput.readInt();
    this.type = par1DataInput.readByte() & 255;
    this.xPosition = par1DataInput.readInt();
    this.yPosition = par1DataInput.readInt();
    this.zPosition = par1DataInput.readInt();
    this.yaw = par1DataInput.readByte();
    this.pitch = par1DataInput.readByte();
    this.headYaw = par1DataInput.readByte();
    this.velocityX = par1DataInput.readShort();
    this.velocityY = par1DataInput.readShort();
    this.velocityZ = par1DataInput.readShort();
    this.metadata = DataWatcher.readWatchableObjects(par1DataInput);
}
项目:DecompiledMinecraft    文件:S1CPacketEntityMetadata.java   
public S1CPacketEntityMetadata(int entityIdIn, DataWatcher p_i45217_2_, boolean p_i45217_3_)
{
    this.entityId = entityIdIn;

    if (p_i45217_3_)
    {
        this.field_149378_b = p_i45217_2_.getAllWatched();
    }
    else
    {
        this.field_149378_b = p_i45217_2_.getChanged();
    }
}
项目:DecompiledMinecraft    文件:S0CPacketSpawnPlayer.java   
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.entityId = buf.readVarIntFromBuffer();
    this.playerId = buf.readUuid();
    this.x = buf.readInt();
    this.y = buf.readInt();
    this.z = buf.readInt();
    this.yaw = buf.readByte();
    this.pitch = buf.readByte();
    this.currentItem = buf.readShort();
    this.field_148958_j = DataWatcher.readWatchedListFromPacketBuffer(buf);
}
项目:DecompiledMinecraft    文件:S0FPacketSpawnMob.java   
public List<DataWatcher.WatchableObject> func_149027_c()
{
    if (this.watcher == null)
    {
        this.watcher = this.field_149043_l.getAllWatched();
    }

    return this.watcher;
}
项目:DecompiledMinecraft    文件:S1CPacketEntityMetadata.java   
public S1CPacketEntityMetadata(int entityIdIn, DataWatcher p_i45217_2_, boolean p_i45217_3_)
{
    this.entityId = entityIdIn;

    if (p_i45217_3_)
    {
        this.field_149378_b = p_i45217_2_.getAllWatched();
    }
    else
    {
        this.field_149378_b = p_i45217_2_.getChanged();
    }
}
项目:DecompiledMinecraft    文件:S0CPacketSpawnPlayer.java   
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.entityId = buf.readVarIntFromBuffer();
    this.playerId = buf.readUuid();
    this.x = buf.readInt();
    this.y = buf.readInt();
    this.z = buf.readInt();
    this.yaw = buf.readByte();
    this.pitch = buf.readByte();
    this.currentItem = buf.readShort();
    this.field_148958_j = DataWatcher.readWatchedListFromPacketBuffer(buf);
}
项目:DecompiledMinecraft    文件:S0CPacketSpawnPlayer.java   
public List<DataWatcher.WatchableObject> func_148944_c()
{
    if (this.field_148958_j == null)
    {
        this.field_148958_j = this.watcher.getAllWatched();
    }

    return this.field_148958_j;
}
项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
/**
 * Handles the creation of a nearby player entity, sets the position and held item
 */
public void handleSpawnPlayer(S0CPacketSpawnPlayer packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    double d0 = (double)packetIn.getX() / 32.0D;
    double d1 = (double)packetIn.getY() / 32.0D;
    double d2 = (double)packetIn.getZ() / 32.0D;
    float f = (float)(packetIn.getYaw() * 360) / 256.0F;
    float f1 = (float)(packetIn.getPitch() * 360) / 256.0F;
    EntityOtherPlayerMP entityotherplayermp = new EntityOtherPlayerMP(this.gameController.theWorld, this.getPlayerInfo(packetIn.getPlayer()).getGameProfile());
    entityotherplayermp.prevPosX = entityotherplayermp.lastTickPosX = (double)(entityotherplayermp.serverPosX = packetIn.getX());
    entityotherplayermp.prevPosY = entityotherplayermp.lastTickPosY = (double)(entityotherplayermp.serverPosY = packetIn.getY());
    entityotherplayermp.prevPosZ = entityotherplayermp.lastTickPosZ = (double)(entityotherplayermp.serverPosZ = packetIn.getZ());
    int i = packetIn.getCurrentItemID();

    if (i == 0)
    {
        entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = null;
    }
    else
    {
        entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = new ItemStack(Item.getItemById(i), 1, 0);
    }

    entityotherplayermp.setPositionAndRotation(d0, d1, d2, f, f1);
    this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entityotherplayermp);
    List<DataWatcher.WatchableObject> list = packetIn.func_148944_c();

    if (list != null)
    {
        entityotherplayermp.getDataWatcher().updateWatchedObjectsFromList(list);
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
/**
 * Spawns the mob entity at the specified location, with the specified rotation, momentum and type. Updates the
 * entities Datawatchers with the entity metadata specified in the packet
 */
public void handleSpawnMob(S0FPacketSpawnMob packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    double d0 = (double)packetIn.getX() / 32.0D;
    double d1 = (double)packetIn.getY() / 32.0D;
    double d2 = (double)packetIn.getZ() / 32.0D;
    float f = (float)(packetIn.getYaw() * 360) / 256.0F;
    float f1 = (float)(packetIn.getPitch() * 360) / 256.0F;
    EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.createEntityByID(packetIn.getEntityType(), this.gameController.theWorld);
    entitylivingbase.serverPosX = packetIn.getX();
    entitylivingbase.serverPosY = packetIn.getY();
    entitylivingbase.serverPosZ = packetIn.getZ();
    entitylivingbase.renderYawOffset = entitylivingbase.rotationYawHead = (float)(packetIn.getHeadPitch() * 360) / 256.0F;
    Entity[] aentity = entitylivingbase.getParts();

    if (aentity != null)
    {
        int i = packetIn.getEntityID() - entitylivingbase.getEntityId();

        for (int j = 0; j < aentity.length; ++j)
        {
            aentity[j].setEntityId(aentity[j].getEntityId() + i);
        }
    }

    entitylivingbase.setEntityId(packetIn.getEntityID());
    entitylivingbase.setPositionAndRotation(d0, d1, d2, f, f1);
    entitylivingbase.motionX = (double)((float)packetIn.getVelocityX() / 8000.0F);
    entitylivingbase.motionY = (double)((float)packetIn.getVelocityY() / 8000.0F);
    entitylivingbase.motionZ = (double)((float)packetIn.getVelocityZ() / 8000.0F);
    this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entitylivingbase);
    List<DataWatcher.WatchableObject> list = packetIn.func_149027_c();

    if (list != null)
    {
        entitylivingbase.getDataWatcher().updateWatchedObjectsFromList(list);
    }
}
项目:BaseClient    文件:S0FPacketSpawnMob.java   
public List<DataWatcher.WatchableObject> func_149027_c()
{
    if (this.watcher == null)
    {
        this.watcher = this.field_149043_l.getAllWatched();
    }

    return this.watcher;
}
项目:BaseClient    文件:S1CPacketEntityMetadata.java   
public S1CPacketEntityMetadata(int entityIdIn, DataWatcher p_i45217_2_, boolean p_i45217_3_)
{
    this.entityId = entityIdIn;

    if (p_i45217_3_)
    {
        this.field_149378_b = p_i45217_2_.getAllWatched();
    }
    else
    {
        this.field_149378_b = p_i45217_2_.getChanged();
    }
}
项目:BaseClient    文件:S0CPacketSpawnPlayer.java   
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.entityId = buf.readVarIntFromBuffer();
    this.playerId = buf.readUuid();
    this.x = buf.readInt();
    this.y = buf.readInt();
    this.z = buf.readInt();
    this.yaw = buf.readByte();
    this.pitch = buf.readByte();
    this.currentItem = buf.readShort();
    this.field_148958_j = DataWatcher.readWatchedListFromPacketBuffer(buf);
}
项目:BaseClient    文件:S0CPacketSpawnPlayer.java   
public List<DataWatcher.WatchableObject> func_148944_c()
{
    if (this.field_148958_j == null)
    {
        this.field_148958_j = this.watcher.getAllWatched();
    }

    return this.field_148958_j;
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Handles the creation of a nearby player entity, sets the position and held item
 */
public void handleSpawnPlayer(S0CPacketSpawnPlayer packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    double d0 = (double)packetIn.getX() / 32.0D;
    double d1 = (double)packetIn.getY() / 32.0D;
    double d2 = (double)packetIn.getZ() / 32.0D;
    float f = (float)(packetIn.getYaw() * 360) / 256.0F;
    float f1 = (float)(packetIn.getPitch() * 360) / 256.0F;
    EntityOtherPlayerMP entityotherplayermp = new EntityOtherPlayerMP(this.gameController.theWorld, this.getPlayerInfo(packetIn.getPlayer()).getGameProfile());
    entityotherplayermp.prevPosX = entityotherplayermp.lastTickPosX = (double)(entityotherplayermp.serverPosX = packetIn.getX());
    entityotherplayermp.prevPosY = entityotherplayermp.lastTickPosY = (double)(entityotherplayermp.serverPosY = packetIn.getY());
    entityotherplayermp.prevPosZ = entityotherplayermp.lastTickPosZ = (double)(entityotherplayermp.serverPosZ = packetIn.getZ());
    int i = packetIn.getCurrentItemID();

    if (i == 0)
    {
        entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = null;
    }
    else
    {
        entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = new ItemStack(Item.getItemById(i), 1, 0);
    }

    entityotherplayermp.setPositionAndRotation(d0, d1, d2, f, f1);
    this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entityotherplayermp);
    List<DataWatcher.WatchableObject> list = packetIn.func_148944_c();

    if (list != null)
    {
        entityotherplayermp.getDataWatcher().updateWatchedObjectsFromList(list);
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Spawns the mob entity at the specified location, with the specified rotation, momentum and type. Updates the
 * entities Datawatchers with the entity metadata specified in the packet
 */
public void handleSpawnMob(S0FPacketSpawnMob packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    double d0 = (double)packetIn.getX() / 32.0D;
    double d1 = (double)packetIn.getY() / 32.0D;
    double d2 = (double)packetIn.getZ() / 32.0D;
    float f = (float)(packetIn.getYaw() * 360) / 256.0F;
    float f1 = (float)(packetIn.getPitch() * 360) / 256.0F;
    EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.createEntityByID(packetIn.getEntityType(), this.gameController.theWorld);
    entitylivingbase.serverPosX = packetIn.getX();
    entitylivingbase.serverPosY = packetIn.getY();
    entitylivingbase.serverPosZ = packetIn.getZ();
    entitylivingbase.renderYawOffset = entitylivingbase.rotationYawHead = (float)(packetIn.getHeadPitch() * 360) / 256.0F;
    Entity[] aentity = entitylivingbase.getParts();

    if (aentity != null)
    {
        int i = packetIn.getEntityID() - entitylivingbase.getEntityId();

        for (int j = 0; j < aentity.length; ++j)
        {
            aentity[j].setEntityId(aentity[j].getEntityId() + i);
        }
    }

    entitylivingbase.setEntityId(packetIn.getEntityID());
    entitylivingbase.setPositionAndRotation(d0, d1, d2, f, f1);
    entitylivingbase.motionX = (double)((float)packetIn.getVelocityX() / 8000.0F);
    entitylivingbase.motionY = (double)((float)packetIn.getVelocityY() / 8000.0F);
    entitylivingbase.motionZ = (double)((float)packetIn.getVelocityZ() / 8000.0F);
    this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entitylivingbase);
    List<DataWatcher.WatchableObject> list = packetIn.func_149027_c();

    if (list != null)
    {
        entitylivingbase.getDataWatcher().updateWatchedObjectsFromList(list);
    }
}
项目:BaseClient    文件:S0FPacketSpawnMob.java   
public List<DataWatcher.WatchableObject> func_149027_c()
{
    if (this.watcher == null)
    {
        this.watcher = this.field_149043_l.getAllWatched();
    }

    return this.watcher;
}
项目:BaseClient    文件:S1CPacketEntityMetadata.java   
public S1CPacketEntityMetadata(int entityIdIn, DataWatcher p_i45217_2_, boolean p_i45217_3_)
{
    this.entityId = entityIdIn;

    if (p_i45217_3_)
    {
        this.field_149378_b = p_i45217_2_.getAllWatched();
    }
    else
    {
        this.field_149378_b = p_i45217_2_.getChanged();
    }
}
项目:BaseClient    文件:S0CPacketSpawnPlayer.java   
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer buf) throws IOException
{
    this.entityId = buf.readVarIntFromBuffer();
    this.playerId = buf.readUuid();
    this.x = buf.readInt();
    this.y = buf.readInt();
    this.z = buf.readInt();
    this.yaw = buf.readByte();
    this.pitch = buf.readByte();
    this.currentItem = buf.readShort();
    this.field_148958_j = DataWatcher.readWatchedListFromPacketBuffer(buf);
}
项目:BaseClient    文件:S0CPacketSpawnPlayer.java   
public List<DataWatcher.WatchableObject> func_148944_c()
{
    if (this.field_148958_j == null)
    {
        this.field_148958_j = this.watcher.getAllWatched();
    }

    return this.field_148958_j;
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Handles the creation of a nearby player entity, sets the position and held
 * item
 */
public void handleSpawnPlayer(S0CPacketSpawnPlayer packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    double d0 = (double) packetIn.getX() / 32.0D;
    double d1 = (double) packetIn.getY() / 32.0D;
    double d2 = (double) packetIn.getZ() / 32.0D;
    float f = (float) (packetIn.getYaw() * 360) / 256.0F;
    float f1 = (float) (packetIn.getPitch() * 360) / 256.0F;
    EntityOtherPlayerMP entityotherplayermp = new EntityOtherPlayerMP(this.gameController.theWorld,
            this.getPlayerInfo(packetIn.getPlayer()).getGameProfile());
    entityotherplayermp.prevPosX = entityotherplayermp.lastTickPosX = (double) (entityotherplayermp.serverPosX = packetIn
            .getX());
    entityotherplayermp.prevPosY = entityotherplayermp.lastTickPosY = (double) (entityotherplayermp.serverPosY = packetIn
            .getY());
    entityotherplayermp.prevPosZ = entityotherplayermp.lastTickPosZ = (double) (entityotherplayermp.serverPosZ = packetIn
            .getZ());
    int i = packetIn.getCurrentItemID();

    if (i == 0) {
        entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = null;
    } else {
        entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = new ItemStack(
                Item.getItemById(i), 1, 0);
    }

    entityotherplayermp.setPositionAndRotation(d0, d1, d2, f, f1);
    this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entityotherplayermp);
    List<DataWatcher.WatchableObject> list = packetIn.func_148944_c();

    if (list != null) {
        entityotherplayermp.getDataWatcher().updateWatchedObjectsFromList(list);
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Spawns the mob entity at the specified location, with the specified rotation,
 * momentum and type. Updates the entities Datawatchers with the entity metadata
 * specified in the packet
 */
public void handleSpawnMob(S0FPacketSpawnMob packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    double d0 = (double) packetIn.getX() / 32.0D;
    double d1 = (double) packetIn.getY() / 32.0D;
    double d2 = (double) packetIn.getZ() / 32.0D;
    float f = (float) (packetIn.getYaw() * 360) / 256.0F;
    float f1 = (float) (packetIn.getPitch() * 360) / 256.0F;
    EntityLivingBase entitylivingbase = (EntityLivingBase) EntityList.createEntityByID(packetIn.getEntityType(),
            this.gameController.theWorld);
    entitylivingbase.serverPosX = packetIn.getX();
    entitylivingbase.serverPosY = packetIn.getY();
    entitylivingbase.serverPosZ = packetIn.getZ();
    entitylivingbase.renderYawOffset = entitylivingbase.rotationYawHead = (float) (packetIn.getHeadPitch() * 360)
            / 256.0F;
    Entity[] aentity = entitylivingbase.getParts();

    if (aentity != null) {
        int i = packetIn.getEntityID() - entitylivingbase.getEntityId();

        for (int j = 0; j < aentity.length; ++j) {
            aentity[j].setEntityId(aentity[j].getEntityId() + i);
        }
    }

    entitylivingbase.setEntityId(packetIn.getEntityID());
    entitylivingbase.setPositionAndRotation(d0, d1, d2, f, f1);
    entitylivingbase.motionX = (double) ((float) packetIn.getVelocityX() / 8000.0F);
    entitylivingbase.motionY = (double) ((float) packetIn.getVelocityY() / 8000.0F);
    entitylivingbase.motionZ = (double) ((float) packetIn.getVelocityZ() / 8000.0F);
    this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entitylivingbase);
    List<DataWatcher.WatchableObject> list = packetIn.func_149027_c();

    if (list != null) {
        entitylivingbase.getDataWatcher().updateWatchedObjectsFromList(list);
    }
}
项目:TRHS_Club_Mod_2016    文件:FMLMessage.java   
@Override
void fromBytes(ByteBuf dat)
{
    super.fromBytes(dat);
    modId = ByteBufUtils.readUTF8String(dat);
    modEntityTypeId = dat.readInt();
    rawX = dat.readInt();
    rawY = dat.readInt();
    rawZ = dat.readInt();
    scaledX = rawX / 32D;
    scaledY = rawY / 32D;
    scaledZ = rawZ / 32D;
    scaledYaw = dat.readByte() * 360F / 256F;
    scaledPitch = dat.readByte() * 360F / 256F;
    scaledHeadYaw = dat.readByte() * 360F / 256F;
    try
    {
        dataWatcherList = DataWatcher.func_151508_b(new PacketBuffer(dat));
    } catch (IOException e)
    {
        FMLLog.log(Level.FATAL, e, "There was a critical error decoding the datawatcher stream for a mod entity.");
        throw Throwables.propagate(e);
    }

    throwerId = dat.readInt();
    if (throwerId != 0)
    {
        speedScaledX = dat.readInt() / 8000D;
        speedScaledY = dat.readInt() / 8000D;
        speedScaledZ = dat.readInt() / 8000D;
    }
    this.dataStream = dat;
}
项目:LambdaLib    文件:EntitySyncer.java   
public EntitySyncer(Entity ent) {
    entity = ent;
    dataWatcher = RegistryUtils.getFieldInstance(Entity.class, ent, "dataWatcher", "field_70180_af");
    watchedObjects = RegistryUtils.getFieldInstance(DataWatcher.class, dataWatcher, 
            "watchedObjects", "field_75695_b");
    watched = new ArrayList<>();
}
项目:CauldronGit    文件:FMLMessage.java   
@Override
void fromBytes(ByteBuf dat)
{
    super.fromBytes(dat);
    modId = ByteBufUtils.readUTF8String(dat);
    modEntityTypeId = dat.readInt();
    rawX = dat.readInt();
    rawY = dat.readInt();
    rawZ = dat.readInt();
    scaledX = rawX / 32D;
    scaledY = rawY / 32D;
    scaledZ = rawZ / 32D;
    scaledYaw = dat.readByte() * 360F / 256F;
    scaledPitch = dat.readByte() * 360F / 256F;
    scaledHeadYaw = dat.readByte() * 360F / 256F;
    try
    {
        dataWatcherList = DataWatcher.readWatchedListFromPacketBuffer(new PacketBuffer(dat));
    } catch (IOException e)
    {
        // Sigh
    }

    throwerId = dat.readInt();
    if (throwerId != 0)
    {
        speedScaledX = dat.readInt() / 8000D;
        speedScaledY = dat.readInt() / 8000D;
        speedScaledZ = dat.readInt() / 8000D;
    }
    this.dataStream = dat;
}
项目:Resilience-Client-Source    文件:S1CPacketEntityMetadata.java   
public S1CPacketEntityMetadata(int p_i45217_1_, DataWatcher p_i45217_2_, boolean p_i45217_3_)
{
    this.field_149379_a = p_i45217_1_;

    if (p_i45217_3_)
    {
        this.field_149378_b = p_i45217_2_.getAllWatched();
    }
    else
    {
        this.field_149378_b = p_i45217_2_.getChanged();
    }
}
项目:Resilience-Client-Source    文件:S0CPacketSpawnPlayer.java   
/**
 * Reads the raw packet data from the data stream.
 */
public void readPacketData(PacketBuffer p_148837_1_) throws IOException
{
    this.field_148957_a = p_148837_1_.readVarIntFromBuffer();
    this.field_148955_b = new GameProfile(p_148837_1_.readStringFromBuffer(36), p_148837_1_.readStringFromBuffer(16));
    this.field_148956_c = p_148837_1_.readInt();
    this.field_148953_d = p_148837_1_.readInt();
    this.field_148954_e = p_148837_1_.readInt();
    this.field_148951_f = p_148837_1_.readByte();
    this.field_148952_g = p_148837_1_.readByte();
    this.field_148959_h = p_148837_1_.readShort();
    this.field_148958_j = DataWatcher.readWatchedListFromPacketBuffer(p_148837_1_);
}
项目:TheDarkEra    文件:ExtendedPlayer.java   
public void addMana(int i) {
    if (mana + i >= player.getDataWatcher().getWatchableObjectInt(DataWatcher)) {
        ExtendedPlayer.mana = player.getDataWatcher().getWatchableObjectInt(DataWatcher);
    } else {
        ExtendedPlayer.mana = ExtendedPlayer.mana + i;
    }
}
项目:SecureCraftProtect    文件:SCPInputHandler.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onKeyPressed(InputEvent.KeyInputEvent event)
{
    EntityPlayer player = Minecraft.getMinecraft().thePlayer;
    if (player != null)
    {
        DataWatcher data = player.getDataWatcher();
        if (keys[KEY_BLINK].isPressed())
        {
            data.updateObject(BLINK, 5);
            //SCP.pipe.sendTo(new SyncPlayerPropertiesPacket(player), player);
        }
        if (keys[KEY_BLINKING].isPressed())
        {
            if (data.getWatchableObjectInt(BLINKING) == FALSE)
            {
                data.updateObject(BLINKING, TRUE);
                player.addChatMessage(new ChatComponentText("Blinking enabled"));
            }
            else
            {
                data.updateObject(BLINKING, FALSE);
                data.updateObject(BLINK, MAX_BLINK);
                player.addChatMessage(new ChatComponentText("Blinking disabled"));
            }
        }
    }
}
项目:Cauldron    文件:FMLMessage.java   
@Override
void fromBytes(ByteBuf dat)
{
    super.fromBytes(dat);
    modId = ByteBufUtils.readUTF8String(dat);
    modEntityTypeId = dat.readInt();
    rawX = dat.readInt();
    rawY = dat.readInt();
    rawZ = dat.readInt();
    scaledX = rawX / 32D;
    scaledY = rawY / 32D;
    scaledZ = rawZ / 32D;
    scaledYaw = dat.readByte() * 360F / 256F;
    scaledPitch = dat.readByte() * 360F / 256F;
    scaledHeadYaw = dat.readByte() * 360F / 256F;
    try
    {
        dataWatcherList = DataWatcher.readWatchedListFromPacketBuffer(new PacketBuffer(dat));
    } catch (IOException e)
    {
        // Sigh
    }

    throwerId = dat.readInt();
    if (throwerId != 0)
    {
        speedScaledX = dat.readInt() / 8000D;
        speedScaledY = dat.readInt() / 8000D;
        speedScaledZ = dat.readInt() / 8000D;
    }
    this.dataStream = dat;
}