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,58 @@
package techreborn.compat.jei.scrapbox;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.gui.IDrawable;
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.util.StatCollector;
import techreborn.client.gui.GuiCompressor;
import techreborn.compat.jei.RecipeCategoryUids;
import techreborn.compat.jei.RecipeUtil;
import javax.annotation.Nonnull;
public class ScrapboxRecipeCategory extends BlankRecipeCategory {
private static final int[] INPUT_SLOTS = {0};
private static final int[] OUTPUT_SLOTS = {1};
private final IDrawable background;
private final String title;
public ScrapboxRecipeCategory(IGuiHelper guiHelper) {
background = guiHelper.createDrawable(GuiCompressor.texture, 55, 30, 82, 26);
title = StatCollector.translateToLocal("jei.techreborn.scrapbox.name");
}
@Nonnull
@Override
public String getUid() {
return RecipeCategoryUids.SCRAPBOX;
}
@Nonnull
@Override
public String getTitle() {
return title;
}
@Nonnull
@Override
public IDrawable getBackground() {
return background;
}
@Override
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) {
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3);
guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4);
if (recipeWrapper instanceof ScrapboxRecipeWrapper) {
ScrapboxRecipeWrapper recipe = (ScrapboxRecipeWrapper) recipeWrapper;
RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null);
}
}
}

View file

@ -0,0 +1,41 @@
package techreborn.compat.jei.scrapbox;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.api.recipe.ScrapboxRecipe;
import techreborn.compat.jei.RecipeCategoryUids;
import javax.annotation.Nonnull;
public class ScrapboxRecipeHandler implements IRecipeHandler<ScrapboxRecipe> {
@Nonnull
private final IJeiHelpers jeiHelpers;
public ScrapboxRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
this.jeiHelpers = jeiHelpers;
}
@Nonnull
@Override
public Class<ScrapboxRecipe> getRecipeClass() {
return ScrapboxRecipe.class;
}
@Nonnull
@Override
public String getRecipeCategoryUid() {
return RecipeCategoryUids.SCRAPBOX;
}
@Nonnull
@Override
public IRecipeWrapper getRecipeWrapper(@Nonnull ScrapboxRecipe recipe) {
return new ScrapboxRecipeWrapper(jeiHelpers, recipe);
}
@Override
public boolean isRecipeValid(@Nonnull ScrapboxRecipe recipe) {
return true;
}
}

View file

@ -0,0 +1,31 @@
package techreborn.compat.jei.scrapbox;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
import mezz.jei.api.gui.IDrawableStatic;
import net.minecraft.client.Minecraft;
import techreborn.api.recipe.ScrapboxRecipe;
import techreborn.client.gui.GuiCompressor;
import techreborn.compat.jei.BaseRecipeWrapper;
import javax.annotation.Nonnull;
public class ScrapboxRecipeWrapper extends BaseRecipeWrapper<ScrapboxRecipe> {
private final IDrawableAnimated progress;
public ScrapboxRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ScrapboxRecipe baseRecipe) {
super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic progressStatic = guiHelper.createDrawable(GuiCompressor.texture, 176, 14, 20, 11);
int ticksPerCycle = baseRecipe.tickTime();
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false);
}
@Override
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) {
super.drawAnimations(minecraft, recipeWidth, recipeHeight);
progress.draw(minecraft, 25, 7);
}
}