1212import net .minecraft .block .state .IBlockState ;
1313import net .minecraft .client .resources .I18n ;
1414import net .minecraft .client .util .ITooltipFlag ;
15+ import net .minecraft .enchantment .Enchantment ;
16+ import net .minecraft .enchantment .EnchantmentHelper ;
1517import net .minecraft .entity .EntityLiving ;
1618import net .minecraft .entity .EntityLivingBase ;
1719import net .minecraft .entity .SharedMonsterAttributes ;
@@ -41,12 +43,12 @@ public class MoCItemWeapon extends MoCItem {
4143 private final float attackDamage ;
4244 private int specialWeaponType = 0 ;
4345
44- public MoCItemWeapon (String name , Item .ToolMaterial par2ToolMaterial ) {
46+ public MoCItemWeapon (String name , Item .ToolMaterial material ) {
4547 super (name );
46- this .material = par2ToolMaterial ;
48+ this .material = material ;
4749 this .maxStackSize = 1 ;
48- this .setMaxDamage (par2ToolMaterial .getMaxUses ());
49- this .attackDamage = 3F + par2ToolMaterial .getAttackDamage ();
50+ this .setMaxDamage (material .getMaxUses ());
51+ this .attackDamage = 3F + material .getAttackDamage ();
5052 }
5153
5254 public MoCItemWeapon (String name , ToolMaterial par2ToolMaterial , int damageType ) {
@@ -71,15 +73,18 @@ public float getStrVsBlock(ItemStack stack, IBlockState state) {
7173 public boolean hitEntity (ItemStack stack , EntityLivingBase target , EntityLivingBase attacker ) {
7274 if (MoCreatures .proxy .weaponEffects ) {
7375 int timer = 15 ; // In seconds
76+ int fire_aspect = 5 * EnchantmentHelper .getFireAspectModifier (attacker ); // Fire Aspect
77+ int poisonous = 5 * EnchantmentHelper .getEnchantmentLevel (Enchantment .getEnchantmentByLocation ("mod_lavacow:poisonous" ), attacker .getHeldItem (attacker .getActiveHand ())); // Poisonous (Fish's Undead Rising)
78+
7479 switch (this .specialWeaponType ) {
7580 case 1 : // Poison 2
76- target .addPotionEffect (new PotionEffect (MobEffects .POISON , timer * 20 , 1 ));
81+ target .addPotionEffect (new PotionEffect (MobEffects .POISON , ( timer * 20 ) + poisonous , 1 ));
7782 break ;
7883 case 2 : // Slowness
7984 target .addPotionEffect (new PotionEffect (MobEffects .SLOWNESS , timer * 20 , 0 ));
8085 break ;
8186 case 3 : // Fire
82- target .setFire (timer );
87+ target .setFire (timer + fire_aspect );
8388 break ;
8489 case 4 : // Weakness (Nausea for players)
8590 target .addPotionEffect (new PotionEffect (target instanceof EntityPlayer ? MobEffects .NAUSEA : MobEffects .WEAKNESS , timer * 20 , 0 ));
@@ -164,6 +169,7 @@ public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) {
164169 */
165170 public Multimap <String , AttributeModifier > getItemAttributeModifiers (EntityEquipmentSlot equipmentSlot ) {
166171 Multimap <String , AttributeModifier > multimap = super .getItemAttributeModifiers (equipmentSlot );
172+
167173 if (equipmentSlot == EntityEquipmentSlot .MAINHAND ) {
168174 multimap .put (SharedMonsterAttributes .ATTACK_DAMAGE .getName (), new AttributeModifier (ATTACK_DAMAGE_MODIFIER , "Weapon modifier" , this .attackDamage , 0 ));
169175 }
@@ -172,7 +178,7 @@ public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquip
172178
173179 @ Override
174180 @ SideOnly (Side .CLIENT )
175- public void addInformation (ItemStack stack , @ Nullable World worldIn , List <String > tooltip , ITooltipFlag flagIn ) {
181+ public void addInformation (ItemStack stack , @ Nullable World world , List <String > tooltip , ITooltipFlag flagIn ) {
176182 if (MoCreatures .proxy .weaponEffects ) {
177183 switch (this .specialWeaponType ) {
178184 case 1 : // Poison 2
0 commit comments