Fix builds
This commit is contained in:
parent
c66565a90f
commit
0d52c4515e
3 changed files with 15 additions and 6 deletions
|
@ -140,7 +140,7 @@ public class TechRebornJeiPlugin extends BlankModPlugin
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
registry.addRecipes(RollingMachineRecipeMaker.getRecipes());
|
registry.addRecipes(RollingMachineRecipeMaker.getRecipes(jeiHelpers));
|
||||||
} catch (RuntimeException e)
|
} catch (RuntimeException e)
|
||||||
{
|
{
|
||||||
Core.logHelper.error(
|
Core.logHelper.error(
|
||||||
|
|
|
@ -3,6 +3,9 @@ package techreborn.compat.jei.rollingMachine;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import mezz.jei.api.IJeiHelpers;
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
import techreborn.api.RollingMachineRecipe;
|
import techreborn.api.RollingMachineRecipe;
|
||||||
|
|
||||||
|
@ -13,12 +16,12 @@ public class RollingMachineRecipeMaker
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Object> getRecipes()
|
public static List<Object> getRecipes(@Nonnull IJeiHelpers jeiHelpers)
|
||||||
{
|
{
|
||||||
List<Object> recipes = new ArrayList<>();
|
List<Object> recipes = new ArrayList<>();
|
||||||
for (IRecipe recipe : RollingMachineRecipe.instance.getRecipeList())
|
for (IRecipe recipe : RollingMachineRecipe.instance.getRecipeList())
|
||||||
{
|
{
|
||||||
RollingMachineRecipeWrapper recipeWrapper = RollingMachineRecipeWrapper.create(recipe);
|
RollingMachineRecipeWrapper recipeWrapper = RollingMachineRecipeWrapper.create(jeiHelpers, recipe);
|
||||||
if (recipeWrapper != null)
|
if (recipeWrapper != null)
|
||||||
{
|
{
|
||||||
recipes.add(recipeWrapper);
|
recipes.add(recipeWrapper);
|
||||||
|
|
|
@ -5,6 +5,8 @@ import java.util.List;
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import mezz.jei.api.IGuiHelper;
|
||||||
|
import mezz.jei.api.IJeiHelpers;
|
||||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||||
import mezz.jei.api.recipe.wrapper.ICraftingRecipeWrapper;
|
import mezz.jei.api.recipe.wrapper.ICraftingRecipeWrapper;
|
||||||
import mezz.jei.plugins.vanilla.crafting.ShapedOreRecipeWrapper;
|
import mezz.jei.plugins.vanilla.crafting.ShapedOreRecipeWrapper;
|
||||||
|
@ -17,6 +19,9 @@ import net.minecraft.item.crafting.ShapedRecipes;
|
||||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||||
|
import techreborn.Core;
|
||||||
|
import techreborn.compat.CompatManager;
|
||||||
|
import techreborn.compat.jei.TechRebornJeiPlugin;
|
||||||
|
|
||||||
public class RollingMachineRecipeWrapper extends BlankRecipeWrapper implements ICraftingRecipeWrapper
|
public class RollingMachineRecipeWrapper extends BlankRecipeWrapper implements ICraftingRecipeWrapper
|
||||||
{
|
{
|
||||||
|
@ -28,12 +33,13 @@ public class RollingMachineRecipeWrapper extends BlankRecipeWrapper implements I
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public static RollingMachineRecipeWrapper create(IRecipe baseRecipe)
|
public static RollingMachineRecipeWrapper create(@Nonnull IJeiHelpers jeiHelpers, IRecipe baseRecipe)
|
||||||
{
|
{
|
||||||
|
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||||
ICraftingRecipeWrapper recipeWrapper;
|
ICraftingRecipeWrapper recipeWrapper;
|
||||||
if (baseRecipe instanceof ShapelessRecipes)
|
if (baseRecipe instanceof ShapelessRecipes)
|
||||||
{
|
{
|
||||||
recipeWrapper = new ShapelessRecipesWrapper((ShapelessRecipes) baseRecipe);
|
recipeWrapper = new ShapelessRecipesWrapper(guiHelper, (ShapelessRecipes) baseRecipe);
|
||||||
} else if (baseRecipe instanceof ShapedRecipes)
|
} else if (baseRecipe instanceof ShapedRecipes)
|
||||||
{
|
{
|
||||||
recipeWrapper = new ShapedRecipesWrapper((ShapedRecipes) baseRecipe);
|
recipeWrapper = new ShapedRecipesWrapper((ShapedRecipes) baseRecipe);
|
||||||
|
@ -42,7 +48,7 @@ public class RollingMachineRecipeWrapper extends BlankRecipeWrapper implements I
|
||||||
recipeWrapper = new ShapedOreRecipeWrapper((ShapedOreRecipe) baseRecipe);
|
recipeWrapper = new ShapedOreRecipeWrapper((ShapedOreRecipe) baseRecipe);
|
||||||
} else if (baseRecipe instanceof ShapelessOreRecipe)
|
} else if (baseRecipe instanceof ShapelessOreRecipe)
|
||||||
{
|
{
|
||||||
recipeWrapper = new ShapelessOreRecipeWrapper((ShapelessOreRecipe) baseRecipe);
|
recipeWrapper = new ShapelessOreRecipeWrapper(guiHelper, (ShapelessOreRecipe) baseRecipe);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue