2015-12-03 10:18:05 -05:00
|
|
|
package WayofTime.bloodmagic.api.livingArmour;
|
|
|
|
|
2016-03-17 13:00:44 -07:00
|
|
|
import com.google.common.collect.HashMultimap;
|
|
|
|
import com.google.common.collect.Multimap;
|
2016-04-07 14:22:45 -04:00
|
|
|
|
2016-02-11 14:10:43 -05:00
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
2015-12-03 10:18:05 -05:00
|
|
|
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2016-04-07 14:22:45 -04:00
|
|
|
import net.minecraft.item.ItemStack;
|
2015-12-03 10:18:05 -05:00
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
2016-01-06 07:13:56 -05:00
|
|
|
import net.minecraft.util.DamageSource;
|
2015-12-03 10:18:05 -05:00
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
2015-12-30 15:34:40 -05:00
|
|
|
public abstract class LivingArmourUpgrade
|
|
|
|
{
|
2017-01-02 01:18:29 -08:00
|
|
|
public static String chatBase = "chat.bloodmagic.livingArmour.upgrade.";
|
|
|
|
public static String tooltipBase = "tooltip.bloodmagic.livingArmour.upgrade.";
|
2016-01-05 10:29:50 -05:00
|
|
|
|
2016-01-01 10:34:17 +01:00
|
|
|
/**
|
|
|
|
* Upgrade level 0 is the first upgrade. Upgrade goes from 0 to getMaxTier()
|
|
|
|
* - 1.
|
|
|
|
*/
|
|
|
|
protected int level = 0;
|
2015-12-30 15:34:40 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The LivingArmourUpgrade must have a constructor that has a single integer
|
|
|
|
* parameter. Upgrades may have other constructors, but must have one of
|
|
|
|
* these.
|
|
|
|
*
|
|
|
|
* @param level
|
2016-01-02 17:56:37 -05:00
|
|
|
* The level of the upgrade
|
2015-12-30 15:34:40 -05:00
|
|
|
*/
|
|
|
|
public LivingArmourUpgrade(int level)
|
|
|
|
{
|
2016-01-04 08:55:57 -05:00
|
|
|
this.level = Math.min(level, getMaxTier() - 1);
|
2015-12-30 15:34:40 -05:00
|
|
|
}
|
|
|
|
|
2016-04-07 14:22:45 -04:00
|
|
|
public double getAdditionalDamageOnHit(double damage, EntityPlayer wearer, EntityLivingBase hitEntity, ItemStack weapon)
|
2016-04-07 15:12:57 -04:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public double getKnockbackOnHit(EntityPlayer wearer, EntityLivingBase hitEntity, ItemStack weapon)
|
2016-04-07 14:22:45 -04:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-01-06 07:13:56 -05:00
|
|
|
/**
|
2016-03-02 12:56:57 -08:00
|
|
|
* Percentage of damage blocked. This stacks multiplicities with other
|
2016-01-06 07:13:56 -05:00
|
|
|
* upgrades.
|
|
|
|
*
|
|
|
|
* @return 0 for no damage blocked, 1 for full damage blocked
|
|
|
|
*/
|
2016-02-11 14:10:43 -05:00
|
|
|
public double getArmourProtection(EntityLivingBase wearer, DamageSource source)
|
2016-01-06 07:13:56 -05:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-12-30 15:34:40 -05:00
|
|
|
public int getUpgradeLevel()
|
|
|
|
{
|
|
|
|
return this.level;
|
|
|
|
}
|
|
|
|
|
|
|
|
public abstract String getUniqueIdentifier();
|
|
|
|
|
2016-01-05 11:12:56 -05:00
|
|
|
public abstract String getUnlocalizedName();
|
|
|
|
|
2015-12-30 15:34:40 -05:00
|
|
|
public abstract int getMaxTier();
|
|
|
|
|
|
|
|
public abstract int getCostOfUpgrade();
|
|
|
|
|
2016-01-05 16:50:43 -05:00
|
|
|
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour)
|
2015-12-30 15:34:40 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public Multimap<String, AttributeModifier> getAttributeModifiers()
|
|
|
|
{
|
2016-03-02 12:56:57 -08:00
|
|
|
return HashMultimap.create();
|
2015-12-30 15:34:40 -05:00
|
|
|
}
|
|
|
|
|
2016-10-05 16:06:52 -04:00
|
|
|
public double getMiningSpeedModifier(EntityPlayer player)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2015-12-30 15:34:40 -05:00
|
|
|
public abstract void writeToNBT(NBTTagCompound tag);
|
|
|
|
|
|
|
|
public abstract void readFromNBT(NBTTagCompound tag);
|
2016-02-11 17:53:20 -05:00
|
|
|
|
|
|
|
public int getRunicShielding()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2016-09-26 06:49:44 -04:00
|
|
|
|
|
|
|
public boolean runOnClient()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2016-10-09 10:44:50 -04:00
|
|
|
|
|
|
|
public boolean isDowngrade()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2015-12-03 10:18:05 -05:00
|
|
|
}
|