Revert "Updated JEI compat to use VanillaTypes"

This reverts commit c41b889

Done becuase VanillaTypes are not in a stable build of JEI
This commit is contained in:
Modmuss50 2018-09-02 14:02:08 +01:00
parent 852c4584a4
commit 9a19223c84
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
9 changed files with 48 additions and 38 deletions

View file

@ -25,7 +25,6 @@
package techreborn.compat.jei;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
@ -94,9 +93,11 @@ public abstract class BaseRecipeWrapper<T extends BaseRecipe> implements IRecipe
}
@Override
public void getIngredients(@Nonnull IIngredients ingredients) {
ingredients.setInputLists(VanillaTypes.ITEM, inputs);
ingredients.setOutputs(VanillaTypes.ITEM, baseRecipe.getOutputs());
public void getIngredients(
@Nonnull
IIngredients ingredients) {
ingredients.setInputLists(ItemStack.class, inputs);
ingredients.setOutputs(ItemStack.class, baseRecipe.getOutputs());
}
@Nonnull

View file

@ -28,7 +28,6 @@ import mezz.jei.api.gui.IGuiFluidStackGroup;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.item.ItemStack;
@ -84,7 +83,7 @@ public class RecipeUtil {
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
if (itemInputSlots != null) {
List<List<ItemStack>> inputs = ingredients.getInputs(VanillaTypes.ITEM);
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
for (int i = 0; i < inputs.size() && i < itemInputSlots.length; i++) {
int inputSlot = itemInputSlots[i];
guiItemStacks.set(inputSlot, inputs.get(i));
@ -92,7 +91,7 @@ public class RecipeUtil {
}
if (itemOutputSlots != null) {
List<List<ItemStack>> outputs = ingredients.getOutputs(VanillaTypes.ITEM);
List<List<ItemStack>> outputs = ingredients.getOutputs(ItemStack.class);
for (int i = 0; i < outputs.size() && i < itemOutputSlots.length; i++) {
int outputSlot = itemOutputSlots[i];
guiItemStacks.set(outputSlot, outputs.get(i));
@ -100,7 +99,7 @@ public class RecipeUtil {
}
if (fluidInputSlots != null) {
List<List<FluidStack>> fluidInputs = ingredients.getInputs(VanillaTypes.FLUID);
List<List<FluidStack>> fluidInputs = ingredients.getInputs(FluidStack.class);
for (int i = 0; i < fluidInputs.size() && i < fluidInputSlots.length; i++) {
int inputTank = fluidInputSlots[i];
guiFluidStacks.set(inputTank, fluidInputs.get(i));
@ -108,7 +107,7 @@ public class RecipeUtil {
}
if (fluidOutputSlots != null) {
List<List<FluidStack>> fluidOutputs = ingredients.getOutputs(VanillaTypes.FLUID);
List<List<FluidStack>> fluidOutputs = ingredients.getOutputs(FluidStack.class);
for (int i = 0; i < fluidOutputs.size() && i < fluidOutputSlots.length; i++) {
int outputTank = fluidOutputSlots[i];
guiFluidStacks.set(outputTank, fluidOutputs.get(i));

View file

@ -29,7 +29,6 @@ import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
@ -58,10 +57,13 @@ public class FluidReplicatorRecipeWrapper implements IRecipeWrapper {
IDrawableAnimated.StartDirection.LEFT, false);
}
/* (non-Javadoc)
* @see mezz.jei.api.recipe.IRecipeWrapper#getIngredients(mezz.jei.api.ingredients.IIngredients)
*/
@Override
public void getIngredients(IIngredients ingredients) {
ingredients.setInput(VanillaTypes.ITEM, new ItemStack(ModItems.UU_MATTER, recipe.getInput()));
ingredients.setOutput(VanillaTypes.FLUID, new FluidStack(recipe.getFluid(), Fluid.BUCKET_VOLUME));
ingredients.setInput(ItemStack.class, new ItemStack(ModItems.UU_MATTER, recipe.getInput()));
ingredients.setOutput(FluidStack.class, new FluidStack(recipe.getFluid(), Fluid.BUCKET_VOLUME));
}
@Override

View file

@ -29,8 +29,8 @@ import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
import mezz.jei.api.recipe.IRecipeCategory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import reborncore.common.util.StringUtils;
import techreborn.compat.jei.RecipeCategoryUids;
@ -88,7 +88,7 @@ public class FusionReactorRecipeCategory implements IRecipeCategory<FusionReacto
itemStacks.set(inputSlotTop, recipeWrapper.getTopInput());
itemStacks.set(inputSlotBottom, recipeWrapper.getBottomInput());
itemStacks.set(outputSlot, ingredients.getOutputs(VanillaTypes.ITEM).get(0));
itemStacks.set(outputSlot, ingredients.getOutputs(ItemStack.class).get(0));
}
}

View file

@ -25,7 +25,6 @@
package techreborn.compat.jei.fusionReactor;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
@ -44,8 +43,8 @@ public class FusionReactorRecipeWrapper implements IRecipeWrapper {
@Override
public void getIngredients(@Nonnull IIngredients ingredients) {
ingredients.setInputs(VanillaTypes.ITEM, Arrays.asList(baseRecipe.getTopInput(), baseRecipe.getBottomInput()));
ingredients.setOutput(VanillaTypes.ITEM, baseRecipe.getOutput());
ingredients.setInputs(ItemStack.class, Arrays.asList(baseRecipe.getTopInput(), baseRecipe.getBottomInput()));
ingredients.setOutput(ItemStack.class, baseRecipe.getOutput());
}
public ItemStack getTopInput() {

View file

@ -29,7 +29,6 @@ import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraftforge.fluids.Fluid;
@ -61,6 +60,6 @@ public class FluidGeneratorRecipeWrapper implements IRecipeWrapper {
@Override
public void getIngredients(final IIngredients ingredients) {
ingredients.setInput(VanillaTypes.FLUID, new FluidStack(this.baseRecipe.getFluid(), Fluid.BUCKET_VOLUME));
ingredients.setInput(FluidStack.class, new FluidStack(this.baseRecipe.getFluid(), Fluid.BUCKET_VOLUME));
}
}

View file

@ -29,7 +29,6 @@ import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
@ -42,22 +41,29 @@ import java.util.Collections;
import java.util.List;
public class IndustrialGrinderRecipeWrapper extends BaseRecipeWrapper<IndustrialGrinderRecipe> {
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_grinder.png");
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_grinder.png");
private final IDrawableAnimated progress;
public IndustrialGrinderRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull IndustrialGrinderRecipe baseRecipe) {
public IndustrialGrinderRecipeWrapper(
@Nonnull
IJeiHelpers jeiHelpers,
@Nonnull
IndustrialGrinderRecipe baseRecipe) {
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic progressStatic = guiHelper.createDrawable(texture, 176, 14, 24, 17);
int ticksPerCycle = baseRecipe.tickTime();
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
IDrawableAnimated.StartDirection.LEFT, false);
IDrawableAnimated.StartDirection.LEFT, false);
}
@Override
public void getIngredients(@Nonnull final IIngredients ingredients) {
ingredients.setInput(VanillaTypes.FLUID, this.baseRecipe.fluidStack);
public void getIngredients(
@Nonnull
final IIngredients ingredients) {
ingredients.setInput(FluidStack.class, this.baseRecipe.fluidStack);
super.getIngredients(ingredients);
}
@ -81,8 +87,6 @@ public class IndustrialGrinderRecipeWrapper extends BaseRecipeWrapper<Industrial
int lineHeight = minecraft.fontRenderer.FONT_HEIGHT;
minecraft.fontRenderer.drawString("Time: " + baseRecipe.tickTime / 20 + " s", x, y, 0x444444);
minecraft.fontRenderer
.drawString("Energy: " + PowerSystem.getLocaliszedPowerFormattedNoSuffix(baseRecipe.euPerTick) + " "
+ PowerSystem.getDisplayPower().abbreviation + "/t", x, y += lineHeight, 0x444444);
minecraft.fontRenderer.drawString("Energy: " + PowerSystem.getLocaliszedPowerFormattedNoSuffix(baseRecipe.euPerTick) + " " + PowerSystem.getDisplayPower().abbreviation + "/t", x, y += lineHeight, 0x444444);
}
}

View file

@ -29,7 +29,6 @@ import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
@ -44,21 +43,28 @@ import java.util.List;
* @author drcrazy
*/
public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper<IndustrialSawmillRecipe> {
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_sawmill.png");
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_sawmill.png");
private final IDrawableAnimated progress;
public IndustrialSawmillRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull IndustrialSawmillRecipe baseRecipe) {
public IndustrialSawmillRecipeWrapper(
@Nonnull
IJeiHelpers jeiHelpers,
@Nonnull
IndustrialSawmillRecipe baseRecipe) {
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic progressStatic = guiHelper.createDrawable(texture, 176, 14, 20, 13);
int ticksPerCycle = baseRecipe.tickTime();
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
IDrawableAnimated.StartDirection.LEFT, false);
IDrawableAnimated.StartDirection.LEFT, false);
}
@Override
public void getIngredients(@Nonnull final IIngredients ingredients) {
ingredients.setInput(VanillaTypes.FLUID, this.baseRecipe.fluidStack);
public void getIngredients(
@Nonnull
final IIngredients ingredients) {
ingredients.setInput(FluidStack.class, this.baseRecipe.fluidStack);
super.getIngredients(ingredients);
}

View file

@ -27,9 +27,9 @@ package techreborn.compat.jei.rollingMachine;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.*;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.ingredients.VanillaTypes;
import mezz.jei.api.recipe.IRecipeCategory;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import reborncore.common.util.StringUtils;
import techreborn.compat.jei.RecipeCategoryUids;
@ -98,7 +98,7 @@ public class RollingMachineRecipeCategory implements IRecipeCategory<RollingMach
}
guiItemStacks.init(OUTPUT_SLOTS[0], false, 94, 18);
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(VanillaTypes.ITEM));
guiItemStacks.set(OUTPUT_SLOTS[0], ingredients.getOutputs(VanillaTypes.ITEM).get(0));
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class));
guiItemStacks.set(OUTPUT_SLOTS[0], ingredients.getOutputs(ItemStack.class).get(0));
}
}