本文整理汇总了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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例11: init
public static void init(){
XPBONUS = new EnchantmentXPBonus("xpbonus", Enchantment.Rarity.RARE, MINE, new EntityEquipmentSlot[] {EntityEquipmentSlot.MAINHAND});
}
示例12: setItemStackToSlot
@Override
public void setItemStackToSlot(EntityEquipmentSlot slotIn, ItemStack stack) {
if (slotIn == EntityEquipmentSlot.MAINHAND) {
drone.getInv().setStackInSlot(0, stack);
}
}
示例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));
}
示例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;
}
示例15: slot
@Override
public EntityEquipmentSlot slot() {
return EntityEquipmentSlot.MAINHAND;
}