Java 类net.minecraft.network.play.server.SPacketEntityMetadata 实例源码

项目:Backmemed    文件:EntityTrackerEntry.java   
/**
 * Sends the entity metadata (DataWatcher) and attributes to all players tracking this entity, including the entity
 * itself if a player.
 */
private void sendMetadataToAllAssociatedPlayers()
{
    EntityDataManager entitydatamanager = this.trackedEntity.getDataManager();

    if (entitydatamanager.isDirty())
    {
        this.sendToTrackingAndSelf(new SPacketEntityMetadata(this.trackedEntity.getEntityId(), entitydatamanager, false));
    }

    if (this.trackedEntity instanceof EntityLivingBase)
    {
        AttributeMap attributemap = (AttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap();
        Set<IAttributeInstance> set = attributemap.getAttributeInstanceSet();

        if (!set.isEmpty())
        {
            this.sendToTrackingAndSelf(new SPacketEntityProperties(this.trackedEntity.getEntityId(), set));
        }

        set.clear();
    }
}
项目:CustomWorldGen    文件:EntityTrackerEntry.java   
/**
 * Sends the entity metadata (DataWatcher) and attributes to all players tracking this entity, including the entity
 * itself if a player.
 */
private void sendMetadataToAllAssociatedPlayers()
{
    EntityDataManager entitydatamanager = this.trackedEntity.getDataManager();

    if (entitydatamanager.isDirty())
    {
        this.sendToTrackingAndSelf(new SPacketEntityMetadata(this.trackedEntity.getEntityId(), entitydatamanager, false));
    }

    if (this.trackedEntity instanceof EntityLivingBase)
    {
        AttributeMap attributemap = (AttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap();
        Set<IAttributeInstance> set = attributemap.getAttributeInstanceSet();

        if (!set.isEmpty())
        {
            this.sendToTrackingAndSelf(new SPacketEntityProperties(this.trackedEntity.getEntityId(), set));
        }

        set.clear();
    }
}
项目:ExpandedRailsMod    文件:EntityTrackerEntry.java   
/**
 * Sends the entity metadata (DataWatcher) and attributes to all players tracking this entity, including the entity
 * itself if a player.
 */
private void sendMetadataToAllAssociatedPlayers()
{
    EntityDataManager entitydatamanager = this.trackedEntity.getDataManager();

    if (entitydatamanager.isDirty())
    {
        this.sendToTrackingAndSelf(new SPacketEntityMetadata(this.trackedEntity.getEntityId(), entitydatamanager, false));
    }

    if (this.trackedEntity instanceof EntityLivingBase)
    {
        AttributeMap attributemap = (AttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap();
        Set<IAttributeInstance> set = attributemap.getAttributeInstanceSet();

        if (!set.isEmpty())
        {
            this.sendToTrackingAndSelf(new SPacketEntityProperties(this.trackedEntity.getEntityId(), set));
        }

        set.clear();
    }
}
项目:Zombe-Modpack    文件:NetHandlerPlayClient.java   
/**
 * Invoked when the server registers new proximate objects in your watchlist or when objects in your watchlist have
 * changed -> Registers any changes locally
 */
public void handleEntityMetadata(SPacketEntityMetadata packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());

    if (entity != null && packetIn.getDataManagerEntries() != null)
    {
        entity.getDataManager().setEntryValues(packetIn.getDataManagerEntries());
    }
}
项目:Backmemed    文件:NetHandlerPlayClient.java   
/**
 * Invoked when the server registers new proximate objects in your watchlist or when objects in your watchlist have
 * changed -> Registers any changes locally
 */
public void handleEntityMetadata(SPacketEntityMetadata packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());

    if (entity != null && packetIn.getDataManagerEntries() != null)
    {
        entity.getDataManager().setEntryValues(packetIn.getDataManagerEntries());
    }
}
项目:CustomWorldGen    文件:NetHandlerPlayClient.java   
/**
 * Invoked when the server registers new proximate objects in your watchlist or when objects in your watchlist have
 * changed -> Registers any changes locally
 */
public void handleEntityMetadata(SPacketEntityMetadata packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());

    if (entity != null && packetIn.getDataManagerEntries() != null)
    {
        entity.getDataManager().setEntryValues(packetIn.getDataManagerEntries());
    }
}
项目:ExpandedRailsMod    文件:NetHandlerPlayClient.java   
/**
 * Invoked when the server registers new proximate objects in your watchlist or when objects in your watchlist have
 * changed -> Registers any changes locally
 */
public void handleEntityMetadata(SPacketEntityMetadata packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());

    if (entity != null && packetIn.getDataManagerEntries() != null)
    {
        entity.getDataManager().setEntryValues(packetIn.getDataManagerEntries());
    }
}
项目:Backmemed    文件:INetHandlerPlayClient.java   
/**
 * Invoked when the server registers new proximate objects in your watchlist or when objects in your watchlist have
 * changed -> Registers any changes locally
 */
void handleEntityMetadata(SPacketEntityMetadata packetIn);
项目:CustomWorldGen    文件:INetHandlerPlayClient.java   
/**
 * Invoked when the server registers new proximate objects in your watchlist or when objects in your watchlist have
 * changed -> Registers any changes locally
 */
void handleEntityMetadata(SPacketEntityMetadata packetIn);