Industrial Sawmill support for JEI done

This commit is contained in:
drcrazy 2017-04-08 01:52:29 +03:00
parent 291eadfeed
commit b136a534aa
6 changed files with 23 additions and 24 deletions

View file

@ -41,7 +41,6 @@ import techreborn.api.generator.GeneratorRecipeHelper;
import techreborn.api.reactor.FusionReactorRecipeHelper; import techreborn.api.reactor.FusionReactorRecipeHelper;
import techreborn.api.recipe.machines.AssemblingMachineRecipe; import techreborn.api.recipe.machines.AssemblingMachineRecipe;
import techreborn.api.recipe.machines.ImplosionCompressorRecipe; import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
import techreborn.client.gui.*; import techreborn.client.gui.*;
import techreborn.compat.CompatManager; import techreborn.compat.CompatManager;
import techreborn.compat.jei.alloySmelter.AlloySmelterRecipeCategory; import techreborn.compat.jei.alloySmelter.AlloySmelterRecipeCategory;
@ -70,7 +69,6 @@ import techreborn.compat.jei.industrialElectrolyzer.IndustrialElectrolyzerRecipe
import techreborn.compat.jei.industrialElectrolyzer.IndustrialElectrolyzerRecipeHandler; import techreborn.compat.jei.industrialElectrolyzer.IndustrialElectrolyzerRecipeHandler;
import techreborn.compat.jei.industrialGrinder.IndustrialGrinderRecipeCategory; import techreborn.compat.jei.industrialGrinder.IndustrialGrinderRecipeCategory;
import techreborn.compat.jei.industrialGrinder.IndustrialGrinderRecipeHandler; import techreborn.compat.jei.industrialGrinder.IndustrialGrinderRecipeHandler;
import techreborn.compat.jei.industrialGrinder.IndustrialGrinderRecipeWrapper;
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeCategory; import techreborn.compat.jei.rollingMachine.RollingMachineRecipeCategory;
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeHandler; import techreborn.compat.jei.rollingMachine.RollingMachineRecipeHandler;
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeMaker; import techreborn.compat.jei.rollingMachine.RollingMachineRecipeMaker;
@ -188,9 +186,8 @@ public class TechRebornJeiPlugin extends BlankModPlugin {
new ImplosionCompressorRecipeCategory(guiHelper), new IndustrialElectrolyzerRecipeCategory(guiHelper), new ImplosionCompressorRecipeCategory(guiHelper), new IndustrialElectrolyzerRecipeCategory(guiHelper),
new RollingMachineRecipeCategory(guiHelper), new VacuumFreezerRecipeCategory(guiHelper), new RollingMachineRecipeCategory(guiHelper), new VacuumFreezerRecipeCategory(guiHelper),
new GrinderRecipeCategory(guiHelper), new ExtractorRecipeCategory(guiHelper), new GrinderRecipeCategory(guiHelper), new ExtractorRecipeCategory(guiHelper),
new CompressorRecipeCategory(guiHelper), new ScrapboxRecipeCategory(guiHelper)); new CompressorRecipeCategory(guiHelper), new ScrapboxRecipeCategory(guiHelper),
new IndustrialSawmillRecipeCategory(guiHelper));
registry.addRecipeCategories(new IndustrialSawmillRecipeCategory(guiHelper));
for (final EFluidGenerator type : EFluidGenerator.values()) for (final EFluidGenerator type : EFluidGenerator.values())
@ -204,9 +201,7 @@ public class TechRebornJeiPlugin extends BlankModPlugin {
new RollingMachineRecipeHandler(), new VacuumFreezerRecipeHandler(jeiHelpers), new RollingMachineRecipeHandler(), new VacuumFreezerRecipeHandler(jeiHelpers),
new GrinderRecipeHandler(jeiHelpers), new ExtractorRecipeHandler(jeiHelpers), new GrinderRecipeHandler(jeiHelpers), new ExtractorRecipeHandler(jeiHelpers),
new CompressorRecipeHandler(jeiHelpers), new ScrapboxRecipeHandler(jeiHelpers), new CompressorRecipeHandler(jeiHelpers), new ScrapboxRecipeHandler(jeiHelpers),
new FluidGeneratorRecipeHandler(jeiHelpers)); new FluidGeneratorRecipeHandler(jeiHelpers), new IndustrialSawmillRecipeHandler(jeiHelpers));
registry.addRecipeHandlers(new IndustrialSawmillRecipeHandler(jeiHelpers));
registry.addRecipes(RecipeHandler.recipeList); registry.addRecipes(RecipeHandler.recipeList);
registry.addRecipes(FusionReactorRecipeHelper.reactorRecipes); registry.addRecipes(FusionReactorRecipeHelper.reactorRecipes);
@ -247,7 +242,7 @@ public class TechRebornJeiPlugin extends BlankModPlugin {
registry.addRecipeClickArea(GuiChemicalReactor.class, 150, 4, 20, 12, RecipeCategoryUids.CHEMICAL_REACTOR); registry.addRecipeClickArea(GuiChemicalReactor.class, 150, 4, 20, 12, RecipeCategoryUids.CHEMICAL_REACTOR);
registry.addRecipeClickArea(GuiIndustrialGrinder.class, 150, 4, 20, 12, RecipeCategoryUids.INDUSTRIAL_GRINDER); registry.addRecipeClickArea(GuiIndustrialGrinder.class, 150, 4, 20, 12, RecipeCategoryUids.INDUSTRIAL_GRINDER);
registry.addRecipeClickArea(GuiIndustrialSawmill.class, 150, 4, 20, 12, RecipeCategoryUids.INDUSTRIAL_SAWMILL); registry.addRecipeClickArea(GuiIndustrialSawmill.class, 55, 35, 20, 15, RecipeCategoryUids.INDUSTRIAL_SAWMILL);
//OLD ONES //OLD ONES
registry.addRecipeClickArea(GuiAlloyFurnace.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER, registry.addRecipeClickArea(GuiAlloyFurnace.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER,

View file

@ -35,6 +35,7 @@ import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeCategory; import mezz.jei.api.recipe.BlankRecipeCategory;
import mezz.jei.util.Translator; import mezz.jei.util.Translator;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import techreborn.Core;
import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeCategoryUids;
import techreborn.compat.jei.RecipeUtil; import techreborn.compat.jei.RecipeUtil;
import techreborn.tiles.multiblock.TileIndustrialSawmill; import techreborn.tiles.multiblock.TileIndustrialSawmill;
@ -55,7 +56,6 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory<Industr
title = Translator.translateToLocal("tile.techreborn.industrialsawmill.name"); title = Translator.translateToLocal("tile.techreborn.industrialsawmill.name");
background = guiHelper.createDrawable(texture, 7, 15, 141, 55); background = guiHelper.createDrawable(texture, 7, 15, 141, 55);
tankOverlay = guiHelper.createDrawable(texture, 176, 86, 12, 47); tankOverlay = guiHelper.createDrawable(texture, 176, 86, 12, 47);
} }
@Nonnull @Nonnull
@ -82,9 +82,9 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory<Industr
guiItemStacks.init(INPUT_SLOTS[0], true, 24, 10); guiItemStacks.init(INPUT_SLOTS[0], true, 24, 10);
guiItemStacks.init(INPUT_SLOTS[1], true, 24, 28); guiItemStacks.init(INPUT_SLOTS[1], true, 24, 28);
guiItemStacks.init(OUTPUT_SLOTS[0], false, 69, 19); guiItemStacks.init(OUTPUT_SLOTS[0], false, 76, 19);
guiItemStacks.init(OUTPUT_SLOTS[1], false, 87, 19); guiItemStacks.init(OUTPUT_SLOTS[1], false, 94, 19);
guiItemStacks.init(OUTPUT_SLOTS[2], false, 105, 19); guiItemStacks.init(OUTPUT_SLOTS[2], false, 112, 19);
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileIndustrialSawmill.TANK_CAPACITY, true, tankOverlay); guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileIndustrialSawmill.TANK_CAPACITY, true, tankOverlay);

View file

@ -29,6 +29,7 @@ import javax.annotation.Nonnull;
import mezz.jei.api.IJeiHelpers; import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper; import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.Core;
import techreborn.api.recipe.machines.IndustrialSawmillRecipe; import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeCategoryUids;

View file

@ -57,7 +57,7 @@ public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper <Industria
IndustrialSawmillRecipe baseRecipe) { IndustrialSawmillRecipe baseRecipe) {
super(baseRecipe); super(baseRecipe);
IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
IDrawableStatic progressStatic = guiHelper.createDrawable(texture, 176, 14, 24, 17); IDrawableStatic progressStatic = guiHelper.createDrawable(texture, 176, 14, 20, 13);
int ticksPerCycle = baseRecipe.tickTime(); int ticksPerCycle = baseRecipe.tickTime();
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
IDrawableAnimated.StartDirection.LEFT, false); IDrawableAnimated.StartDirection.LEFT, false);
@ -84,7 +84,7 @@ public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper <Industria
@Override @Override
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY); super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
progress.draw(minecraft, 44, 20); progress.draw(minecraft, 48, 23);
if (minecraft.fontRendererObj != null) { if (minecraft.fontRendererObj != null) {
int x = 70; int x = 70;

View file

@ -90,6 +90,8 @@ public class ModRecipes {
addIc2Recipes(); addIc2Recipes();
addGrinderRecipes(); addGrinderRecipes();
addCompressorRecipes(); addCompressorRecipes();
IndustrialSawmillRecipes.init();
} }
public static void postInit(){ public static void postInit(){

View file

@ -33,28 +33,29 @@ import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import reborncore.api.recipe.RecipeHandler; import reborncore.api.recipe.RecipeHandler;
import reborncore.common.util.OreUtil; import reborncore.common.util.OreUtil;
import techreborn.api.recipe.machines.IndustrialGrinderRecipe; import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
import techreborn.items.ItemDusts; import techreborn.items.ItemDusts;
public class IndustrialSawmillRecipes extends RecipeMethods { public class IndustrialSawmillRecipes extends RecipeMethods {
static FluidStack WATER = new FluidStack(FluidRegistry.WATER, 1000); static FluidStack WATER = new FluidStack(FluidRegistry.WATER, 1000);
public static void init() { public static void init() {
register(getStack(Blocks.LOG, 1, 1), WATER, 100, 128, OreUtil.getStackFromName("plankWood", 8), ItemDusts.getDustByName("sawDust", 3), getStack(Items.PAPER,1)); register(getStack(Blocks.LOG, 1, true), getMaterial("water", Type.CELL), WATER, 100, 128, getStack(Blocks.PLANKS, 8, true), ItemDusts.getDustByName("sawDust", 3), getStack(Items.PAPER,1));
} }
static void register(ItemStack input, FluidStack fluid, int ticks, int euPerTick, ItemStack... outputs) { static void register(ItemStack input1, ItemStack input2, FluidStack fluid, int ticks, int euPerTick, ItemStack... outputs) {
if (outputs.length == 3) { if (outputs.length == 3) {
RecipeHandler.addRecipe(new IndustrialGrinderRecipe(input, RecipeHandler.addRecipe(new IndustrialSawmillRecipe(input1, input2,
fluid, outputs[0], outputs[1], outputs[2], null, ticks, euPerTick)); fluid, outputs[0], outputs[1], outputs[2], ticks, euPerTick));
} }
else if (outputs.length == 2) { else if (outputs.length == 2) {
RecipeHandler.addRecipe(new IndustrialGrinderRecipe(input, RecipeHandler.addRecipe(new IndustrialSawmillRecipe(input1, input2,
fluid, outputs[0], outputs[1], null, null, ticks, euPerTick)); fluid, outputs[0], outputs[1], null, ticks, euPerTick));
} }
else if (outputs.length == 1) { else if (outputs.length == 1) {
RecipeHandler.addRecipe(new IndustrialGrinderRecipe(input, RecipeHandler.addRecipe(new IndustrialSawmillRecipe(input1, input2,
fluid, outputs[0], null, null, null, ticks, euPerTick)); fluid, outputs[0], null, null, ticks, euPerTick));
} }
else { else {
throw new InvalidParameterException("Invalid industrial sawmill outputs: " + outputs); throw new InvalidParameterException("Invalid industrial sawmill outputs: " + outputs);