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

@ -41,14 +41,23 @@ if (new File(projectDir, '.git').exists())
repositories {
maven { url "http://dvs1.progwml6.com/files/maven" }
maven { url "http://mobiusstrip.eu/maven" }
ivy {
name "Thaumcraft"
artifactPattern "https://dl.dropboxusercontent.com/u/47135879/[module]-[revision]-deobf.[ext]"
}
ivy {
name "Baubles"
artifactPattern "https://dl.dropboxusercontent.com/u/47135879/[module]-1.8.9-[revision]-deobf.[ext]"
}
}
dependencies {
deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}"
compile ("mcp.mobius.waila:Waila:${waila_version}_1.8.8:dev") {
exclude group: 'mcp.mobius.waila'
}
compile "mcp.mobius.waila:Waila:${waila_version}_1.8.8:dev"
compile name: "Thaumcraft", version: "${mc_version}-${thaumcraft_version}", ext: "jar"
compile name: 'Baubles', version: "${baubles_version}", ext: 'jar'
}
minecraft {

View file

@ -8,4 +8,6 @@ curse_id=224791
mappings_version=snapshot_20160109
jei_version=2.15.0.70
waila_version=1.6.0-B3
waila_version=1.6.0-B3
thaumcraft_version=5.1.5
baubles_version=1.1.3.0

View file

@ -4,6 +4,7 @@ import lombok.Getter;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.potion.Potion;
import net.minecraftforge.fml.common.registry.GameRegistry;
import java.util.Locale;
@ -128,6 +129,9 @@ public class Constants
public static final String WAILA_CONFIG_ALTAR = Mod.MODID + ".bloodAltar";
public static final String WAILA_CONFIG_TELEPOSER = Mod.MODID + ".teleposer";
public static final String WAILA_CONFIG_RITUAL = Mod.MODID + ".ritualController";
public static final String THAUMCRAFT_HAS_GOGGLES = "hasGoggles";
public static final Item THAUMCRAFT_GOGGLES = GameRegistry.findItem("Thaumcraft", "goggles");
}
public static class Misc

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);
}
}

View file

@ -3,6 +3,7 @@ package WayofTime.bloodmagic.util.handler;
import java.util.List;
import java.util.Random;
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
@ -18,14 +19,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraftforge.event.AnvilUpdateEvent;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import net.minecraftforge.event.entity.living.LivingHealEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.entity.player.*;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
import net.minecraftforge.fml.common.eventhandler.Event;
@ -93,6 +92,20 @@ public class EventHandler
}
}
@SubscribeEvent
public void onAnvil(AnvilUpdateEvent event)
{
if (event.left.getItem() == ModItems.livingArmourHelmet && event.right.getItem() == Constants.Compat.THAUMCRAFT_GOGGLES && !event.right.isItemDamaged())
{
ItemStack output = event.left.copy();
output = NBTHelper.checkNBT(output);
output.getTagCompound().setBoolean(Constants.Compat.THAUMCRAFT_HAS_GOGGLES, true);
event.cost = 1;
event.output = output;
}
}
@SubscribeEvent
public void onBucketFill(FillBucketEvent event)
{

View file

@ -273,6 +273,7 @@ tooltip.BloodMagic.livingArmour.upgrade.health=Healthy
tooltip.BloodMagic.livingArmour.upgrade.meleeDamage=Fierce Strike
tooltip.BloodMagic.livingArmour.upgrade.arrowShot=Trick Shot
tooltip.BloodMagic.livingArmour.upgrade.level=%s (Level %d)
tooltip.BloodMagic.livingArmour.hasGoggles=&oContains Goggles of Revealing
tooltip.BloodMagic.will=Will Quality: %1$,.2f
tooltip.BloodMagic.sentientSword.desc=Uses demon will to unleash its full potential.