Thaumcraft Goggles upgrade for Living Helmet

Combine a Living Helmet with an undamaged Goggles of Revealing in an anvil (+1 level) to combine the two. Currently no way to split afterwards.

Thoughts:

- Tweak level requirement to be higher? 1 was chosen in order to make it work.
- Require full set of armor to be worn? This would keep it in line with all the other upgrades.
- I only used the full Thaumcraft jar because the uploaded API is a zip which does not work as a Gradle library.
This commit is contained in:
Nick 2016-02-03 20:31:09 -08:00
parent 332e16a585
commit c1aeb2e7f6
6 changed files with 68 additions and 9 deletions

View file

@ -5,6 +5,7 @@ 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;
@ -15,6 +16,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.common.ISpecialArmor;
import net.minecraftforge.fml.common.Optional;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.bloodmagic.BloodMagic;
@ -25,8 +27,14 @@ 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;
public class ItemLivingArmour extends ItemArmor implements ISpecialArmor
@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
{
public static String[] names = { "helmet", "chest", "legs", "boots" };
@ -168,6 +176,8 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
{
stack = NBTHelper.checkNBT(stack);
if (this == ModItems.livingArmourChest)
{
LivingArmour armour = getLivingArmour(stack);
@ -181,6 +191,12 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor
}
}
if (this == ModItems.livingArmourHelmet)
{
if (stack.getTagCompound().getBoolean(Constants.Compat.THAUMCRAFT_HAS_GOGGLES))
tooltip.add(TextHelper.localizeEffect("tooltip.BloodMagic.livingArmour.hasGoggles"));
}
super.addInformation(stack, player, tooltip, advanced);
}
@ -311,4 +327,18 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor
return null;
}
@Override
public boolean showIngamePopups(ItemStack stack, EntityLivingBase entityLivingBase)
{
stack = NBTHelper.checkNBT(stack);
return stack != null && stack.getItem() == ModItems.livingArmourHelmet && stack.getTagCompound().getBoolean(Constants.Compat.THAUMCRAFT_HAS_GOGGLES);
}
@Override
public boolean showNodes(ItemStack stack, EntityLivingBase entityLivingBase)
{
stack = NBTHelper.checkNBT(stack);
return stack != null && stack.getItem() == ModItems.livingArmourHelmet && stack.getTagCompound().getBoolean(Constants.Compat.THAUMCRAFT_HAS_GOGGLES);
}
}