當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。