ToxicSky101 Posted October 1, 2022 Posted October 1, 2022 (edited) I'm trying to add JEI Compatability to my mod, but it keeps throwing some errors at me. They seemed weird, so I decided to bring the code here. Can anybody help me out here? /** * The code of this mod element is always locked. * * You can register new events in this class too. * * If you want to make a plain independent class, create it using * Project Browser -> New... and make sure to make the class * outside net.mcreator.hatmod as this package is managed by MCreator. * * If you change workspace package, modid or prefix, you will need * to manually adapt this file to these changes or remake it. * * This class will be added in the mod root package. */ import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.event.world.BiomeLoadingEvent; import net.minecraftforge.event.server.ServerStartingEvent; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.Dist; import net.minecraft.world.entity.boss.enderdragon.phases.DragonChargePlayerPhase; import mezz.jei.api.IModPlugin; import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.gui.drawable.IDrawable; import mezz.jei.api.gui.ingredient.IGuiItemStackGroup; import mezz.jei.api.helpers.IGuiHelper; import mezz.jei.api.helpers.IJeiHelpers; import mezz.jei.api.ingredients.IIngredients; import mezz.jei.api.recipe.category.IRecipeCategory; import mezz.jei.api.registration.IRecipeCatalystRegistration; import mezz.jei.api.registration.IRecipeCategoryRegistration; import mezz.jei.api.registration.IRecipeRegistration; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.util.ResourceLocation; import java.util.ArrayList; import java.util.List; @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) @mezz.jei.api.JeiPlugin public class DSTJEI { public DSTJEI() { new ItemStack(DraconicSmithingTable.block); List<DraconicSmithingTableJeiCategory.DraconicSmithingTableRecipeWrapper> generateDraconicSmithingTableRecipes() { //keeps throwing error here, i don't know why List<DraconicSmithingTableJeiCategory.DraconicSmithingTableRecipeWrapper> recipes = new ArrayList<>(); ArrayList<ItemStack> inputs = new ArrayList<>(); ArrayList<ItemStack> outputs = new ArrayList<>(); inputs.add(new ItemStack(DragonPaste)); inputs.add(new ItemStack(netherite_helmet)); inputs.add(new ItemStack(DragonPaste)); inputs.add(new ItemStack(netherite_chestplate)); inputs.add(new ItemStack(DragonPaste)); inputs.add(new ItemStack(netherite_leggings)); inputs.add(new ItemStack(DragonPaste)); inputs.add(new ItemStack(netherite_boots)); inputs.add(new ItemStack(DragonPaste)); inputs.add(new ItemStack(netherite_sword)); inputs.add(new ItemStack(DragonPaste)); inputs.add(new ItemStack(netherite_axe)); inputs.add(new ItemStack(DragonPaste)); inputs.add(new ItemStack(netherite_pickaxe)); inputs.add(new ItemStack(DragonPaste)); inputs.add(new ItemStack(netherite_hoe)); inputs.add(new ItemStack(DragonPaste)); inputs.add(new ItemStack(netherite_shovel)); outputs.add(new ItemStack(DragonHelmet)); outputs.add(new ItemStack(DragonChestplate)); outputs.add(new ItemStack(DragonLeggings)); outputs.add(new ItemStack(DragonBoots)); outputs.add(new ItemStack(DragonSword)); outputs.add(new ItemStack(DragonAxe)); outputs.add(new ItemStack(DragonPickaxe)); outputs.add(new ItemStack(DragonHoe)); outputs.add(new ItemStack(DragonShovel)); recipes.add(new DraconicSmithingTableJeiCategory.DraconicSmithingTableRecipeWrapper(inputs, outputs)); return recipes; } IGuiItemStackGroup stacks = iRecipeLayout.getItemStacks(); stacks.init(input1, true, 17, 13); stacks.init(input2, true, 18, 63); stacks.init(output1, false, 141, 36); //... stacks.set(input1, iIngredients.getInputs(VanillaTypes.ITEM).get(0)); stacks.set(input2, iIngredients.getInputs(VanillaTypes.ITEM).get(1)); //+1 from previous variable. stacks.set(output1, iIngredients.getOutputs(VanillaTypes.ITEM).get(0)); //... } } Edited October 1, 2022 by ToxicSky101 mistype
ChampionAsh5357 Posted October 1, 2022 Posted October 1, 2022 I would ask wherever JEI gives their support. As this forum is specifically for Forge, it is not likely that someone will have an answer based upon a specific mod. This is especially true when you say you have errors, don't provide the error log, and only give a snippet of the code in question.
ChampionAsh5357 Posted October 1, 2022 Posted October 1, 2022 Apologies, but as this is written with MCreator, we do not support it on this forum. Please ask their support forums for help.
Recommended Posts