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