Update JEI integration

This commit is contained in:
mezz committed 2017-04-04 03:26:39 -07:00
1 parent 79af0241e8
commit 1ea33829b3
14 files changed
+75 -110

No files matched your search

+1 -1
View File
@@ -56,7 +56,7 @@ import java.util.List;
useMetadata = true,
dependencies = "required-after:forge@[13.20.0.2230,);" +
"required-after:forestry@[5.3.2.68,);" +
"after:jei@[4.3.0,);"
"after:jei@[4.3.1,);"
)
public final class BinnieCore extends AbstractMod {
@@ -31,7 +31,7 @@ public class Drawables {
private Drawables(IGuiHelper guiHelper) {
this.guiHelper = guiHelper;
this.tank = guiHelper.createDrawable(guiTank, 8, 28, 18, 60);
this.tank = guiHelper.createDrawable(guiTank, 8, 28, 18, 60, -1, -1, -1, -1);
this.tankOverlay = guiHelper.createDrawable(guiTank, 33, 29, 16, 58);
this.arrow = guiHelper.createDrawable(guiArrow, 191, 79, 14, 10);
this.arrowWhite = guiHelper.createDrawable(guiArrow, 207, 79, 14, 10);
@@ -40,34 +40,20 @@ public class BreweryRecipeCategory extends BlankRecipeCategory<BreweryRecipeWrap
@Override
public void drawExtras(Minecraft minecraft) {
IDrawable tank = ExtraTreesJeiPlugin.drawables.getTank();
tank.draw(minecraft, 0, 0);
tank.draw(minecraft, 112, 0);
IDrawable arrow = ExtraTreesJeiPlugin.drawables.getArrow();
arrow.draw(minecraft, 90, 25);
arrowAnimated.draw(minecraft, 90, 25);
IDrawable slot = ExtraTreesJeiPlugin.guiHelper.getSlotDrawable();
// ingredients (hops)
slot.draw(minecraft, 21, 42);
// grain
slot.draw(minecraft, 42, 0);
slot.draw(minecraft, 42, 21);
slot.draw(minecraft, 42, 42);
// yeast
slot.draw(minecraft, 63, 42);
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, BreweryRecipeWrapper recipeWrapper, IIngredients ingredients) {
IDrawable tank = ExtraTreesJeiPlugin.drawables.getTank();
IDrawable tankOverlay = ExtraTreesJeiPlugin.drawables.getTankOverlay();
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
fluidStacks.init(BreweryMachine.TANK_INPUT, true, 1, 1, 16, 58, Fluid.BUCKET_VOLUME, false, tankOverlay);
fluidStacks.setBackground(BreweryMachine.TANK_INPUT, tank);
fluidStacks.init(BreweryMachine.TANK_OUTPUT, false, 113, 1, 16, 58, Fluid.BUCKET_VOLUME, false, tankOverlay);
fluidStacks.setBackground(BreweryMachine.TANK_OUTPUT, tank);
fluidStacks.set(ingredients);
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
@@ -91,5 +77,10 @@ public class BreweryRecipeCategory extends BlankRecipeCategory<BreweryRecipeWrap
itemStacks.set(3, inputs.get(1));
itemStacks.set(4, inputs.get(2));
IDrawable slot = ExtraTreesJeiPlugin.guiHelper.getSlotDrawable();
for (int i = 0; i <= 4; i++) {
itemStacks.setBackground(i, slot);
}
}
}
@@ -51,18 +51,17 @@ public class DistilleryRecipeCategory extends BlankRecipeCategory<DistilleryReci
public void drawExtras(Minecraft minecraft) {
CraftGUI.render.texture(DISTILLERY_BASE, Point.ZERO);
CraftGUI.render.texturePercentage(LIQUID_FLOW, new Area(18, 0, 38, 60), Position.LEFT, progress.getValue() / 100f);
IDrawable tank = ExtraTreesJeiPlugin.drawables.getTank();
tank.draw(minecraft, 0, 0);
tank.draw(minecraft, 64, 0);
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, DistilleryRecipeWrapper recipeWrapper, IIngredients ingredients) {
IDrawable tank = ExtraTreesJeiPlugin.drawables.getTank();
IDrawable tankOverlay = ExtraTreesJeiPlugin.drawables.getTankOverlay();
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
fluidStacks.init(DistilleryMachine.TANK_INPUT, true, 1, 1, 16, 58, DistilleryLogic.INPUT_FLUID_AMOUNT, false, tankOverlay);
fluidStacks.setBackground(DistilleryMachine.TANK_INPUT, tank);
fluidStacks.init(DistilleryMachine.TANK_OUTPUT, false, 65, 1, 16, 58, DistilleryLogic.INPUT_FLUID_AMOUNT, false, tankOverlay);
fluidStacks.setBackground(DistilleryMachine.TANK_OUTPUT, tank);
fluidStacks.set(ingredients);
}
}
@@ -36,26 +36,26 @@ public class FruitPressRecipeCategory extends BlankRecipeCategory<FruitPressReci
@Override
public void drawExtras(Minecraft minecraft) {
IDrawable tank = ExtraTreesJeiPlugin.drawables.getTank();
tank.draw(minecraft, 54, 0);
IDrawable arrow = ExtraTreesJeiPlugin.drawables.getArrow();
arrow.draw(minecraft, 27, 26);
arrowAnimated.draw(minecraft, 27, 26);
IDrawable slot = ExtraTreesJeiPlugin.guiHelper.getSlotDrawable();
slot.draw(minecraft, 0, 22);
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, FruitPressRecipeWrapper recipeWrapper, IIngredients ingredients) {
IDrawable tankOverlay = ExtraTreesJeiPlugin.drawables.getTankOverlay();
IDrawable tank = ExtraTreesJeiPlugin.drawables.getTank();
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
fluidStacks.init(FruitPressMachine.TANK_OUTPUT, false, 55, 1, 16, 58, 1000, false, tankOverlay);
fluidStacks.setBackground(FruitPressMachine.TANK_OUTPUT, tank);
fluidStacks.set(ingredients);
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init(0, true, 0, 22);
itemStacks.set(ingredients);
IDrawable slot = ExtraTreesJeiPlugin.guiHelper.getSlotDrawable();
itemStacks.setBackground(0, slot);
}
}
@@ -37,27 +37,19 @@ public class LumbermillRecipeCategory extends BlankRecipeCategory<LumbermillReci
@Override
public void drawExtras(Minecraft minecraft) {
IDrawable tank = ExtraTreesJeiPlugin.drawables.getTank();
tank.draw(minecraft, 0, 0);
IDrawable arrow = ExtraTreesJeiPlugin.drawables.getArrow();
arrow.draw(minecraft, 69, 25);
arrowAnimated.draw(minecraft, 69, 25);
IDrawable slot = ExtraTreesJeiPlugin.guiHelper.getSlotDrawable();
slot.draw(minecraft, 42, 21);
slot.draw(minecraft, 112, 0);
slot.draw(minecraft, 92, 21);
slot.draw(minecraft, 112, 42);
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, LumbermillRecipeWrapper recipeWrapper, IIngredients ingredients) {
IDrawable tankOverlay = ExtraTreesJeiPlugin.drawables.getTankOverlay();
IDrawable tank = ExtraTreesJeiPlugin.drawables.getTank();
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
fluidStacks.init(LumbermillMachine.TANK_WATER, true, 1, 1, 16, 58, LumbermillMachine.TANK_WATER_CAPACITY, false, tankOverlay);
fluidStacks.setBackground(LumbermillMachine.TANK_WATER, tank);
fluidStacks.set(ingredients);
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
@@ -68,5 +60,10 @@ public class LumbermillRecipeCategory extends BlankRecipeCategory<LumbermillReci
itemStacks.init(2, false, 92, 21);
itemStacks.init(3, false, 112, 42);
itemStacks.set(ingredients);
IDrawable slot = ExtraTreesJeiPlugin.guiHelper.getSlotDrawable();
for (int i = 0; i <= 3; i++) {
itemStacks.setBackground(i, slot);
}
}
}
@@ -7,7 +7,6 @@ import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeCategory;
import net.minecraft.client.Minecraft;
public class DatabaseRecipeCategory extends BlankRecipeCategory<DatabaseRecipeWrapper> {
@Override
@@ -25,13 +24,6 @@ public class DatabaseRecipeCategory extends BlankRecipeCategory<DatabaseRecipeWr
return GeneticsJeiPlugin.guiHelper.createBlankDrawable(140, 75);
}
@Override
public void drawExtras(Minecraft minecraft) {
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
slot.draw(minecraft, 30, 0);
slot.draw(minecraft, 85, 0);
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, DatabaseRecipeWrapper recipeWrapper, IIngredients ingredients) {
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
@@ -40,5 +32,9 @@ public class DatabaseRecipeCategory extends BlankRecipeCategory<DatabaseRecipeWr
itemStacks.init(2, false, 85, 0);
itemStacks.set(ingredients);
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
itemStacks.setBackground(0, slot);
itemStacks.setBackground(2, slot);
}
}
@@ -36,30 +36,29 @@ public class GenepoolRecipeCategory extends BlankRecipeCategory<GenepoolRecipeWr
@Override
public void drawExtras(Minecraft minecraft) {
IDrawable tank = GeneticsJeiPlugin.drawables.getTank();
tank.draw(minecraft, 0, 0);
tank.draw(minecraft, 95, 0);
IDrawable arrow = GeneticsJeiPlugin.drawables.getArrow();
arrow.draw(minecraft, 69, 45);
arrowAnimated.draw(minecraft, 69, 45);
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
slot.draw(minecraft, 22, 0);
slot.draw(minecraft, 42, 41);
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, GenepoolRecipeWrapper recipeWrapper, IIngredients ingredients) {
IDrawable tank = GeneticsJeiPlugin.drawables.getTank();
IDrawable tankOverlay = GeneticsJeiPlugin.drawables.getTankOverlay();
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
fluidStacks.init(Genepool.TANK_DNA, false, 96, 1, 16, 58, 100, false, tankOverlay);
fluidStacks.setBackground(Genepool.TANK_DNA, tank);
fluidStacks.init(Genepool.TANK_ETHANOL, true, 1, 1, 16, 58, 100, false, tankOverlay);
fluidStacks.setBackground(Genepool.TANK_ETHANOL, tank);
fluidStacks.set(ingredients);
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init(0, true, 22, 0);
itemStacks.init(1, true, 42, 41);
itemStacks.set(ingredients);
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
itemStacks.setBackground(0, slot);
itemStacks.setBackground(1, slot);
}
}
@@ -36,30 +36,29 @@ public class IncubatorRecipeCategory extends BlankRecipeCategory<IncubatorRecipe
@Override
public void drawExtras(Minecraft minecraft) {
IDrawable tank = GeneticsJeiPlugin.drawables.getTank();
tank.draw(minecraft, 0, 0);
tank.draw(minecraft, 94, 0);
IDrawable arrow = GeneticsJeiPlugin.drawables.getArrow();
arrow.draw(minecraft, 49, 26);
arrowAnimated.draw(minecraft, 49, 26);
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
slot.draw(minecraft, 22, 22);
slot.draw(minecraft, 72, 22);
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, IncubatorRecipeWrapper recipeWrapper, IIngredients ingredients) {
IDrawable tank = GeneticsJeiPlugin.drawables.getTank();
IDrawable tankOverlay = GeneticsJeiPlugin.drawables.getTankOverlay();
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
fluidStacks.init(Incubator.TANK_INPUT, true, 1, 1, 16, 58, 50, false, tankOverlay);
fluidStacks.setBackground(Incubator.TANK_INPUT, tank);
fluidStacks.init(Incubator.TANK_OUTPUT, false, 95, 1, 16, 58, 50, false, tankOverlay);
fluidStacks.setBackground(Incubator.TANK_OUTPUT, tank);
fluidStacks.set(ingredients);
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init(0, true, 22, 22);
itemStacks.init(1, false, 72, 22);
itemStacks.set(ingredients);
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
itemStacks.setBackground(0, slot);
itemStacks.setBackground(1, slot);
}
}
@@ -51,28 +51,19 @@ public class InoculatorRecipeCategory extends BlankRecipeCategory<InoculatorReci
@Override
public void drawExtras(Minecraft minecraft) {
if (!splicer) {
IDrawable tank = GeneticsJeiPlugin.drawables.getTank();
tank.draw(minecraft, 0, 0);
}
IDrawable arrow = GeneticsJeiPlugin.drawables.getArrow();
arrow.draw(minecraft, 69, 25);
arrowAnimated.draw(minecraft, 69, 25);
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
slot.draw(minecraft, 22, 0);
slot.draw(minecraft, 42, 21);
slot.draw(minecraft, 92, 21);
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, InoculatorRecipeWrapper recipeWrapper, IIngredients ingredients) {
if (!splicer) {
IDrawable tank = GeneticsJeiPlugin.drawables.getTank();
IDrawable tankOverlay = GeneticsJeiPlugin.drawables.getTankOverlay();
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
fluidStacks.init(Inoculator.TANK_VEKTOR, true, 1, 1, 16, 58, 100, false, tankOverlay);
fluidStacks.setBackground(Inoculator.TANK_VEKTOR, tank);
fluidStacks.set(ingredients);
}
@@ -81,6 +72,11 @@ public class InoculatorRecipeCategory extends BlankRecipeCategory<InoculatorReci
itemStacks.init(1, true, 42, 21);
itemStacks.init(2, false, 92, 21);
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
for (int i = 0; i <= 2; i++) {
itemStacks.setBackground(i, slot);
}
recipeWrapper.setCurrentIngredients(itemStacks.getGuiIngredients());
IFocus<?> focus = recipeLayout.getFocus();
@@ -41,20 +41,10 @@ public class IsolatorRecipeCategory extends BlankRecipeCategory<IsolatorRecipeWr
@Override
@SideOnly(Side.CLIENT)
public void drawExtras(Minecraft minecraft) {
IDrawable tank = GeneticsJeiPlugin.drawables.getTank();
tank.draw(minecraft, 0, 0);
IDrawable arrow = GeneticsJeiPlugin.drawables.getArrow();
arrow.draw(minecraft, 69, 25);
arrowAnimated.draw(minecraft, 69, 25);
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
slot.draw(minecraft, 22, 0);
slot.draw(minecraft, 42, 21);
slot.draw(minecraft, 22, 42);
slot.draw(minecraft, 92, 21);
String randomText = "(Random)";
int textWidth = minecraft.fontRendererObj.getStringWidth(randomText);
minecraft.fontRendererObj.drawString(randomText, 102 - (textWidth / 2), 45, Color.gray.getRGB());
@@ -62,9 +52,11 @@ public class IsolatorRecipeCategory extends BlankRecipeCategory<IsolatorRecipeWr
@Override
public void setRecipe(IRecipeLayout recipeLayout, IsolatorRecipeWrapper recipeWrapper, IIngredients ingredients) {
IDrawable tank = GeneticsJeiPlugin.drawables.getTank();
IDrawable tankOverlay = GeneticsJeiPlugin.drawables.getTankOverlay();
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
fluidStacks.init(Isolator.TANK_ETHANOL, true, 1, 1, 16, 58, 100, false, tankOverlay);
fluidStacks.setBackground(Isolator.TANK_ETHANOL, tank);
fluidStacks.set(ingredients);
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
@@ -73,5 +65,10 @@ public class IsolatorRecipeCategory extends BlankRecipeCategory<IsolatorRecipeWr
itemStacks.init(2, true, 22, 42);
itemStacks.init(3, false, 92, 21);
itemStacks.set(ingredients);
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
for (int i = 0; i <= 3; i++) {
itemStacks.setBackground(i, slot);
}
}
}
@@ -1,6 +1,5 @@
package binnie.genetics.integration.jei.polymeriser;
import binnie.core.integration.jei.Drawables;
import binnie.genetics.integration.jei.GeneticsJeiPlugin;
import binnie.genetics.integration.jei.RecipeUids;
import binnie.genetics.machine.polymeriser.Polymeriser;
@@ -31,21 +30,10 @@ public class PolymeriserRecipeCategory extends BlankRecipeCategory<PolymeriserRe
@Override
public void drawExtras(Minecraft minecraft) {
Drawables drawables = GeneticsJeiPlugin.drawables;
IDrawable tank = drawables.getTank();
tank.draw(minecraft, 0, 0);
tank.draw(minecraft, 20, 0);
IDrawable arrow = drawables.getArrow();
IDrawable arrow = GeneticsJeiPlugin.drawables.getArrow();
arrow.draw(minecraft, 69, 25);
IDrawableAnimated arrowAnimated = drawables.getArrowAnimated();
IDrawableAnimated arrowAnimated = GeneticsJeiPlugin.drawables.getArrowAnimated();
arrowAnimated.draw(minecraft, 69, 25);
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
slot.draw(minecraft, 42, 21);
slot.draw(minecraft, 42, 42);
slot.draw(minecraft, 92, 21);
}
@Override
@@ -56,16 +44,24 @@ public class PolymeriserRecipeCategory extends BlankRecipeCategory<PolymeriserRe
itemStacks.init(2, false, 92, 21);
itemStacks.set(ingredients);
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
for (int i = 0; i <= 2; i++) {
itemStacks.setBackground(i, slot);
}
itemStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> {
if (slotIndex == 1) {
tooltip.add("5x Processing Speed");
}
});
IDrawable tank = GeneticsJeiPlugin.drawables.getTank();
IDrawable tankOverlay = GeneticsJeiPlugin.drawables.getTankOverlay();
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
fluidStacks.init(Polymeriser.TANK_BACTERIA, true, 1, 1, 16, 58, 10000, false, tankOverlay);
fluidStacks.setBackground(Polymeriser.TANK_BACTERIA, tank);
fluidStacks.init(Polymeriser.TANK_DNA, true, 21, 1, 16, 58, 10000, false, tankOverlay);
fluidStacks.setBackground(Polymeriser.TANK_DNA, tank);
fluidStacks.set(ingredients);
}
}
@@ -7,7 +7,6 @@ import mezz.jei.api.gui.IGuiItemStackGroup;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.ingredients.IIngredients;
import mezz.jei.api.recipe.BlankRecipeCategory;
import net.minecraft.client.Minecraft;
public class SequencerRecipeCategory extends BlankRecipeCategory<SequencerRecipeWrapper> {
@Override
@@ -25,15 +24,6 @@ public class SequencerRecipeCategory extends BlankRecipeCategory<SequencerRecipe
return GeneticsJeiPlugin.guiHelper.createBlankDrawable(72, 41);
}
@Override
public void drawExtras(Minecraft minecraft) {
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
slot.draw(minecraft, 0, 0);
slot.draw(minecraft, 0, 21);
slot.draw(minecraft, 52, 21);
}
@Override
public void setRecipe(IRecipeLayout recipeLayout, SequencerRecipeWrapper recipeWrapper, IIngredients ingredients) {
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
@@ -42,5 +32,10 @@ public class SequencerRecipeCategory extends BlankRecipeCategory<SequencerRecipe
itemStacks.init(2, true, 52, 0);
itemStacks.init(3, false, 52, 21);
itemStacks.set(ingredients);
IDrawable slot = GeneticsJeiPlugin.guiHelper.getSlotDrawable();
for (int i = 0; i <= 3; i++) {
itemStacks.setBackground(i, slot);
}
}
}