Industrial Sawmill support for JEI done
This commit is contained in:
parent
291eadfeed
commit
b136a534aa
6 changed files with 23 additions and 24 deletions
|
@ -41,7 +41,6 @@ import techreborn.api.generator.GeneratorRecipeHelper;
|
|||
import techreborn.api.reactor.FusionReactorRecipeHelper;
|
||||
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.client.gui.*;
|
||||
import techreborn.compat.CompatManager;
|
||||
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.industrialGrinder.IndustrialGrinderRecipeCategory;
|
||||
import techreborn.compat.jei.industrialGrinder.IndustrialGrinderRecipeHandler;
|
||||
import techreborn.compat.jei.industrialGrinder.IndustrialGrinderRecipeWrapper;
|
||||
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeCategory;
|
||||
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeHandler;
|
||||
import techreborn.compat.jei.rollingMachine.RollingMachineRecipeMaker;
|
||||
|
@ -188,9 +186,8 @@ public class TechRebornJeiPlugin extends BlankModPlugin {
|
|||
new ImplosionCompressorRecipeCategory(guiHelper), new IndustrialElectrolyzerRecipeCategory(guiHelper),
|
||||
new RollingMachineRecipeCategory(guiHelper), new VacuumFreezerRecipeCategory(guiHelper),
|
||||
new GrinderRecipeCategory(guiHelper), new ExtractorRecipeCategory(guiHelper),
|
||||
new CompressorRecipeCategory(guiHelper), new ScrapboxRecipeCategory(guiHelper));
|
||||
|
||||
registry.addRecipeCategories(new IndustrialSawmillRecipeCategory(guiHelper));
|
||||
new CompressorRecipeCategory(guiHelper), new ScrapboxRecipeCategory(guiHelper),
|
||||
new IndustrialSawmillRecipeCategory(guiHelper));
|
||||
|
||||
|
||||
for (final EFluidGenerator type : EFluidGenerator.values())
|
||||
|
@ -204,9 +201,7 @@ public class TechRebornJeiPlugin extends BlankModPlugin {
|
|||
new RollingMachineRecipeHandler(), new VacuumFreezerRecipeHandler(jeiHelpers),
|
||||
new GrinderRecipeHandler(jeiHelpers), new ExtractorRecipeHandler(jeiHelpers),
|
||||
new CompressorRecipeHandler(jeiHelpers), new ScrapboxRecipeHandler(jeiHelpers),
|
||||
new FluidGeneratorRecipeHandler(jeiHelpers));
|
||||
|
||||
registry.addRecipeHandlers(new IndustrialSawmillRecipeHandler(jeiHelpers));
|
||||
new FluidGeneratorRecipeHandler(jeiHelpers), new IndustrialSawmillRecipeHandler(jeiHelpers));
|
||||
|
||||
registry.addRecipes(RecipeHandler.recipeList);
|
||||
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(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
|
||||
registry.addRecipeClickArea(GuiAlloyFurnace.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER,
|
||||
|
|
|
@ -35,6 +35,7 @@ import mezz.jei.api.ingredients.IIngredients;
|
|||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
import mezz.jei.util.Translator;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import techreborn.Core;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
import techreborn.compat.jei.RecipeUtil;
|
||||
import techreborn.tiles.multiblock.TileIndustrialSawmill;
|
||||
|
@ -55,7 +56,6 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory<Industr
|
|||
title = Translator.translateToLocal("tile.techreborn.industrialsawmill.name");
|
||||
background = guiHelper.createDrawable(texture, 7, 15, 141, 55);
|
||||
tankOverlay = guiHelper.createDrawable(texture, 176, 86, 12, 47);
|
||||
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
@ -82,9 +82,9 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory<Industr
|
|||
guiItemStacks.init(INPUT_SLOTS[0], true, 24, 10);
|
||||
guiItemStacks.init(INPUT_SLOTS[1], true, 24, 28);
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 69, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 87, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 105, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[0], false, 76, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[1], false, 94, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 112, 19);
|
||||
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileIndustrialSawmill.TANK_CAPACITY, true, tankOverlay);
|
||||
|
|
|
@ -29,6 +29,7 @@ import javax.annotation.Nonnull;
|
|||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.Core;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper <Industria
|
|||
IndustrialSawmillRecipe baseRecipe) {
|
||||
super(baseRecipe);
|
||||
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();
|
||||
this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle,
|
||||
IDrawableAnimated.StartDirection.LEFT, false);
|
||||
|
@ -84,7 +84,7 @@ public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper <Industria
|
|||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
super.drawInfo(minecraft, recipeWidth, recipeHeight, mouseX, mouseY);
|
||||
progress.draw(minecraft, 44, 20);
|
||||
progress.draw(minecraft, 48, 23);
|
||||
|
||||
if (minecraft.fontRendererObj != null) {
|
||||
int x = 70;
|
||||
|
|
|
@ -90,6 +90,8 @@ public class ModRecipes {
|
|||
addIc2Recipes();
|
||||
addGrinderRecipes();
|
||||
addCompressorRecipes();
|
||||
|
||||
IndustrialSawmillRecipes.init();
|
||||
}
|
||||
|
||||
public static void postInit(){
|
||||
|
|
|
@ -33,28 +33,29 @@ import net.minecraftforge.fluids.FluidRegistry;
|
|||
import net.minecraftforge.fluids.FluidStack;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.common.util.OreUtil;
|
||||
import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.items.ItemDusts;
|
||||
|
||||
public class IndustrialSawmillRecipes extends RecipeMethods {
|
||||
static FluidStack WATER = new FluidStack(FluidRegistry.WATER, 1000);
|
||||
|
||||
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) {
|
||||
RecipeHandler.addRecipe(new IndustrialGrinderRecipe(input,
|
||||
fluid, outputs[0], outputs[1], outputs[2], null, ticks, euPerTick));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(input1, input2,
|
||||
fluid, outputs[0], outputs[1], outputs[2], ticks, euPerTick));
|
||||
}
|
||||
else if (outputs.length == 2) {
|
||||
RecipeHandler.addRecipe(new IndustrialGrinderRecipe(input,
|
||||
fluid, outputs[0], outputs[1], null, null, ticks, euPerTick));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(input1, input2,
|
||||
fluid, outputs[0], outputs[1], null, ticks, euPerTick));
|
||||
}
|
||||
else if (outputs.length == 1) {
|
||||
RecipeHandler.addRecipe(new IndustrialGrinderRecipe(input,
|
||||
fluid, outputs[0], null, null, null, ticks, euPerTick));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(input1, input2,
|
||||
fluid, outputs[0], null, null, ticks, euPerTick));
|
||||
}
|
||||
else {
|
||||
throw new InvalidParameterException("Invalid industrial sawmill outputs: " + outputs);
|
||||
|
|
Loading…
Reference in a new issue