Added the unlocalized name to upgrades, and changed it so the armour lists the upgrades.
This commit is contained in:
parent
f4abee84ef
commit
dceec15750
|
@ -12,6 +12,7 @@ import com.google.common.collect.Multimap;
|
||||||
public abstract class LivingArmourUpgrade
|
public abstract class LivingArmourUpgrade
|
||||||
{
|
{
|
||||||
public static String chatBase = "chat.BloodMagic.livingArmour.upgrade.";
|
public static String chatBase = "chat.BloodMagic.livingArmour.upgrade.";
|
||||||
|
public static String tooltipBase = "tooltip.BloodMagic.livingArmour.upgrade.";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Upgrade level 0 is the first upgrade. Upgrade goes from 0 to getMaxTier()
|
* Upgrade level 0 is the first upgrade. Upgrade goes from 0 to getMaxTier()
|
||||||
|
@ -39,6 +40,8 @@ public abstract class LivingArmourUpgrade
|
||||||
|
|
||||||
public abstract String getUniqueIdentifier();
|
public abstract String getUniqueIdentifier();
|
||||||
|
|
||||||
|
public abstract String getUnlocalizedName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package WayofTime.bloodmagic.item.armour;
|
package WayofTime.bloodmagic.item.armour;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||||
|
@ -10,10 +12,14 @@ import net.minecraft.item.ItemArmor;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import WayofTime.bloodmagic.BloodMagic;
|
import WayofTime.bloodmagic.BloodMagic;
|
||||||
import WayofTime.bloodmagic.api.Constants;
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
|
import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
|
||||||
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
||||||
import WayofTime.bloodmagic.registry.ModItems;
|
import WayofTime.bloodmagic.registry.ModItems;
|
||||||
|
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
|
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
|
|
||||||
|
@ -32,6 +38,26 @@ public class ItemLivingArmour extends ItemArmor
|
||||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
||||||
|
{
|
||||||
|
if (this == ModItems.livingArmourChest)
|
||||||
|
{
|
||||||
|
LivingArmour armour = this.getLivingArmour(stack);
|
||||||
|
for (Entry<String, LivingArmourUpgrade> entry : armour.upgradeMap.entrySet())
|
||||||
|
{
|
||||||
|
LivingArmourUpgrade upgrade = entry.getValue();
|
||||||
|
if (upgrade != null)
|
||||||
|
{
|
||||||
|
tooltip.add(TextHelper.localize(upgrade.getUnlocalizedName()) + " " + TextHelper.localize("tooltip.BloodMagic.livingArmour.upgrade.level", (upgrade.getUpgradeLevel() + 1)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
super.addInformation(stack, player, tooltip, advanced);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
|
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
|
||||||
{
|
{
|
||||||
|
@ -103,7 +129,6 @@ public class ItemLivingArmour extends ItemArmor
|
||||||
|
|
||||||
public void setLivingArmour(ItemStack stack, LivingArmour armour, boolean forceWrite)
|
public void setLivingArmour(ItemStack stack, LivingArmour armour, boolean forceWrite)
|
||||||
{
|
{
|
||||||
|
|
||||||
NBTTagCompound livingTag = new NBTTagCompound();
|
NBTTagCompound livingTag = new NBTTagCompound();
|
||||||
|
|
||||||
if (!forceWrite)
|
if (!forceWrite)
|
||||||
|
@ -140,4 +165,24 @@ public class ItemLivingArmour extends ItemArmor
|
||||||
|
|
||||||
tag.setTag(Constants.NBT.LIVING_ARMOUR, livingTag);
|
tag.setTag(Constants.NBT.LIVING_ARMOUR, livingTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LivingArmourUpgrade getUpgrade(String uniqueIdentifier, ItemStack stack)
|
||||||
|
{
|
||||||
|
if (!armourMap.containsKey(stack))
|
||||||
|
{
|
||||||
|
armourMap.put(stack, getLivingArmour(stack));
|
||||||
|
}
|
||||||
|
|
||||||
|
LivingArmour armour = armourMap.get(stack);
|
||||||
|
|
||||||
|
for (Entry<String, LivingArmourUpgrade> entry : armour.upgradeMap.entrySet())
|
||||||
|
{
|
||||||
|
if (entry.getKey().equals(uniqueIdentifier))
|
||||||
|
{
|
||||||
|
return entry.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,4 +74,10 @@ public class LivingArmourUpgradeDigging extends LivingArmourUpgrade
|
||||||
{
|
{
|
||||||
// EMPTY
|
// EMPTY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName()
|
||||||
|
{
|
||||||
|
return tooltipBase + "digging";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,4 +71,10 @@ public class LivingArmourUpgradePoisonResist extends LivingArmourUpgrade
|
||||||
{
|
{
|
||||||
poisonCooldown = tag.getInteger(Constants.NBT.UPGRADE_POISON_TIMER);
|
poisonCooldown = tag.getInteger(Constants.NBT.UPGRADE_POISON_TIMER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName()
|
||||||
|
{
|
||||||
|
return tooltipBase + "poisonResist";
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -90,4 +90,10 @@ public class LivingArmourUpgradeSpeed extends LivingArmourUpgrade
|
||||||
{
|
{
|
||||||
// EMPTY
|
// EMPTY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName()
|
||||||
|
{
|
||||||
|
return tooltipBase + "speed";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,6 +223,11 @@ tooltip.BloodMagic.telepositionFocus.enhanced=Used to move blocks in the world
|
||||||
tooltip.BloodMagic.telepositionFocus.reinforced=Used to move blocks in the world
|
tooltip.BloodMagic.telepositionFocus.reinforced=Used to move blocks in the world
|
||||||
tooltip.BloodMagic.telepositionFocus.demonic=Used to move blocks in the world
|
tooltip.BloodMagic.telepositionFocus.demonic=Used to move blocks in the world
|
||||||
|
|
||||||
|
tooltip.BloodMagic.livingArmour.upgrade.speed=Quick Feet
|
||||||
|
tooltip.BloodMagic.livingArmour.upgrade.digging=Dwarven Might
|
||||||
|
tooltip.BloodMagic.livingArmour.upgrade.poisonResist=Poison Resistance
|
||||||
|
tooltip.BloodMagic.livingArmour.upgrade.level=(Level %d)
|
||||||
|
|
||||||
# Ritual
|
# Ritual
|
||||||
ritual.BloodMagic.testRitual=Test Ritual
|
ritual.BloodMagic.testRitual=Test Ritual
|
||||||
ritual.BloodMagic.waterRitual=Ritual of the Full Spring
|
ritual.BloodMagic.waterRitual=Ritual of the Full Spring
|
||||||
|
|
Loading…
Reference in a new issue