
* Fixed softFall / fallProtect upgrade for living armour. Previously it relied on regular armor properties, which fall damage bypasses by being marked is unblockable. Created a method subscribed to onPlayerFall which applies the damage multiplier and the fallProtect stat-tracker. Removed the armorProperties method of LivingAmourUpgradeFallProtect.java and replaced it with getDamageMultiplier. * Fixed formatting issues. [1+1 vs 1 + 1, 1.0F instead of 1.0f]
52 lines
1.3 KiB
Java
52 lines
1.3 KiB
Java
package WayofTime.bloodmagic.livingArmour.upgrade;
|
|
|
|
import WayofTime.bloodmagic.BloodMagic;
|
|
import WayofTime.bloodmagic.livingArmour.LivingArmourUpgrade;
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
import net.minecraft.util.DamageSource;
|
|
|
|
public class LivingArmourUpgradeFallProtect extends LivingArmourUpgrade {
|
|
public static final int[] costs = new int[]{2, 5, 9, 15, 25};
|
|
public static final float[] protectionLevel = new float[]{0.2F, 0.4F, 0.6F, 0.8F, 1F};
|
|
|
|
public LivingArmourUpgradeFallProtect(int level) {
|
|
super(level);
|
|
}
|
|
|
|
|
|
public float getDamageMultiplier() {
|
|
return 1 - protectionLevel[this.level];
|
|
}
|
|
|
|
@Override
|
|
public String getUniqueIdentifier() {
|
|
return BloodMagic.MODID + ".upgrade.fallProtect";
|
|
}
|
|
|
|
@Override
|
|
public int getMaxTier() {
|
|
return 5; // Set to here until I can add more upgrades to it.
|
|
}
|
|
|
|
@Override
|
|
public int getCostOfUpgrade() {
|
|
return costs[this.level];
|
|
}
|
|
|
|
@Override
|
|
public void writeToNBT(NBTTagCompound tag) {
|
|
// EMPTY
|
|
}
|
|
|
|
@Override
|
|
public void readFromNBT(NBTTagCompound tag) {
|
|
// EMPTY
|
|
}
|
|
|
|
@Override
|
|
public String getTranslationKey() {
|
|
return tooltipBase + "fallProtect";
|
|
}
|
|
}
|