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

项目:DecompiledMinecraft    文件: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()
{
    DataWatcher datawatcher = this.trackedEntity.getDataWatcher();

    if (datawatcher.hasObjectChanged())
    {
        this.func_151261_b(new S1CPacketEntityMetadata(this.trackedEntity.getEntityId(), datawatcher, false));
    }

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

        if (!set.isEmpty())
        {
            this.func_151261_b(new S20PacketEntityProperties(this.trackedEntity.getEntityId(), set));
        }

        set.clear();
    }
}
项目:DecompiledMinecraft    文件: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()
{
    DataWatcher datawatcher = this.trackedEntity.getDataWatcher();

    if (datawatcher.hasObjectChanged())
    {
        this.func_151261_b(new S1CPacketEntityMetadata(this.trackedEntity.getEntityId(), datawatcher, false));
    }

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

        if (!set.isEmpty())
        {
            this.func_151261_b(new S20PacketEntityProperties(this.trackedEntity.getEntityId(), set));
        }

        set.clear();
    }
}
项目:BaseClient    文件: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()
{
    DataWatcher datawatcher = this.trackedEntity.getDataWatcher();

    if (datawatcher.hasObjectChanged())
    {
        this.func_151261_b(new S1CPacketEntityMetadata(this.trackedEntity.getEntityId(), datawatcher, false));
    }

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

        if (!set.isEmpty())
        {
            this.func_151261_b(new S20PacketEntityProperties(this.trackedEntity.getEntityId(), set));
        }

        set.clear();
    }
}
项目:BaseClient    文件: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()
{
    DataWatcher datawatcher = this.trackedEntity.getDataWatcher();

    if (datawatcher.hasObjectChanged())
    {
        this.func_151261_b(new S1CPacketEntityMetadata(this.trackedEntity.getEntityId(), datawatcher, false));
    }

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

        if (!set.isEmpty())
        {
            this.func_151261_b(new S20PacketEntityProperties(this.trackedEntity.getEntityId(), set));
        }

        set.clear();
    }
}
项目:Resilience-Client-Source    文件:EntityTrackerEntry.java   
private void func_111190_b()
{
    DataWatcher var1 = this.myEntity.getDataWatcher();

    if (var1.hasChanges())
    {
        this.func_151261_b(new S1CPacketEntityMetadata(this.myEntity.getEntityId(), var1, false));
    }

    if (this.myEntity instanceof EntityLivingBase)
    {
        ServersideAttributeMap var2 = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap();
        Set var3 = var2.getAttributeInstanceSet();

        if (!var3.isEmpty())
        {
            this.func_151261_b(new S20PacketEntityProperties(this.myEntity.getEntityId(), var3));
        }

        var3.clear();
    }
}
项目:Cauldron    文件:EntityTrackerEntry.java   
private void sendMetadataToAllAssociatedPlayers()
{
    DataWatcher datawatcher = this.myEntity.getDataWatcher();

    if (datawatcher.hasChanges())
    {
        this.func_151261_b(new S1CPacketEntityMetadata(this.myEntity.getEntityId(), datawatcher, false));
    }

    if (this.myEntity instanceof EntityLivingBase)
    {
        ServersideAttributeMap serversideattributemap = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap();
        Set set = serversideattributemap.getAttributeInstanceSet();

        if (!set.isEmpty())
        {
            this.func_151261_b(new S20PacketEntityProperties(this.myEntity.getEntityId(), set));
        }

        set.clear();
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
/**
 * Updates en entity's attributes and their respective modifiers, which are used for speed bonusses (player
 * sprinting, animals fleeing, baby speed), weapon/tool attackDamage, hostiles followRange randomization, zombie
 * maxHealth and knockback resistance as well as reinforcement spawning chance.
 */
public void handleEntityProperties(S20PacketEntityProperties packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());

    if (entity != null)
    {
        if (!(entity instanceof EntityLivingBase))
        {
            throw new IllegalStateException("Server tried to update attributes of a non-living entity (actually: " + entity + ")");
        }
        else
        {
            BaseAttributeMap baseattributemap = ((EntityLivingBase)entity).getAttributeMap();

            for (S20PacketEntityProperties.Snapshot s20packetentityproperties$snapshot : packetIn.func_149441_d())
            {
                IAttributeInstance iattributeinstance = baseattributemap.getAttributeInstanceByName(s20packetentityproperties$snapshot.func_151409_a());

                if (iattributeinstance == null)
                {
                    iattributeinstance = baseattributemap.registerAttribute(new RangedAttribute((IAttribute)null, s20packetentityproperties$snapshot.func_151409_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE));
                }

                iattributeinstance.setBaseValue(s20packetentityproperties$snapshot.func_151410_b());
                iattributeinstance.removeAllModifiers();

                for (AttributeModifier attributemodifier : s20packetentityproperties$snapshot.func_151408_c())
                {
                    iattributeinstance.applyModifier(attributemodifier);
                }
            }
        }
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Updates en entity's attributes and their respective modifiers, which are used for speed bonusses (player
 * sprinting, animals fleeing, baby speed), weapon/tool attackDamage, hostiles followRange randomization, zombie
 * maxHealth and knockback resistance as well as reinforcement spawning chance.
 */
public void handleEntityProperties(S20PacketEntityProperties packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());

    if (entity != null)
    {
        if (!(entity instanceof EntityLivingBase))
        {
            throw new IllegalStateException("Server tried to update attributes of a non-living entity (actually: " + entity + ")");
        }
        else
        {
            BaseAttributeMap baseattributemap = ((EntityLivingBase)entity).getAttributeMap();

            for (S20PacketEntityProperties.Snapshot s20packetentityproperties$snapshot : packetIn.func_149441_d())
            {
                IAttributeInstance iattributeinstance = baseattributemap.getAttributeInstanceByName(s20packetentityproperties$snapshot.func_151409_a());

                if (iattributeinstance == null)
                {
                    iattributeinstance = baseattributemap.registerAttribute(new RangedAttribute((IAttribute)null, s20packetentityproperties$snapshot.func_151409_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE));
                }

                iattributeinstance.setBaseValue(s20packetentityproperties$snapshot.func_151410_b());
                iattributeinstance.removeAllModifiers();

                for (AttributeModifier attributemodifier : s20packetentityproperties$snapshot.func_151408_c())
                {
                    iattributeinstance.applyModifier(attributemodifier);
                }
            }
        }
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * Updates en entity's attributes and their respective modifiers, which are used
 * for speed bonusses (player sprinting, animals fleeing, baby speed),
 * weapon/tool attackDamage, hostiles followRange randomization, zombie
 * maxHealth and knockback resistance as well as reinforcement spawning chance.
 */
public void handleEntityProperties(S20PacketEntityProperties packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());

    if (entity != null) {
        if (!(entity instanceof EntityLivingBase)) {
            throw new IllegalStateException(
                    "Server tried to update attributes of a non-living entity (actually: " + entity + ")");
        } else {
            BaseAttributeMap baseattributemap = ((EntityLivingBase) entity).getAttributeMap();

            for (S20PacketEntityProperties.Snapshot s20packetentityproperties$snapshot : packetIn.func_149441_d()) {
                IAttributeInstance iattributeinstance = baseattributemap
                        .getAttributeInstanceByName(s20packetentityproperties$snapshot.func_151409_a());

                if (iattributeinstance == null) {
                    iattributeinstance = baseattributemap.registerAttribute(new RangedAttribute((IAttribute) null,
                            s20packetentityproperties$snapshot.func_151409_a(), 0.0D, 2.2250738585072014E-308D,
                            Double.MAX_VALUE));
                }

                iattributeinstance.setBaseValue(s20packetentityproperties$snapshot.func_151410_b());
                iattributeinstance.removeAllModifiers();

                for (AttributeModifier attributemodifier : s20packetentityproperties$snapshot.func_151408_c()) {
                    iattributeinstance.applyModifier(attributemodifier);
                }
            }
        }
    }
}
项目:Resilience-Client-Source    文件:NetHandlerPlayClient.java   
/**
 * Updates en entity's attributes and their respective modifiers, which are used for speed bonusses (player
 * sprinting, animals fleeing, baby speed), weapon/tool attackDamage, hostiles followRange randomization, zombie
 * maxHealth and knockback resistance as well as reinforcement spawning chance.
 */
public void handleEntityProperties(S20PacketEntityProperties p_147290_1_)
{
    Entity var2 = this.clientWorldController.getEntityByID(p_147290_1_.func_149442_c());

    if (var2 != null)
    {
        if (!(var2 instanceof EntityLivingBase))
        {
            throw new IllegalStateException("Server tried to update attributes of a non-living entity (actually: " + var2 + ")");
        }
        else
        {
            BaseAttributeMap var3 = ((EntityLivingBase)var2).getAttributeMap();
            Iterator var4 = p_147290_1_.func_149441_d().iterator();

            while (var4.hasNext())
            {
                S20PacketEntityProperties.Snapshot var5 = (S20PacketEntityProperties.Snapshot)var4.next();
                IAttributeInstance var6 = var3.getAttributeInstanceByName(var5.func_151409_a());

                if (var6 == null)
                {
                    var6 = var3.registerAttribute(new RangedAttribute(var5.func_151409_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE));
                }

                var6.setBaseValue(var5.func_151410_b());
                var6.removeAllModifiers();
                Iterator var7 = var5.func_151408_c().iterator();

                while (var7.hasNext())
                {
                    AttributeModifier var8 = (AttributeModifier)var7.next();
                    var6.applyModifier(var8);
                }
            }
        }
    }
}
项目:Cauldron    文件:EntityTrackerEntry.java   
private void sendMetadataToAllAssociatedPlayers()
{
    DataWatcher datawatcher = this.myEntity.getDataWatcher();

    if (datawatcher.hasChanges())
    {
        this.func_151261_b(new S1CPacketEntityMetadata(this.myEntity.getEntityId(), datawatcher, false));
    }

    if (this.myEntity instanceof EntityLivingBase)
    {
        ServersideAttributeMap serversideattributemap = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap();
        Set set = serversideattributemap.getAttributeInstanceSet();

        if (!set.isEmpty())
        {
            // CraftBukkit start - Send scaled max health
            if (this.myEntity instanceof EntityPlayerMP)
            {
                ((EntityPlayerMP) this.myEntity).getBukkitEntity().injectScaledMaxHealth(set, false);
            }

            // CraftBukkit end
            this.func_151261_b(new S20PacketEntityProperties(this.myEntity.getEntityId(), set));
        }

        set.clear();
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleEntityProperties(S20PacketEntityProperties p_147290_1_)
{
    Entity entity = this.clientWorldController.getEntityByID(p_147290_1_.func_149442_c());

    if (entity != null)
    {
        if (!(entity instanceof EntityLivingBase))
        {
            throw new IllegalStateException("Server tried to update attributes of a non-living entity (actually: " + entity + ")");
        }
        else
        {
            BaseAttributeMap baseattributemap = ((EntityLivingBase)entity).getAttributeMap();
            Iterator iterator = p_147290_1_.func_149441_d().iterator();

            while (iterator.hasNext())
            {
                S20PacketEntityProperties.Snapshot snapshot = (S20PacketEntityProperties.Snapshot)iterator.next();
                IAttributeInstance iattributeinstance = baseattributemap.getAttributeInstanceByName(snapshot.func_151409_a());

                if (iattributeinstance == null)
                {
                    iattributeinstance = baseattributemap.registerAttribute(new RangedAttribute(snapshot.func_151409_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE));
                }

                iattributeinstance.setBaseValue(snapshot.func_151410_b());
                iattributeinstance.removeAllModifiers();
                Iterator iterator1 = snapshot.func_151408_c().iterator();

                while (iterator1.hasNext())
                {
                    AttributeModifier attributemodifier = (AttributeModifier)iterator1.next();
                    iattributeinstance.applyModifier(attributemodifier);
                }
            }
        }
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleEntityProperties(S20PacketEntityProperties p_147290_1_)
{
    Entity entity = this.clientWorldController.getEntityByID(p_147290_1_.func_149442_c());

    if (entity != null)
    {
        if (!(entity instanceof EntityLivingBase))
        {
            throw new IllegalStateException("Server tried to update attributes of a non-living entity (actually: " + entity + ")");
        }
        else
        {
            BaseAttributeMap baseattributemap = ((EntityLivingBase)entity).getAttributeMap();
            Iterator iterator = p_147290_1_.func_149441_d().iterator();

            while (iterator.hasNext())
            {
                S20PacketEntityProperties.Snapshot snapshot = (S20PacketEntityProperties.Snapshot)iterator.next();
                IAttributeInstance iattributeinstance = baseattributemap.getAttributeInstanceByName(snapshot.func_151409_a());

                if (iattributeinstance == null)
                {
                    iattributeinstance = baseattributemap.registerAttribute(new RangedAttribute(snapshot.func_151409_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE));
                }

                iattributeinstance.setBaseValue(snapshot.func_151410_b());
                iattributeinstance.removeAllModifiers();
                Iterator iterator1 = snapshot.func_151408_c().iterator();

                while (iterator1.hasNext())
                {
                    AttributeModifier attributemodifier = (AttributeModifier)iterator1.next();
                    iattributeinstance.applyModifier(attributemodifier);
                }
            }
        }
    }
}
项目:DecompiledMinecraft    文件:INetHandlerPlayClient.java   
/**
 * Updates en entity's attributes and their respective modifiers, which are used for speed bonusses (player
 * sprinting, animals fleeing, baby speed), weapon/tool attackDamage, hostiles followRange randomization, zombie
 * maxHealth and knockback resistance as well as reinforcement spawning chance.
 */
void handleEntityProperties(S20PacketEntityProperties packetIn);
项目:DecompiledMinecraft    文件:INetHandlerPlayClient.java   
/**
 * Updates en entity's attributes and their respective modifiers, which are used for speed bonusses (player
 * sprinting, animals fleeing, baby speed), weapon/tool attackDamage, hostiles followRange randomization, zombie
 * maxHealth and knockback resistance as well as reinforcement spawning chance.
 */
void handleEntityProperties(S20PacketEntityProperties packetIn);
项目:BaseClient    文件:INetHandlerPlayClient.java   
/**
 * Updates en entity's attributes and their respective modifiers, which are used for speed bonusses (player
 * sprinting, animals fleeing, baby speed), weapon/tool attackDamage, hostiles followRange randomization, zombie
 * maxHealth and knockback resistance as well as reinforcement spawning chance.
 */
void handleEntityProperties(S20PacketEntityProperties packetIn);
项目:BaseClient    文件:INetHandlerPlayClient.java   
/**
 * Updates en entity's attributes and their respective modifiers, which are used for speed bonusses (player
 * sprinting, animals fleeing, baby speed), weapon/tool attackDamage, hostiles followRange randomization, zombie
 * maxHealth and knockback resistance as well as reinforcement spawning chance.
 */
void handleEntityProperties(S20PacketEntityProperties packetIn);
项目:Resilience-Client-Source    文件:INetHandlerPlayClient.java   
/**
 * Updates en entity's attributes and their respective modifiers, which are used for speed bonusses (player
 * sprinting, animals fleeing, baby speed), weapon/tool attackDamage, hostiles followRange randomization, zombie
 * maxHealth and knockback resistance as well as reinforcement spawning chance.
 */
void handleEntityProperties(S20PacketEntityProperties var1);
项目:Cauldron    文件:INetHandlerPlayClient.java   
void handleEntityProperties(S20PacketEntityProperties p_147290_1_);
项目:Cauldron    文件:INetHandlerPlayClient.java   
void handleEntityProperties(S20PacketEntityProperties p_147290_1_);