mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 19:05:16 +00:00
No longer crashes when loaded with TC6 beta. Note that this is just a crash-prevention fix, the actual integration still needs modernizing
This commit is contained in:
1 parent
123e35d444
commit
ed72ff3d5f
4 files changed
+27
-45
No files matched your search
@@ -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();
|
||||
|
||||
@@ -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<ResourceLocation> 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();
|
||||
|
||||
@@ -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<IRecipe> 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<IRecipe> 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<IRecipe> 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;
|
||||
|
||||
Reference in new issue
Block a user