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


Java EntityEquipmentSlot.MAINHAND属性代码示例

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


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

示例1: setItemStackToSlot

public void setItemStackToSlot(EntityEquipmentSlot slotIn, ItemStack stack)
{
    if (slotIn == EntityEquipmentSlot.MAINHAND)
    {
        this.playEquipSound(stack);
        this.inventory.mainInventory.set(this.inventory.currentItem, stack);
    }
    else if (slotIn == EntityEquipmentSlot.OFFHAND)
    {
        this.playEquipSound(stack);
        this.inventory.offHandInventory.set(0, stack);
    }
    else if (slotIn.getSlotType() == EntityEquipmentSlot.Type.ARMOR)
    {
        this.playEquipSound(stack);
        this.inventory.armorInventory.set(slotIn.getIndex(), stack);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:EntityPlayer.java

示例2: getAttributeModifiers

@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) {
	final Multimap<String, AttributeModifier> modifiers = super.getAttributeModifiers(slot, stack);

	if (slot == EntityEquipmentSlot.MAINHAND)
		replaceModifier(modifiers, SharedMonsterAttributes.ATTACK_SPEED, ATTACK_SPEED_MODIFIER, getSpeed());

	return modifiers;
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:9,代码来源:BaseHarshenScythe.java

示例3: getItemAttributeModifiers

public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) {
	Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);
	if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
		multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(),
				new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", -1D, 0));
		multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(),
				new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -2.0D, 0));
	}
	return multimap;
}
 
开发者ID:the-realest-stu,项目名称:Infernum,代码行数:10,代码来源:ItemSpellPage.java

示例4: getItemAttributeModifiers

public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot)
{
    Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);

    if (equipmentSlot == EntityEquipmentSlot.MAINHAND)
    {
        multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", 0.0D, 0));
        multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", (double)(this.speed - 4.0F), 0));
    }

    return multimap;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:12,代码来源:ItemHoe.java

示例5: getItemAttributeModifiers

public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot)
{
    Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);

    if (equipmentSlot == EntityEquipmentSlot.MAINHAND)
    {
        multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Tool modifier", (double)this.damageVsEntity, 0));
        multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", (double)this.attackSpeed, 0));
    }

    return multimap;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:ItemTool.java

示例6: getItemAttributeModifiers

public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) {
	Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);

	if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
		multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Tool modifier", 9, 0));
		multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", (double) -3.4F, 0));
	}

	return multimap;
}
 
开发者ID:TechReborn,项目名称:TechReborn3,代码行数:10,代码来源:ItemWoodenHammer.java

示例7: getAttributeModifiers

@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot equipmentSlot,
		ItemStack stack) {
	Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();

	if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
		multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER,
				"Weapon modifier", (double) 8.5F + this.getAttackDamage(stack), 0));
		multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(),
				new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", (double) (-3.4F + ((getEfficiency(stack) / 2.7F) * 0.125F)), 0));
	}

	return multimap;
}
 
开发者ID:the-realest-stu,项目名称:Adventurers-Toolbox,代码行数:14,代码来源:ItemATMace.java

示例8: getAttributeModifiers

@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot equipmentSlot,
		ItemStack stack) {
	Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);

	if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
		multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER,
				"Tool modifier", (double) 1.5F + this.getAttackDamage(stack), 0));
		multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(),
				new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", (double) -3.0F, 0));
	}

	return multimap;
}
 
开发者ID:the-realest-stu,项目名称:Adventurers-Toolbox,代码行数:14,代码来源:ItemATShovel.java

示例9: getAttributeModifiers

@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack)
   {
	Multimap<String, AttributeModifier> ret = HashMultimap.create();
	if (slot == EntityEquipmentSlot.MAINHAND)
       {
		ret.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Tool modifier", this.getAttackDamage(stack), 0));
		ret.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", this.getAttackSpeed(stack), 0));
       }
	
	return ret;
   }
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:12,代码来源:ItemExPWeapon.java

示例10: getAttributeModifiers

@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot equipmentSlot,
		ItemStack stack) {
	Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);

	if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
		multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER,
				"Tool modifier", (double) 6.0F + this.getAttackDamage(stack), 0));
		multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(),
				new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", (double) Math.min(-3.2F + (0.075F * getHarvestLevel(stack)), -3.0F), 0));
	}

	return multimap;
}
 
开发者ID:the-realest-stu,项目名称:Adventurers-Toolbox,代码行数:14,代码来源:ItemATAxe.java

示例11: init

public static void init(){
    XPBONUS = new EnchantmentXPBonus("xpbonus", Enchantment.Rarity.RARE, MINE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND});
}
 
开发者ID:inifire201,项目名称:MagicWinds,代码行数:3,代码来源:EnchantingHandler.java

示例12: setItemStackToSlot

@Override
public void setItemStackToSlot(EntityEquipmentSlot slotIn, ItemStack stack) {
    if (slotIn == EntityEquipmentSlot.MAINHAND) {
        drone.getInv().setStackInSlot(0, stack);
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:6,代码来源:EntityDrone.java

示例13: getItemStackFromSlot

public ItemStack getItemStackFromSlot(EntityEquipmentSlot slotIn)
{
    return slotIn == EntityEquipmentSlot.MAINHAND ? this.inventory.getCurrentItem() : (slotIn == EntityEquipmentSlot.OFFHAND ? (ItemStack)this.inventory.offHandInventory.get(0) : (slotIn.getSlotType() == EntityEquipmentSlot.Type.ARMOR ? (ItemStack)this.inventory.armorInventory.get(slotIn.getIndex()) : ItemStack.field_190927_a));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:4,代码来源:EntityPlayer.java

示例14: isItemStackInSlot

public static boolean isItemStackInSlot(EntityEquipmentSlot slotIn, ItemStack stack)
{
    EntityEquipmentSlot entityequipmentslot = getSlotForItemStack(stack);
    return entityequipmentslot == slotIn || entityequipmentslot == EntityEquipmentSlot.MAINHAND && slotIn == EntityEquipmentSlot.OFFHAND || entityequipmentslot == EntityEquipmentSlot.OFFHAND && slotIn == EntityEquipmentSlot.MAINHAND;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:5,代码来源:EntityLiving.java

示例15: slot

@Override
public EntityEquipmentSlot slot() {
    return EntityEquipmentSlot.MAINHAND;
}
 
开发者ID:Randores,项目名称:Randores2,代码行数:4,代码来源:MaterialComponent.java


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