BloodMagic/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeMeleeDamage.java
Nicholas Ignoffo ddaadfbe52 Swap the API packages
The new one is now built for the api jar and the old one is now internal.
It will slowly be moved around to sane places within the internal code. Most
of the features provided in the old "api" are addon specific features which
will generally rely on the main jar anyways. The new API will be specific
to compatibility features, such as blacklists, recipes, and value modification.
2018-02-05 17:04:46 -08:00

69 lines
No EOL
2.1 KiB
Java

package WayofTime.bloodmagic.livingArmour.upgrade;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.apibutnotreally.livingArmour.ILivingArmour;
import WayofTime.bloodmagic.apibutnotreally.livingArmour.LivingArmourUpgrade;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import org.apache.commons.codec.binary.StringUtils;
import java.util.UUID;
public class LivingArmourUpgradeMeleeDamage extends LivingArmourUpgrade {
public static final int[] costs = new int[]{5, 12, 20, 35, 49, 78, 110, 160, 215, 320};
public static final double[] meleeDamage = new double[]{0.5, 1, 1.5, 2, 2.5, 3, 4, 5, 6, 7};
public LivingArmourUpgradeMeleeDamage(int level) {
super(level);
}
@Override
public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) {
}
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers() {
Multimap<String, AttributeModifier> modifierMap = HashMultimap.<String, AttributeModifier>create();
String name = getUniqueIdentifier() + "-DamageModifier1";
modifierMap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "DamageModifier1", meleeDamage[this.level], 0));
return modifierMap;
}
@Override
public String getUniqueIdentifier() {
return BloodMagic.MODID + ".upgrade.meleeDamage";
}
@Override
public int getMaxTier() {
return 10;
}
@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 getUnlocalizedName() {
return tooltipBase + "meleeDamage";
}
}