Added Runic Shielding upgrade to the Living Armour.
This commit is contained in:
parent
460df89e10
commit
95354ad557
8 changed files with 225 additions and 9 deletions
|
@ -5,7 +5,6 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
|
@ -19,19 +18,21 @@ import net.minecraftforge.common.ISpecialArmor;
|
|||
import net.minecraftforge.fml.common.Optional;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import thaumcraft.api.items.IGoggles;
|
||||
import thaumcraft.api.items.IRevealer;
|
||||
import thaumcraft.api.items.IRunicArmor;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
|
||||
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import thaumcraft.api.items.IGoggles;
|
||||
import thaumcraft.api.items.IRevealer;
|
||||
|
||||
@Optional.InterfaceList({ @Optional.Interface(iface = "thaumcraft.api.items.IRevealer", modid = "Thaumcraft"), @Optional.Interface(iface = "thaumcraft.api.items.IGoggles", modid = "Thaumcraft") })
|
||||
public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IRevealer, IGoggles
|
||||
@Optional.InterfaceList({ @Optional.Interface(iface = "thaumcraft.api.items.IRevealer", modid = "Thaumcraft"), @Optional.Interface(iface = "thaumcraft.api.items.IGoggles", modid = "Thaumcraft"), @Optional.Interface(iface = "thaumcraft.api.items.IRunicArmor", modid = "Thaumcraft") })
|
||||
public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IRevealer, IGoggles, IRunicArmor
|
||||
{
|
||||
public static String[] names = { "helmet", "chest", "legs", "boots" };
|
||||
|
||||
|
@ -336,4 +337,29 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IRevea
|
|||
|
||||
return armor.upgradeMap.containsKey(Constants.Mod.MODID + ".upgrade.revealing") && LivingArmour.hasFullSet((EntityPlayer) entityLivingBase);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunicCharge(ItemStack stack)
|
||||
{
|
||||
if (this == ModItems.livingArmourChest)
|
||||
{
|
||||
stack = NBTHelper.checkNBT(stack);
|
||||
LivingArmour armour = getLivingArmour(stack);
|
||||
|
||||
int shielding = 0;
|
||||
|
||||
if (armour != null)
|
||||
{
|
||||
for (Entry<String, LivingArmourUpgrade> entry : armour.upgradeMap.entrySet())
|
||||
{
|
||||
LivingArmourUpgrade upgrade = entry.getValue();
|
||||
shielding += upgrade.getRunicShielding();
|
||||
}
|
||||
}
|
||||
|
||||
return shielding;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue