Config option for Goggles upgrade

This commit is contained in:
Nick 2016-02-03 20:41:41 -08:00
parent c1aeb2e7f6
commit e219b50589
2 changed files with 11 additions and 6 deletions

View file

@ -123,6 +123,7 @@ public class ConfigHandler
// Compat
public static int wailaAltarDisplayMode;
public static boolean thaumcraftGogglesUpgrade;
public static void init(File file)
{
@ -248,6 +249,7 @@ public class ConfigHandler
category = "Compatibility";
config.addCustomCategoryComment(category, "Compatibility settings");
wailaAltarDisplayMode = config.getInt("wailaAltarDisplayMode", category + ".waila", 1, 0, 2, "The mode for the Waila display on Blood Altars.\n0 - Always display information\n1 - Only display when Divination/Seer sigil is in hand.\n2 - Only display when Divination/Seer sigil is in inventory");
thaumcraftGogglesUpgrade = config.getBoolean("thaumcraftGogglesUpgrade", category + ".thaumcraft", true, "Allows the Living Helmet to be upgraded with Goggles of Revealing in an Anvil.");
config.save();
}

View file

@ -95,14 +95,17 @@ 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())
if (ConfigHandler.thaumcraftGogglesUpgrade)
{
ItemStack output = event.left.copy();
output = NBTHelper.checkNBT(output);
output.getTagCompound().setBoolean(Constants.Compat.THAUMCRAFT_HAS_GOGGLES, true);
event.cost = 1;
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;
event.output = output;
}
}
}