当前位置: 首页>>代码示例>>Java>>正文


Java IAttributeInstance.hasModifier方法代码示例

本文整理汇总了Java中net.minecraft.entity.ai.attributes.IAttributeInstance.hasModifier方法的典型用法代码示例。如果您正苦于以下问题:Java IAttributeInstance.hasModifier方法的具体用法?Java IAttributeInstance.hasModifier怎么用?Java IAttributeInstance.hasModifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.ai.attributes.IAttributeInstance的用法示例。


在下文中一共展示了IAttributeInstance.hasModifier方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setAttackTarget

import net.minecraft.entity.ai.attributes.IAttributeInstance; //导入方法依赖的package包/类
@Override
public void setAttackTarget(@Nullable EntityLivingBase entitylivingbaseIn) {
	if (isTamed() && entitylivingbaseIn == getOwner()) {
		return;
	}
	super.setAttackTarget(entitylivingbaseIn);
	IAttributeInstance iattributeinstance = getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED);

	if (entitylivingbaseIn == null) {
		dataManager.set(SCREAMING, Boolean.valueOf(false));
		iattributeinstance.removeModifier(ATTACKING_SPEED_BOOST);
	}
	else {
		dataManager.set(SCREAMING, Boolean.valueOf(true));
		if (isTamed() && isSitting()) {
			setSitting(false);
		}
		if (!iattributeinstance.hasModifier(ATTACKING_SPEED_BOOST)) {
			iattributeinstance.applyModifier(ATTACKING_SPEED_BOOST);
		}
	}
}
 
开发者ID:p455w0rd,项目名称:EndermanEvolution,代码行数:23,代码来源:EntityFrienderman.java

示例2: setAttackTarget

import net.minecraft.entity.ai.attributes.IAttributeInstance; //导入方法依赖的package包/类
/**
 * Sets the active target the Task system uses for tracking
 */
public void setAttackTarget(@Nullable EntityLivingBase entitylivingbaseIn)
{
    super.setAttackTarget(entitylivingbaseIn);
    IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED);

    if (entitylivingbaseIn == null)
    {
        this.targetChangeTime = 0;
        this.dataManager.set(SCREAMING, Boolean.valueOf(false));
        iattributeinstance.removeModifier(ATTACKING_SPEED_BOOST);
    }
    else
    {
        this.targetChangeTime = this.ticksExisted;
        this.dataManager.set(SCREAMING, Boolean.valueOf(true));

        if (!iattributeinstance.hasModifier(ATTACKING_SPEED_BOOST))
        {
            iattributeinstance.applyModifier(ATTACKING_SPEED_BOOST);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:EntityEnderman.java

示例3: onAdd

import net.minecraft.entity.ai.attributes.IAttributeInstance; //导入方法依赖的package包/类
@Override
public void onAdd(EntityPlayer player, int slot) {
	IAttributeInstance attributeHealth = player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH);
	AttributeModifier modifierHealth = new AttributeModifier(UUID.fromString("83cd6b7e-a838-11e7-abc4-cec278b6b50" + slot), "ringOfBloodHealth4" + slot, 4, 0).setSaved(true);
	if(!attributeHealth.hasModifier(modifierHealth))	
		attributeHealth.applyModifier(modifierHealth);
	
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:9,代码来源:RingOfBlood.java

示例4: onAdd

import net.minecraft.entity.ai.attributes.IAttributeInstance; //导入方法依赖的package包/类
@Override
public void onAdd(EntityPlayer player, int slot) {
	IAttributeInstance attributeHealth = player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH);
	AttributeModifier modifierHealth = new AttributeModifier(UUID.fromString("d20525ee-98b2-402f-b298-61bc19a9e0c5"), "elementalPendantHealth4", 4, 0).setSaved(true);
	if(!attributeHealth.hasModifier(modifierHealth))	
		attributeHealth.applyModifier(modifierHealth);
	
	IAttributeInstance attributeArmour = player.getEntityAttribute(SharedMonsterAttributes.ARMOR);
	AttributeModifier modifierArmour = new AttributeModifier(UUID.fromString("82b79e32-3c85-4132-b121-03807793338c"), "elementalPendantArmour2", 2, 0).setSaved(true);
	if(!attributeArmour.hasModifier(modifierArmour))	
		attributeArmour.applyModifier(modifierArmour);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:13,代码来源:ElementalPendant.java

示例5: onAdd

import net.minecraft.entity.ai.attributes.IAttributeInstance; //导入方法依赖的package包/类
@Override
public void onAdd(EntityPlayer player, int slot) {
	IAttributeInstance attributeHealth = player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH);
	AttributeModifier modifierHealth = new AttributeModifier(UUID.fromString("72eb8438-8f2b-11e7-bb31-be2e44b06b34"), "criminalPendantHealth6", 6, 0).setSaved(true);
	if(!attributeHealth.hasModifier(modifierHealth))	
		attributeHealth.applyModifier(modifierHealth);
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:8,代码来源:CriminalPendant.java

示例6: updateAITasks

import net.minecraft.entity.ai.attributes.IAttributeInstance; //导入方法依赖的package包/类
protected void updateAITasks()
{
    IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed);

    if (this.isAngry())
    {
        if (!this.isChild() && !iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER))
        {
            iattributeinstance.applyModifier(ATTACK_SPEED_BOOST_MODIFIER);
        }

        --this.angerLevel;
    }
    else if (iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER))
    {
        iattributeinstance.removeModifier(ATTACK_SPEED_BOOST_MODIFIER);
    }

    if (this.randomSoundDelay > 0 && --this.randomSoundDelay == 0)
    {
        this.playSound("mob.zombiepig.zpigangry", this.getSoundVolume() * 2.0F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 1.8F);
    }

    if (this.angerLevel > 0 && this.angerTargetUUID != null && this.getAITarget() == null)
    {
        EntityPlayer entityplayer = this.worldObj.getPlayerEntityByUUID(this.angerTargetUUID);
        this.setRevengeTarget(entityplayer);
        this.attackingPlayer = entityplayer;
        this.recentlyHit = this.getRevengeTimer();
    }

    super.updateAITasks();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:34,代码来源:EntityPigZombie.java

示例7: updateAITasks

import net.minecraft.entity.ai.attributes.IAttributeInstance; //导入方法依赖的package包/类
protected void updateAITasks()
{
    IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED);

    if (this.isAngry())
    {
        if (!this.isChild() && !iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER))
        {
            iattributeinstance.applyModifier(ATTACK_SPEED_BOOST_MODIFIER);
        }

        --this.angerLevel;
    }
    else if (iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER))
    {
        iattributeinstance.removeModifier(ATTACK_SPEED_BOOST_MODIFIER);
    }

    if (this.randomSoundDelay > 0 && --this.randomSoundDelay == 0)
    {
        this.playSound(SoundEvents.ENTITY_ZOMBIE_PIG_ANGRY, this.getSoundVolume() * 2.0F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 1.8F);
    }

    if (this.angerLevel > 0 && this.angerTargetUUID != null && this.getAITarget() == null)
    {
        EntityPlayer entityplayer = this.world.getPlayerEntityByUUID(this.angerTargetUUID);
        this.setRevengeTarget(entityplayer);
        this.attackingPlayer = entityplayer;
        this.recentlyHit = this.getRevengeTimer();
    }

    super.updateAITasks();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:34,代码来源:EntityPigZombie.java

示例8: updateAITasks

import net.minecraft.entity.ai.attributes.IAttributeInstance; //导入方法依赖的package包/类
protected void updateAITasks()
{
    IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED);

    if (this.isAngry())
    {
        if (!this.isChild() && !iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER))
        {
            iattributeinstance.applyModifier(ATTACK_SPEED_BOOST_MODIFIER);
        }

        --this.angerLevel;
    }
    else if (iattributeinstance.hasModifier(ATTACK_SPEED_BOOST_MODIFIER))
    {
        iattributeinstance.removeModifier(ATTACK_SPEED_BOOST_MODIFIER);
    }

    if (this.randomSoundDelay > 0 && --this.randomSoundDelay == 0)
    {
        this.playSound(SoundEvents.ENTITY_ZOMBIE_PIG_ANGRY, this.getSoundVolume() * 2.0F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 1.8F);
    }

    if (this.angerLevel > 0 && this.angerTargetUUID != null && this.getAITarget() == null)
    {
        EntityPlayer entityplayer = this.worldObj.getPlayerEntityByUUID(this.angerTargetUUID);
        this.setRevengeTarget(entityplayer);
        this.attackingPlayer = entityplayer;
        this.recentlyHit = this.getRevengeTimer();
    }

    super.updateAITasks();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:34,代码来源:EntityPigZombie.java


注:本文中的net.minecraft.entity.ai.attributes.IAttributeInstance.hasModifier方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。