mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Cleanup background handling of JEI categories
This commit is contained in:
1 parent
790ce78668
commit
7c6441a411
18 files changed
+39
-186
No files matched your search
@@ -45,8 +45,10 @@ public abstract class BaseRecipeCategory implements IRecipeCategory<IRecipeWrapp
|
||||
private String recipeName;
|
||||
private String unlocalizedName;
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public BaseRecipeCategory(IGuiHelper helper, String guiTexture, String name, String unlocalized,
|
||||
@Nullable ProgressBar progress) {
|
||||
@Nullable ProgressBar progress, int xOffset, int yOffset, int width, int height) {
|
||||
guiHelper = helper;
|
||||
guiLocation = new ResourceLocation(guiTexture);
|
||||
|
||||
@@ -62,6 +64,10 @@ public abstract class BaseRecipeCategory implements IRecipeCategory<IRecipeWrapp
|
||||
fluidOverlaySmall = guiHelper.createDrawable(resource, 19, 1, 16, 29);
|
||||
|
||||
addGuiElements();
|
||||
|
||||
this.xOffset = xOffset;
|
||||
this.yOffset = yOffset;
|
||||
background = guiHelper.createDrawable(guiLocation, xOffset, yOffset, width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,6 +122,11 @@ public abstract class BaseRecipeCategory implements IRecipeCategory<IRecipeWrapp
|
||||
public void addGuiElements() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getIcon() {
|
||||
return null;
|
||||
|
||||
@@ -16,7 +16,6 @@ import mekanism.common.recipe.machines.AdvancedMachineRecipe;
|
||||
import mekanism.common.recipe.outputs.ItemStackOutput;
|
||||
import mekanism.common.tile.prefab.TileEntityAdvancedElectricMachine;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiIngredientGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
@@ -25,11 +24,8 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
public class AdvancedMachineRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public AdvancedMachineRecipeCategory(IGuiHelper helper, String name, String unlocalized, ProgressBar progress) {
|
||||
super(helper, "mekanism:gui/GuiAdvancedMachine.png", name, unlocalized, progress);
|
||||
background = guiHelper.createDrawable(guiLocation, 28, 16, 144, 54);
|
||||
super(helper, "mekanism:gui/GuiAdvancedMachine.png", name, unlocalized, progress, 28, 16, 144, 54);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,11 +48,6 @@ public class AdvancedMachineRecipeCategory extends BaseRecipeCategory {
|
||||
}, progressBar, this, guiLocation, 77, 37));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
if (recipeWrapper instanceof AdvancedMachineRecipeWrapper) {
|
||||
|
||||
@@ -13,7 +13,6 @@ import mekanism.common.recipe.inputs.ItemStackInput;
|
||||
import mekanism.common.recipe.machines.ChanceMachineRecipe;
|
||||
import mekanism.common.recipe.outputs.ChanceOutput;
|
||||
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.ingredients.IIngredients;
|
||||
@@ -21,18 +20,15 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
public class ChanceMachineRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public ChanceMachineRecipeCategory(IGuiHelper helper, String name, String unlocalized, ProgressBar progress) {
|
||||
super(helper, "mekanism:gui/GuiBasicMachine.png", name, unlocalized, progress);
|
||||
background = guiHelper.createDrawable(guiLocation, 28, 16, 144, 54);
|
||||
super(helper, "mekanism:gui/GuiBasicMachine.png", name, unlocalized, progress, 28, 16, 144, 54);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addGuiElements() {
|
||||
guiElements.add(new GuiSlot(SlotType.INPUT, this, guiLocation, 55, 16));
|
||||
guiElements.add(new GuiSlot(SlotType.POWER, this, guiLocation, 55, 52).with(SlotOverlay.POWER));
|
||||
guiElements.add(new GuiSlot(SlotType.OUTPUT_WIDE, this, guiLocation, 111, 30));
|
||||
guiElements.add(new GuiSlot(SlotType.INPUT, this, guiLocation, 55, 16));
|
||||
guiElements.add(new GuiSlot(SlotType.POWER, this, guiLocation, 55, 52).with(SlotOverlay.POWER));
|
||||
guiElements.add(new GuiSlot(SlotType.OUTPUT_WIDE, this, guiLocation, 111, 30));
|
||||
guiElements.add(new GuiPowerBar(this, new IPowerInfoHandler() {
|
||||
@Override
|
||||
public double getLevel() {
|
||||
@@ -47,11 +43,6 @@ public class ChanceMachineRecipeCategory extends BaseRecipeCategory {
|
||||
}, progressBar, this, guiLocation, 77, 37));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
if (recipeWrapper instanceof ChanceMachineRecipeWrapper) {
|
||||
|
||||
@@ -13,7 +13,6 @@ import mekanism.common.recipe.inputs.DoubleMachineInput;
|
||||
import mekanism.common.recipe.machines.DoubleMachineRecipe;
|
||||
import mekanism.common.recipe.outputs.ItemStackOutput;
|
||||
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.ingredients.IIngredients;
|
||||
@@ -21,11 +20,8 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
public class DoubleMachineRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public DoubleMachineRecipeCategory(IGuiHelper helper, String name, String unlocalized, ProgressBar progress) {
|
||||
super(helper, "mekanism:gui/guibasicmachine.png", name, unlocalized, progress);
|
||||
background = guiHelper.createDrawable(guiLocation, 28, 16, 144, 54);
|
||||
super(helper, "mekanism:gui/guibasicmachine.png", name, unlocalized, progress, 28, 16, 144, 54);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,11 +44,6 @@ public class DoubleMachineRecipeCategory extends BaseRecipeCategory {
|
||||
}, progressBar, this, guiLocation, 77, 37));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
if (recipeWrapper instanceof DoubleMachineRecipeWrapper) {
|
||||
|
||||
@@ -10,7 +10,6 @@ import mekanism.client.gui.element.GuiSlot.SlotOverlay;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotType;
|
||||
import mekanism.client.jei.BaseRecipeCategory;
|
||||
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.ingredients.IIngredients;
|
||||
@@ -18,11 +17,8 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
public class MachineRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public MachineRecipeCategory(IGuiHelper helper, String name, String unlocalized, ProgressBar progress) {
|
||||
super(helper, "mekanism:gui/GuiBasicMachine.png", name, unlocalized, progress);
|
||||
background = guiHelper.createDrawable(guiLocation, 28, 16, 144, 54);
|
||||
super(helper, "mekanism:gui/GuiBasicMachine.png", name, unlocalized, progress, 28, 16, 144, 54);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44,11 +40,6 @@ public class MachineRecipeCategory extends BaseRecipeCategory {
|
||||
}, progressBar, this, guiLocation, 77, 37));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
if (recipeWrapper instanceof MachineRecipeWrapper) {
|
||||
|
||||
+1
-12
@@ -5,7 +5,6 @@ import mekanism.client.jei.BaseRecipeCategory;
|
||||
import mekanism.client.jei.MekanismJEI;
|
||||
import mekanism.common.recipe.machines.CrystallizerRecipe;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiIngredientGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
@@ -15,14 +14,9 @@ import net.minecraft.client.Minecraft;
|
||||
|
||||
public class ChemicalCrystallizerRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public ChemicalCrystallizerRecipeCategory(IGuiHelper helper) {
|
||||
super(helper, "mekanism:gui/nei/GuiChemicalCrystallizer.png", "chemical_crystallizer",
|
||||
"tile.MachineBlock2.ChemicalCrystallizer.name", null);
|
||||
xOffset = 5;
|
||||
yOffset = 3;
|
||||
background = guiHelper.createDrawable(guiLocation, xOffset, yOffset, 147, 79);
|
||||
"tile.MachineBlock2.ChemicalCrystallizer.name", null, 5, 3, 147, 79);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -31,11 +25,6 @@ public class ChemicalCrystallizerRecipeCategory extends BaseRecipeCategory {
|
||||
drawTexturedRect(53 - xOffset, 61 - yOffset, 176, 63, (int) (48 * ((float) timer.getValue() / 20F)), 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
if (recipeWrapper instanceof ChemicalCrystallizerRecipeWrapper) {
|
||||
|
||||
+1
-12
@@ -7,7 +7,6 @@ import mekanism.common.MekanismFluids;
|
||||
import mekanism.common.recipe.machines.DissolutionRecipe;
|
||||
import mekanism.common.tile.TileEntityChemicalDissolutionChamber;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiIngredientGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
@@ -17,14 +16,9 @@ import net.minecraft.client.Minecraft;
|
||||
|
||||
public class ChemicalDissolutionChamberRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public ChemicalDissolutionChamberRecipeCategory(IGuiHelper helper) {
|
||||
super(helper, "mekanism:gui/nei/GuiChemicalDissolutionChamber.png", "chemical_dissolution_chamber",
|
||||
"gui.chemicalDissolutionChamber.short", null);
|
||||
xOffset = 3;
|
||||
yOffset = 3;
|
||||
background = guiHelper.createDrawable(guiLocation, xOffset, yOffset, 170, 79);
|
||||
"gui.chemicalDissolutionChamber.short", null, 3, 3, 170, 79);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -33,11 +27,6 @@ public class ChemicalDissolutionChamberRecipeCategory extends BaseRecipeCategory
|
||||
drawTexturedRect(64 - xOffset, 40 - yOffset, 176, 63, (int) (48 * ((float) timer.getValue() / 20F)), 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
if (recipeWrapper instanceof ChemicalDissolutionChamberRecipeWrapper) {
|
||||
|
||||
+3
-13
@@ -5,7 +5,6 @@ import mekanism.client.jei.BaseRecipeCategory;
|
||||
import mekanism.client.jei.MekanismJEI;
|
||||
import mekanism.common.recipe.machines.ChemicalInfuserRecipe;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiIngredientGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
@@ -14,14 +13,9 @@ import net.minecraft.client.Minecraft;
|
||||
|
||||
public class ChemicalInfuserRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public ChemicalInfuserRecipeCategory(IGuiHelper helper) {
|
||||
super(helper, "mekanism:gui/nei/GuiChemicalInfuser.png", "chemical_infuser",
|
||||
"tile.MachineBlock2.ChemicalInfuser.name", null);
|
||||
xOffset = 3;
|
||||
yOffset = 3;
|
||||
background = guiHelper.createDrawable(guiLocation, xOffset, yOffset, 170, 80);
|
||||
"tile.MachineBlock2.ChemicalInfuser.name", null, 3, 3, 170, 80);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -31,11 +25,6 @@ public class ChemicalInfuserRecipeCategory extends BaseRecipeCategory {
|
||||
drawTexturedRect(101 - xOffset, 39 - yOffset, 176, 63, 28, 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
if (recipeWrapper instanceof ChemicalInfuserRecipeWrapper) {
|
||||
@@ -43,7 +32,8 @@ public class ChemicalInfuserRecipeCategory extends BaseRecipeCategory {
|
||||
IGuiIngredientGroup<GasStack> gasStacks = recipeLayout.getIngredientsGroup(MekanismJEI.TYPE_GAS);
|
||||
initGas(gasStacks, 0, true, 26 - xOffset, 14 - yOffset, 16, 58, tempRecipe.getInput().leftGas, true);
|
||||
initGas(gasStacks, 1, true, 134 - xOffset, 14 - yOffset, 16, 58, tempRecipe.getInput().rightGas, true);
|
||||
initGas(gasStacks, 2, false, 80 - xOffset, 5 - yOffset, 16, 58, tempRecipe.getOutput().output, true);return;
|
||||
initGas(gasStacks, 2, false, 80 - xOffset, 5 - yOffset, 16, 58, tempRecipe.getOutput().output, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -16,7 +16,8 @@ public class ChemicalInfuserRecipeWrapper implements IRecipeWrapper {
|
||||
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
ingredients.setInputs(MekanismJEI.TYPE_GAS, Arrays.asList(recipe.recipeInput.leftGas, recipe.recipeInput.rightGas));
|
||||
ingredients
|
||||
.setInputs(MekanismJEI.TYPE_GAS, Arrays.asList(recipe.recipeInput.leftGas, recipe.recipeInput.rightGas));
|
||||
ingredients.setOutput(MekanismJEI.TYPE_GAS, recipe.recipeOutput.output);
|
||||
}
|
||||
|
||||
|
||||
+1
-12
@@ -12,7 +12,6 @@ import mekanism.client.jei.BaseRecipeCategory;
|
||||
import mekanism.client.jei.MekanismJEI;
|
||||
import mekanism.common.recipe.machines.OxidationRecipe;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiIngredientGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
@@ -21,14 +20,9 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
public class ChemicalOxidizerRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public ChemicalOxidizerRecipeCategory(IGuiHelper helper) {
|
||||
super(helper, "mekanism:gui/GuiChemicalOxidizer.png", "chemical_oxidizer",
|
||||
"tile.MachineBlock2.ChemicalOxidizer.name", ProgressBar.LARGE_RIGHT);
|
||||
xOffset = 20;
|
||||
yOffset = 12;
|
||||
background = guiHelper.createDrawable(guiLocation, xOffset, yOffset, 132, 62);
|
||||
"tile.MachineBlock2.ChemicalOxidizer.name", ProgressBar.LARGE_RIGHT, 20, 12, 132, 62);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -43,11 +37,6 @@ public class ChemicalOxidizerRecipeCategory extends BaseRecipeCategory {
|
||||
}, progressBar, this, guiLocation, 62, 39));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
if (recipeWrapper instanceof ChemicalOxidizerRecipeWrapper) {
|
||||
|
||||
+1
-12
@@ -6,7 +6,6 @@ import mekanism.client.jei.MekanismJEI;
|
||||
import mekanism.common.recipe.machines.WasherRecipe;
|
||||
import mekanism.common.tile.TileEntityChemicalWasher;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiIngredientGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
@@ -17,14 +16,9 @@ import net.minecraft.client.Minecraft;
|
||||
|
||||
public class ChemicalWasherRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public ChemicalWasherRecipeCategory(IGuiHelper helper) {
|
||||
super(helper, "mekanism:gui/nei/GuiChemicalWasher.png", "chemical_washer",
|
||||
"tile.MachineBlock2.ChemicalWasher.name", null);
|
||||
xOffset = 3;
|
||||
yOffset = 3;
|
||||
background = guiHelper.createDrawable(guiLocation, xOffset, yOffset, 170, 70);
|
||||
"tile.MachineBlock2.ChemicalWasher.name", null, 3, 3, 170, 70);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -33,11 +27,6 @@ public class ChemicalWasherRecipeCategory extends BaseRecipeCategory {
|
||||
drawTexturedRect(61 - xOffset, 39 - yOffset, 176, 63, 55, 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
if (recipeWrapper instanceof ChemicalWasherRecipeWrapper) {
|
||||
|
||||
@@ -19,7 +19,8 @@ public class ChemicalWasherRecipeWrapper implements IRecipeWrapper {
|
||||
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
ingredients.setInput(VanillaTypes.FLUID, new FluidStack(FluidRegistry.WATER, TileEntityChemicalWasher.WATER_USAGE));
|
||||
ingredients
|
||||
.setInput(VanillaTypes.FLUID, new FluidStack(FluidRegistry.WATER, TileEntityChemicalWasher.WATER_USAGE));
|
||||
ingredients.setInput(MekanismJEI.TYPE_GAS, recipe.recipeInput.ingredient);
|
||||
ingredients.setOutput(MekanismJEI.TYPE_GAS, recipe.recipeOutput.output);
|
||||
}
|
||||
|
||||
+1
-14
@@ -16,7 +16,6 @@ import mekanism.client.jei.BaseRecipeCategory;
|
||||
import mekanism.client.jei.MekanismJEI;
|
||||
import mekanism.common.recipe.machines.SeparatorRecipe;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiIngredientGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
@@ -26,16 +25,9 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
public class ElectrolyticSeparatorRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public ElectrolyticSeparatorRecipeCategory(IGuiHelper helper) {
|
||||
super(helper, "mekanism:gui/GuiElectrolyticSeparator.png", "electrolytic_separator",
|
||||
"tile.MachineBlock2.ElectrolyticSeparator.name", ProgressBar.BI);
|
||||
|
||||
xOffset = 4;
|
||||
yOffset = 9;
|
||||
|
||||
background = guiHelper.createDrawable(guiLocation, xOffset, yOffset, 167, 62);
|
||||
"tile.MachineBlock2.ElectrolyticSeparator.name", ProgressBar.BI, 4, 9, 167, 62);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -61,11 +53,6 @@ public class ElectrolyticSeparatorRecipeCategory extends BaseRecipeCategory {
|
||||
}, progressBar, this, guiLocation, 78, 29));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
if (recipeWrapper instanceof ElectrolyticSeparatorRecipeWrapper) {
|
||||
|
||||
+1
-12
@@ -16,7 +16,6 @@ import mekanism.client.gui.element.GuiSlot.SlotType;
|
||||
import mekanism.client.jei.BaseRecipeCategory;
|
||||
import mekanism.common.recipe.machines.MetallurgicInfuserRecipe;
|
||||
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.ingredients.IIngredients;
|
||||
@@ -25,14 +24,9 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class MetallurgicInfuserRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public MetallurgicInfuserRecipeCategory(IGuiHelper helper) {
|
||||
super(helper, "mekanism:gui/GuiMetallurgicInfuser.png", "metallurgic_infuser",
|
||||
"tile.MachineBlock.MetallurgicInfuser.name", ProgressBar.MEDIUM);
|
||||
xOffset = 5;
|
||||
yOffset = 16;
|
||||
background = guiHelper.createDrawable(guiLocation, xOffset, yOffset, 166, 54);
|
||||
"tile.MachineBlock.MetallurgicInfuser.name", ProgressBar.MEDIUM, 5, 16, 166, 54);
|
||||
}
|
||||
|
||||
public static List<ItemStack> getInfuseStacks(InfuseType type) {
|
||||
@@ -60,11 +54,6 @@ public class MetallurgicInfuserRecipeCategory extends BaseRecipeCategory {
|
||||
}, ProgressBar.MEDIUM, this, guiLocation, 70, 46));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
if (recipeWrapper instanceof MetallurgicInfuserRecipeWrapper) {
|
||||
|
||||
@@ -16,7 +16,6 @@ import mekanism.client.jei.BaseRecipeCategory;
|
||||
import mekanism.client.jei.MekanismJEI;
|
||||
import mekanism.common.recipe.machines.PressurizedRecipe;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiIngredientGroup;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
@@ -26,14 +25,9 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
public class PRCRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public PRCRecipeCategory(IGuiHelper helper) {
|
||||
super(helper, "mekanism:gui/nei/GuiPRC.png", "pressurized_reaction_chamber",
|
||||
"tile.MachineBlock2.PressurizedReactionChamber.short.name", ProgressBar.MEDIUM);
|
||||
xOffset = 3;
|
||||
yOffset = 11;
|
||||
background = guiHelper.createDrawable(guiLocation, xOffset, yOffset, 170, 68);
|
||||
"tile.MachineBlock2.PressurizedReactionChamber.short.name", ProgressBar.MEDIUM, 3, 11, 170, 68);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,11 +52,6 @@ public class PRCRecipeCategory extends BaseRecipeCategory {
|
||||
}, progressBar, this, guiLocation, 75, 37));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
if (recipeWrapper instanceof PRCRecipeWrapper) {
|
||||
@@ -77,7 +66,8 @@ public class PRCRecipeCategory extends BaseRecipeCategory {
|
||||
fluidStacks.set(0, tempRecipe.recipeInput.getFluid());
|
||||
IGuiIngredientGroup<GasStack> gasStacks = recipeLayout.getIngredientsGroup(MekanismJEI.TYPE_GAS);
|
||||
initGas(gasStacks, 0, true, 29 - xOffset, 11 - yOffset, 16, 58, tempRecipe.recipeInput.getGas(), true);
|
||||
initGas(gasStacks, 1, false, 141 - xOffset, 41 - yOffset, 16, 28, tempRecipe.recipeOutput.getGasOutput(), true);
|
||||
initGas(gasStacks, 1, false, 141 - xOffset, 41 - yOffset, 16, 28, tempRecipe.recipeOutput.getGasOutput(),
|
||||
true);
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-16
@@ -4,7 +4,6 @@ import mekanism.api.gas.GasStack;
|
||||
import mekanism.client.jei.BaseRecipeCategory;
|
||||
import mekanism.client.jei.MekanismJEI;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IGuiIngredientGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
@@ -15,33 +14,20 @@ import net.minecraft.client.Minecraft;
|
||||
|
||||
public class RotaryCondensentratorRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
private final boolean condensentrating;
|
||||
|
||||
public RotaryCondensentratorRecipeCategory(IGuiHelper helper, boolean condensentrating) {
|
||||
super(helper, "mekanism:gui/nei/GuiRotaryCondensentrator.png",
|
||||
condensentrating ? "rotary_condensentrator_condensentrating"
|
||||
: "rotary_condensentrator_decondensentrating",
|
||||
condensentrating ? "gui.condensentrating" : "gui.decondensentrating", null);
|
||||
xOffset = 3;
|
||||
yOffset = 12;
|
||||
background = guiHelper.createDrawable(guiLocation, xOffset, yOffset, 170, 71);
|
||||
condensentrating ? "gui.condensentrating" : "gui.decondensentrating", null, 3, 12, 170, 71);
|
||||
this.condensentrating = condensentrating;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft) {
|
||||
super.drawExtras(minecraft);
|
||||
if (condensentrating) {
|
||||
drawTexturedRect(64 - xOffset, 39 - yOffset, 176, 123, 48, 8);
|
||||
} else {
|
||||
drawTexturedRect(64 - xOffset, 39 - yOffset, 176, 115, 48, 8);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
drawTexturedRect(64 - xOffset, 39 - yOffset, 176, condensentrating ? 123 : 115, 48, 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,7 +5,6 @@ import mekanism.client.jei.BaseRecipeCategory;
|
||||
import mekanism.client.jei.MekanismJEI;
|
||||
import mekanism.common.recipe.machines.SolarNeutronRecipe;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiIngredientGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
@@ -14,14 +13,9 @@ import net.minecraft.client.Minecraft;
|
||||
|
||||
public class SolarNeutronRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public SolarNeutronRecipeCategory(IGuiHelper helper) {
|
||||
super(helper, "mekanism:gui/nei/GuiSolarNeutronActivator.png", "solar_neutron_activator",
|
||||
"tile.MachineBlock3.SolarNeutronActivator.name", null);
|
||||
xOffset = 3;
|
||||
yOffset = 12;
|
||||
background = guiHelper.createDrawable(guiLocation, xOffset, yOffset, 170, 70);
|
||||
"tile.MachineBlock3.SolarNeutronActivator.name", null, 3, 12, 170, 70);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -30,11 +24,6 @@ public class SolarNeutronRecipeCategory extends BaseRecipeCategory {
|
||||
drawTexturedRect(64 - xOffset, 39 - yOffset, 176, 58, 55, 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
if (recipeWrapper instanceof SolarNeutronRecipeWrapper) {
|
||||
|
||||
+1
-12
@@ -3,7 +3,6 @@ package mekanism.client.jei.machine.other;
|
||||
import mekanism.client.jei.BaseRecipeCategory;
|
||||
import mekanism.common.recipe.machines.ThermalEvaporationRecipe;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
@@ -12,14 +11,9 @@ import net.minecraft.client.Minecraft;
|
||||
|
||||
public class ThermalEvaporationRecipeCategory extends BaseRecipeCategory {
|
||||
|
||||
private final IDrawable background;
|
||||
|
||||
public ThermalEvaporationRecipeCategory(IGuiHelper helper) {
|
||||
super(helper, "mekanism:gui/nei/GuiThermalEvaporationController.png", "thermal_evaporation_plant",
|
||||
"gui.thermalEvaporationController.short", null);
|
||||
xOffset = 3;
|
||||
yOffset = 12;
|
||||
background = guiHelper.createDrawable(guiLocation, xOffset, yOffset, 170, 62);
|
||||
"gui.thermalEvaporationController.short", null, 3, 12, 170, 62);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -28,11 +22,6 @@ public class ThermalEvaporationRecipeCategory extends BaseRecipeCategory {
|
||||
drawTexturedRect(49 - xOffset, 64 - yOffset, 176, 59, 78, 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
if (recipeWrapper instanceof ThermalEvaporationRecipeWrapper) {
|
||||
|
||||
Reference in new issue
Block a user