diff --git a/build.properties b/build.properties index e4e72a6af..167f253e7 100644 --- a/build.properties +++ b/build.properties @@ -2,7 +2,7 @@ #Fri Jan 26 22:35:53 GMT 2018 mod_name=Botania cf_meta_version=1.12.2 -forge_version=14.23.1.2555 +forge_version=14.23.3.2655 dir_repo=./ mc_mappings=snapshot_20171217 version=r1.10 diff --git a/src/main/java/vazkii/botania/common/brew/ModBrews.java b/src/main/java/vazkii/botania/common/brew/ModBrews.java index fae878b1e..a37194b52 100644 --- a/src/main/java/vazkii/botania/common/brew/ModBrews.java +++ b/src/main/java/vazkii/botania/common/brew/ModBrews.java @@ -68,8 +68,7 @@ public class ModBrews { } public static void initTC() { - Potion warpWardPotion = Potion.REGISTRY.getObject(new ResourceLocation("minecraft:warp_ward")); - // thaumcraft 5 is registering its potions under the Minecraft namespace + Potion warpWardPotion = Potion.REGISTRY.getObject(new ResourceLocation("thaumcraft:warpward")); if(warpWardPotion != null) warpWard = new BrewMod(LibBrewNames.WARP_WARD, 0xFBBDFF, 25000, new PotionEffect(warpWardPotion, 12000, 0)).setNotBloodPendantInfusable(); diff --git a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java index a61ac37f5..dfa5b7923 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java @@ -43,6 +43,7 @@ import vazkii.botania.common.crafting.recipe.SpecialFloatingFlowerRecipe; import vazkii.botania.common.crafting.recipe.SpellClothRecipe; import vazkii.botania.common.crafting.recipe.TerraPickTippingRecipe; import vazkii.botania.common.item.ModItems; +import vazkii.botania.common.lib.LibItemNames; import vazkii.botania.common.lib.LibMisc; import vazkii.botania.common.lib.LibOreDict; @@ -209,7 +210,7 @@ public final class ModCraftingRecipes { public static ResourceLocation recipeRFGenerator; public static ResourceLocation recipeGravityRod; public static ResourceLocation recipeUltraSpreader; - public static ResourceLocation recipeHelmetOfRevealing; + public static List recipeHelmetOfRevealing; public static ResourceLocation recipeVial; public static ResourceLocation recipeFlask; public static ResourceLocation recipeBrewery; @@ -331,7 +332,14 @@ public final class ModCraftingRecipes { r.register(new CompositeLensRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "composite_lens"))); r.register(new CosmeticAttachRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "cosmetic_attach"))); r.register(new CosmeticRemoveRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "cosmetic_remove"))); - r.register(new HelmRevealingRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "helm_revealing"))); + if(Botania.thaumcraftLoaded) { + r.register(new HelmRevealingRecipe(ModItems.terrasteelHelmRevealing, ModItems.terrasteelHelm) + .setRegistryName(LibMisc.MOD_ID, LibItemNames.TERRASTEEL_HELM_R + "_from_goggles")); + r.register(new HelmRevealingRecipe(ModItems.manasteelHelmRevealing, ModItems.manasteelHelm) + .setRegistryName(LibMisc.MOD_ID, LibItemNames.MANASTEEL_HELM_R + "_from_goggles")); + r.register(new HelmRevealingRecipe(ModItems.elementiumHelmRevealing, ModItems.elementiumHelm) + .setRegistryName(LibMisc.MOD_ID, LibItemNames.ELEMENTIUM_HELM_R + "_from_goggles")); + } r.register(new KeepIvyRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "keep_ivy_attach"))); r.register(new LensDyeingRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "lens_dye"))); r.register(new ManaGunLensRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "mana_gun_add_lens"))); @@ -482,6 +490,7 @@ public final class ModCraftingRecipes { recipeRedstoneSpreader = path("spreader_1"); recipeDreamwoodSpreader = path("spreader_2"); recipeUltraSpreader = path("spreader_3"); + recipeHelmetOfRevealing = allOfGroup("helm_revealing"); recipePrism = ModBlocks.prism.getRegistryName(); recipePoolCart = ModItems.poolMinecart.getRegistryName(); recipePump = ModBlocks.pump.getRegistryName(); diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/HelmRevealingRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/HelmRevealingRecipe.java index 1de4d7796..7f1b380f1 100644 --- a/src/main/java/vazkii/botania/common/crafting/recipe/HelmRevealingRecipe.java +++ b/src/main/java/vazkii/botania/common/crafting/recipe/HelmRevealingRecipe.java @@ -13,37 +13,26 @@ package vazkii.botania.common.crafting.recipe; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.Ingredient; +import net.minecraft.item.crafting.ShapelessRecipes; import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import net.minecraftforge.registries.IForgeRegistryEntry; +import net.minecraft.util.NonNullList; +import net.minecraftforge.fml.common.registry.GameRegistry; import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.ModItems; import javax.annotation.Nonnull; -public class HelmRevealingRecipe extends IForgeRegistryEntry.Impl implements IRecipe { +public class HelmRevealingRecipe extends ShapelessRecipes { + @GameRegistry.ObjectHolder("thaumcraft:goggles") + private static Item goggles = null; - @Override - public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) { - Item goggles = Item.REGISTRY.getObject(new ResourceLocation("thaumcraft", "goggles")); - if(goggles == null) - return false; // NO TC loaded + private final Item botaniaHelm; - boolean foundGoggles = false; - boolean foundHelm = false; - for(int i = 0; i < var1.getSizeInventory(); i++) { - ItemStack stack = var1.getStackInSlot(i); - if(!stack.isEmpty()) { - if(checkHelm(stack)) - foundHelm = true; - else if(stack.getItem() == goggles) - foundGoggles = true; - else return false; // Found an invalid item, breaking the recipe - } - } - return foundGoggles && foundHelm; + public HelmRevealingRecipe(Item output, Item botaniaHelm) { + super("botania:helm_revealing", new ItemStack(output), + NonNullList.from(Ingredient.EMPTY, Ingredient.fromItem(botaniaHelm), Ingredient.fromItem(goggles))); + this.botaniaHelm = botaniaHelm; } @Nonnull @@ -53,7 +42,7 @@ public class HelmRevealingRecipe extends IForgeRegistryEntry.Impl imple for(int i = 0; i < var1.getSizeInventory(); i++) { ItemStack stack = var1.getStackInSlot(i); - if(!stack.isEmpty() && checkHelm(stack)) + if(!stack.isEmpty() && stack.getItem() == botaniaHelm) helm = stack; } @@ -84,28 +73,13 @@ public class HelmRevealingRecipe extends IForgeRegistryEntry.Impl imple ItemNBTHelper.setList(newHelm, "ench", enchList); //Copy Runic Hardening + // TODO does tc6 still have this? byte runicHardening = ItemNBTHelper.getByte(helmCopy, "RS.HARDEN", (byte)0); ItemNBTHelper.setByte(newHelm, "RS.HARDEN", runicHardening); return newHelm; } - @Override - public boolean canFit(int width, int height) { - return width * height >= 2; - } - - @Nonnull - @Override - public ItemStack getRecipeOutput() { - return new ItemStack(ModItems.manasteelHelmRevealing); - } - - private boolean checkHelm(ItemStack helmStack) { - Item helmItem = helmStack.getItem(); - return helmItem == ModItems.manasteelHelm || helmItem == ModItems.terrasteelHelm || helmItem == ModItems.elementiumHelm; - } - @Override public boolean isDynamic() { return true;