Skip to content

Commit

Permalink
forgot senbon
Browse files Browse the repository at this point in the history
  • Loading branch information
sekwah41 committed Feb 28, 2016
1 parent 8a52a33 commit 2342a02
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/java/sekwah/mods/narutomod/items/ItemSenbon.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package sekwah.mods.narutomod.items;

import com.google.common.collect.Multimap;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import sekwah.mods.narutomod.NarutoMod;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
Expand All @@ -14,11 +17,16 @@
import sekwah.mods.narutomod.entitys.projectiles.EntitySenbon;

public class ItemSenbon extends Item {

private float weaponDamage;

public ItemSenbon() {
super();
this.maxStackSize = 32;
this.setMaxDamage(-1);
this.setCreativeTab(NarutoItems.ninjaWeapons);

this.weaponDamage = 1.0F;
}

@SideOnly(Side.CLIENT)
Expand Down Expand Up @@ -112,4 +120,15 @@ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, Enti
public int getItemEnchantability() {
return 1;
}


/**
* Gets a map of item attribute modifiers, used by ItemSword to increase hit damage.
*/
public Multimap getAttributeModifiers(ItemStack stack) {
Multimap multimap = super.getAttributeModifiers(stack);
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", (double) this.weaponDamage, 0));
return multimap;
}

}

0 comments on commit 2342a02

Please sign in to comment.