Made all item fields final
This commit is contained in:
parent
537ccc092c
commit
24b4c4b8d1
42 changed files with 445 additions and 462 deletions
|
@ -73,7 +73,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
@Override
|
||||
public void onCreated(ItemStack stack, World world, EntityPlayer player)
|
||||
{
|
||||
if (stack != null && !world.isRemote && stack.getItem() == ModItems.livingArmourChest)
|
||||
if (stack != null && !world.isRemote && stack.getItem() == ModItems.LIVING_ARMOUR_CHEST)
|
||||
{
|
||||
Utils.setUUID(stack);
|
||||
}
|
||||
|
@ -82,12 +82,12 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type)
|
||||
{
|
||||
if (this == ModItems.livingArmourChest || this == ModItems.livingArmourHelmet || this == ModItems.livingArmourBoots)
|
||||
if (this == ModItems.LIVING_ARMOUR_CHEST || this == ModItems.LIVING_ARMOUR_HELMET || this == ModItems.LIVING_ARMOUR_BOOTS)
|
||||
{
|
||||
return "bloodmagic:models/armor/livingArmour_layer_1.png";
|
||||
}
|
||||
|
||||
if (this == ModItems.livingArmourLegs)
|
||||
if (this == ModItems.LIVING_ARMOUR_LEGS)
|
||||
{
|
||||
return "bloodmagic:models/armor/livingArmour_layer_2.png";
|
||||
} else
|
||||
|
@ -120,13 +120,13 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
double armourReduction = 0.0;
|
||||
double damageAmount = 0.25;
|
||||
|
||||
if (this == ModItems.livingArmourBoots || this == ModItems.livingArmourHelmet)
|
||||
if (this == ModItems.LIVING_ARMOUR_BOOTS || this == ModItems.LIVING_ARMOUR_HELMET)
|
||||
{
|
||||
damageAmount = 3d / 20d * 0.6;
|
||||
} else if (this == ModItems.livingArmourLegs)
|
||||
} else if (this == ModItems.LIVING_ARMOUR_LEGS)
|
||||
{
|
||||
damageAmount = 6d / 20d * 0.6;
|
||||
} else if (this == ModItems.livingArmourChest)
|
||||
} else if (this == ModItems.LIVING_ARMOUR_CHEST)
|
||||
{
|
||||
damageAmount = 0.64;
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
return new ArmorProperties(-1, 0, 0);
|
||||
}
|
||||
|
||||
if (this == ModItems.livingArmourChest)
|
||||
if (this == ModItems.LIVING_ARMOUR_CHEST)
|
||||
{
|
||||
armourReduction = 0.24 / 0.64; // This values puts it at iron level
|
||||
|
||||
|
@ -203,22 +203,22 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot)
|
||||
{
|
||||
if (armor.getItem() == ModItems.livingArmourHelmet)
|
||||
if (armor.getItem() == ModItems.LIVING_ARMOUR_HELMET)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
if (armor.getItem() == ModItems.livingArmourChest)
|
||||
if (armor.getItem() == ModItems.LIVING_ARMOUR_CHEST)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
if (armor.getItem() == ModItems.livingArmourLegs)
|
||||
if (armor.getItem() == ModItems.LIVING_ARMOUR_LEGS)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
|
||||
if (armor.getItem() == ModItems.livingArmourBoots)
|
||||
if (armor.getItem() == ModItems.LIVING_ARMOUR_BOOTS)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot)
|
||||
{
|
||||
if (this == ModItems.livingArmourChest)
|
||||
if (this == ModItems.LIVING_ARMOUR_CHEST)
|
||||
{
|
||||
if (source.isUnblockable())
|
||||
{
|
||||
|
@ -265,7 +265,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
if (!stack.hasTagCompound())
|
||||
return;
|
||||
|
||||
if (this == ModItems.livingArmourChest)
|
||||
if (this == ModItems.LIVING_ARMOUR_CHEST)
|
||||
{
|
||||
LivingArmour armour = getLivingArmourFromStack(stack);
|
||||
for (Entry<String, LivingArmourUpgrade> entry : armour.upgradeMap.entrySet())
|
||||
|
@ -312,7 +312,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
{
|
||||
super.onArmorTick(world, player, stack);
|
||||
|
||||
if (world.isRemote && this == ModItems.livingArmourChest)
|
||||
if (world.isRemote && this == ModItems.LIVING_ARMOUR_CHEST)
|
||||
{
|
||||
if (player instanceof EntityPlayerSP) //Sanity check
|
||||
{
|
||||
|
@ -365,7 +365,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
return;
|
||||
}
|
||||
|
||||
if (this == ModItems.livingArmourChest)
|
||||
if (this == ModItems.LIVING_ARMOUR_CHEST)
|
||||
{
|
||||
if (!hasLivingArmour(stack))
|
||||
{
|
||||
|
@ -386,7 +386,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
@Override
|
||||
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack)
|
||||
{
|
||||
if (this == ModItems.livingArmourChest && isEnabled(stack) && slot == EntityEquipmentSlot.CHEST)
|
||||
if (this == ModItems.LIVING_ARMOUR_CHEST && isEnabled(stack) && slot == EntityEquipmentSlot.CHEST)
|
||||
{
|
||||
LivingArmour armour = ItemLivingArmour.getLivingArmourFromStack(stack);
|
||||
|
||||
|
@ -412,11 +412,11 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
public ModelResourceLocation getModelLocation(ItemStack stack)
|
||||
{
|
||||
assert getCustomLocation() != null;
|
||||
if (stack.getItem() == ModItems.livingArmourHelmet)
|
||||
if (stack.getItem() == ModItems.LIVING_ARMOUR_HELMET)
|
||||
return new ModelResourceLocation(getCustomLocation(), "armour=head");
|
||||
else if (stack.getItem() == ModItems.livingArmourChest)
|
||||
else if (stack.getItem() == ModItems.LIVING_ARMOUR_CHEST)
|
||||
return new ModelResourceLocation(getCustomLocation(), "armour=body");
|
||||
else if (stack.getItem() == ModItems.livingArmourLegs)
|
||||
else if (stack.getItem() == ModItems.LIVING_ARMOUR_LEGS)
|
||||
return new ModelResourceLocation(getCustomLocation(), "armour=leg");
|
||||
else
|
||||
return new ModelResourceLocation(getCustomLocation(), "armour=feet");
|
||||
|
|
|
@ -66,7 +66,7 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
|
|||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type)
|
||||
{
|
||||
if (this == ModItems.sentientArmourChest || this == ModItems.sentientArmourHelmet || this == ModItems.sentientArmourBoots)
|
||||
if (this == ModItems.SENTIENT_ARMOUR_CHEST || this == ModItems.SENTIENT_ARMOUR_HELMET || this == ModItems.SENTIENT_ARMOUR_BOOTS)
|
||||
{
|
||||
switch (this.getCurrentType(stack))
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
|
|||
return "bloodmagic:models/armor/sentientArmour_layer_1.png";
|
||||
}
|
||||
|
||||
if (this == ModItems.sentientArmourLegs)
|
||||
if (this == ModItems.SENTIENT_ARMOUR_LEGS)
|
||||
{
|
||||
switch (this.getCurrentType(stack))
|
||||
{
|
||||
|
@ -161,13 +161,13 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
|
|||
double armourReduction = 0.0;
|
||||
double damageAmount = 0.25;
|
||||
|
||||
if (this == ModItems.sentientArmourBoots || this == ModItems.sentientArmourHelmet)
|
||||
if (this == ModItems.SENTIENT_ARMOUR_BOOTS || this == ModItems.SENTIENT_ARMOUR_HELMET)
|
||||
{
|
||||
damageAmount = 3d / 20d * 0.6;
|
||||
} else if (this == ModItems.sentientArmourLegs)
|
||||
} else if (this == ModItems.SENTIENT_ARMOUR_LEGS)
|
||||
{
|
||||
damageAmount = 6d / 20d * 0.6;
|
||||
} else if (this == ModItems.sentientArmourChest)
|
||||
} else if (this == ModItems.SENTIENT_ARMOUR_CHEST)
|
||||
{
|
||||
damageAmount = 0.64;
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
|
|||
return new ArmorProperties(-1, 0, 0);
|
||||
}
|
||||
|
||||
if (this == ModItems.sentientArmourChest)
|
||||
if (this == ModItems.SENTIENT_ARMOUR_CHEST)
|
||||
{
|
||||
armourReduction = 0.24 / 0.64; // This values puts it at iron level
|
||||
|
||||
|
@ -232,22 +232,22 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
|
|||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot)
|
||||
{
|
||||
if (armor.getItem() == ModItems.sentientArmourHelmet)
|
||||
if (armor.getItem() == ModItems.SENTIENT_ARMOUR_HELMET)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
if (armor.getItem() == ModItems.sentientArmourChest)
|
||||
if (armor.getItem() == ModItems.SENTIENT_ARMOUR_CHEST)
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
if (armor.getItem() == ModItems.sentientArmourLegs)
|
||||
if (armor.getItem() == ModItems.SENTIENT_ARMOUR_LEGS)
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
|
||||
if (armor.getItem() == ModItems.sentientArmourBoots)
|
||||
if (armor.getItem() == ModItems.SENTIENT_ARMOUR_BOOTS)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
@ -331,13 +331,13 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
|
|||
public ModelResourceLocation getModelLocation(ItemStack stack)
|
||||
{
|
||||
assert getCustomLocation() != null;
|
||||
EnumDemonWillType type = ((ItemSentientArmour) ModItems.sentientArmourHelmet).getCurrentType(stack);
|
||||
EnumDemonWillType type = ((ItemSentientArmour) ModItems.SENTIENT_ARMOUR_HELMET).getCurrentType(stack);
|
||||
String additional = "_" + type.getName().toLowerCase();
|
||||
if (stack.getItem() == ModItems.sentientArmourHelmet)
|
||||
if (stack.getItem() == ModItems.SENTIENT_ARMOUR_HELMET)
|
||||
return new ModelResourceLocation(getCustomLocation(), "armour=head" + additional);
|
||||
else if (stack.getItem() == ModItems.sentientArmourChest)
|
||||
else if (stack.getItem() == ModItems.SENTIENT_ARMOUR_CHEST)
|
||||
return new ModelResourceLocation(getCustomLocation(), "armour=body" + additional);
|
||||
else if (stack.getItem() == ModItems.sentientArmourLegs)
|
||||
else if (stack.getItem() == ModItems.SENTIENT_ARMOUR_LEGS)
|
||||
return new ModelResourceLocation(getCustomLocation(), "armour=leg" + additional);
|
||||
else
|
||||
return new ModelResourceLocation(getCustomLocation(), "armour=feet" + additional);
|
||||
|
@ -444,10 +444,10 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
|
|||
ItemStack bootsStack = player.getItemStackFromSlot(EntityEquipmentSlot.FEET);
|
||||
|
||||
{
|
||||
ItemStack omegaHelmetStack = ((ItemSentientArmour) ModItems.sentientArmourHelmet).getSubstituteStack(type, will, helmetStack);
|
||||
ItemStack omegaChestStack = ((ItemSentientArmour) ModItems.sentientArmourChest).getSubstituteStack(type, will, chestStack);
|
||||
ItemStack omegaLeggingsStack = ((ItemSentientArmour) ModItems.sentientArmourLegs).getSubstituteStack(type, will, leggingsStack);
|
||||
ItemStack omegaBootsStack = ((ItemSentientArmour) ModItems.sentientArmourBoots).getSubstituteStack(type, will, bootsStack);
|
||||
ItemStack omegaHelmetStack = ((ItemSentientArmour) ModItems.SENTIENT_ARMOUR_HELMET).getSubstituteStack(type, will, helmetStack);
|
||||
ItemStack omegaChestStack = ((ItemSentientArmour) ModItems.SENTIENT_ARMOUR_CHEST).getSubstituteStack(type, will, chestStack);
|
||||
ItemStack omegaLeggingsStack = ((ItemSentientArmour) ModItems.SENTIENT_ARMOUR_LEGS).getSubstituteStack(type, will, leggingsStack);
|
||||
ItemStack omegaBootsStack = ((ItemSentientArmour) ModItems.SENTIENT_ARMOUR_BOOTS).getSubstituteStack(type, will, bootsStack);
|
||||
|
||||
player.setItemStackToSlot(EntityEquipmentSlot.HEAD, omegaHelmetStack);
|
||||
player.setItemStackToSlot(EntityEquipmentSlot.CHEST, omegaChestStack);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue