Now comes the grind, 244 errors left

This commit is contained in:
modmuss50 2016-03-13 16:08:30 +00:00
parent 7f920b282f
commit 9a40abbe78
220 changed files with 2053 additions and 2052 deletions

View file

@ -0,0 +1,79 @@
package techreborn.compat.jei.rollingMachine;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.ICraftingGridHelper;
import mezz.jei.api.gui.IDrawable;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.recipe.BlankRecipeCategory;
import mezz.jei.api.recipe.IRecipeWrapper;
import net.minecraft.client.Minecraft;
import net.minecraft.util.StatCollector;
import techreborn.client.gui.GuiRollingMachine;
import techreborn.compat.jei.RecipeCategoryUids;
import javax.annotation.Nonnull;
public class RollingMachineRecipeCategory extends BlankRecipeCategory {
private static final int[] INPUT_SLOTS = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
private static final int[] OUTPUT_SLOTS = {10};
private final IDrawable background;
private final IDrawableAnimated progress;
private final ICraftingGridHelper craftingGridHelper;
private final String title;
public RollingMachineRecipeCategory(IGuiHelper guiHelper) {
background = guiHelper.createDrawable(GuiRollingMachine.texture, 29, 16, 116, 54);
title = StatCollector.translateToLocal("tile.techreborn.rollingmachine.name");
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiRollingMachine.texture, 176, 14, 20, 18);
progress = guiHelper.createAnimatedDrawable(progressStatic, 250, IDrawableAnimated.StartDirection.LEFT, false);
craftingGridHelper = guiHelper.createCraftingGridHelper(INPUT_SLOTS[0], OUTPUT_SLOTS[0]);
}
@Nonnull
@Override
public String getUid() {
return RecipeCategoryUids.ROLLING_MACHINE;
}
@Nonnull
@Override
public String getTitle() {
return title;
}
@Nonnull
@Override
public IDrawable getBackground() {
return background;
}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft) {
progress.draw(minecraft, 62, 18);
}
@Override
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
for (int l = 0; l < 3; l++) {
for (int k1 = 0; k1 < 3; k1++) {
int i = k1 + l * 3;
guiItemStacks.init(INPUT_SLOTS[i], true, k1 * 18, l * 18);
}
}
guiItemStacks.init(OUTPUT_SLOTS[0], false, 94, 18);
if (recipeWrapper instanceof RollingMachineRecipeWrapper) {
RollingMachineRecipeWrapper recipe = (RollingMachineRecipeWrapper) recipeWrapper;
craftingGridHelper.setInput(guiItemStacks, recipe.getInputs());
craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs());
}
}
}

View file

@ -0,0 +1,32 @@
package techreborn.compat.jei.rollingMachine;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.compat.jei.RecipeCategoryUids;
import javax.annotation.Nonnull;
public class RollingMachineRecipeHandler implements IRecipeHandler<RollingMachineRecipeWrapper> {
@Nonnull
@Override
public Class<RollingMachineRecipeWrapper> getRecipeClass() {
return RollingMachineRecipeWrapper.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return RecipeCategoryUids.ROLLING_MACHINE;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull RollingMachineRecipeWrapper recipe) {
return recipe;
}
@Override
public boolean isRecipeValid(@Nonnull RollingMachineRecipeWrapper recipe) {
return true;
}
}

View file

@ -0,0 +1,24 @@
package techreborn.compat.jei.rollingMachine;
import net.minecraft.item.crafting.IRecipe;
import techreborn.api.RollingMachineRecipe;
import java.util.ArrayList;
import java.util.List;
public class RollingMachineRecipeMaker {
private RollingMachineRecipeMaker() {
}
public static List<Object> getRecipes() {
List<Object> recipes = new ArrayList<>();
for (IRecipe recipe : RollingMachineRecipe.instance.getRecipeList()) {
RollingMachineRecipeWrapper recipeWrapper = RollingMachineRecipeWrapper.create(recipe);
if (recipeWrapper != null) {
recipes.add(recipeWrapper);
}
}
return recipes;
}
}

View file

@ -0,0 +1,56 @@
package techreborn.compat.jei.rollingMachine;
import mezz.jei.api.recipe.BlankRecipeWrapper;
import mezz.jei.api.recipe.wrapper.ICraftingRecipeWrapper;
import mezz.jei.plugins.vanilla.crafting.ShapedOreRecipeWrapper;
import mezz.jei.plugins.vanilla.crafting.ShapedRecipesWrapper;
import mezz.jei.plugins.vanilla.crafting.ShapelessOreRecipeWrapper;
import mezz.jei.plugins.vanilla.crafting.ShapelessRecipesWrapper;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
public class RollingMachineRecipeWrapper extends BlankRecipeWrapper implements ICraftingRecipeWrapper {
private final ICraftingRecipeWrapper baseRecipe;
@Nullable
public static RollingMachineRecipeWrapper create(IRecipe baseRecipe) {
ICraftingRecipeWrapper recipeWrapper;
if (baseRecipe instanceof ShapelessRecipes) {
recipeWrapper = new ShapelessRecipesWrapper((ShapelessRecipes) baseRecipe);
} else if (baseRecipe instanceof ShapedRecipes) {
recipeWrapper = new ShapedRecipesWrapper((ShapedRecipes) baseRecipe);
} else if (baseRecipe instanceof ShapedOreRecipe) {
recipeWrapper = new ShapedOreRecipeWrapper((ShapedOreRecipe) baseRecipe);
} else if (baseRecipe instanceof ShapelessOreRecipe) {
recipeWrapper = new ShapelessOreRecipeWrapper((ShapelessOreRecipe) baseRecipe);
} else {
return null;
}
return new RollingMachineRecipeWrapper(recipeWrapper);
}
public RollingMachineRecipeWrapper(ICraftingRecipeWrapper baseRecipe) {
this.baseRecipe = baseRecipe;
}
@Override
@Nonnull
public List getInputs() {
return baseRecipe.getInputs();
}
@Override
@Nonnull
public List<ItemStack> getOutputs() {
return baseRecipe.getOutputs();
}
}