Skip to content

Commit

Permalink
Change EMI terra plate recipe display to be more similar to JEI/REI
Browse files Browse the repository at this point in the history
(also fix JEI showing apothecary for runic altar recipes)
  • Loading branch information
TheRealWormbo committed Apr 30, 2024
1 parent 5102613 commit 9387a65
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@
import dev.emi.emi.api.widget.WidgetHolder;

import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.ResourceLocation;

import vazkii.botania.api.recipe.TerrestrialAgglomerationRecipe;
import vazkii.botania.common.block.BotaniaBlocks;
import vazkii.botania.common.block.block_entity.mana.ManaPoolBlockEntity;

import java.util.List;

import static vazkii.botania.common.lib.ResourceLocationHelper.prefix;

public class TerrestrialAgglomerationEmiRecipe extends BotaniaEmiRecipe {
private static final ResourceLocation TEXTURE = prefix("textures/gui/terrasteel_jei_overlay.png");
private static final EmiStack PLATE = EmiStack.of(BotaniaBlocks.terraPlate);
public static final int CENTER_X = 45;
public static final int CENTER_Y = 30;
private final int mana;

public TerrestrialAgglomerationEmiRecipe(TerrestrialAgglomerationRecipe recipe) {
Expand All @@ -36,7 +42,15 @@ public int getDisplayWidth() {

@Override
public void addWidgets(WidgetHolder widgets) {
widgets.add(new ManaWidget(2, 100, mana, ManaPoolBlockEntity.MAX_MANA / 10));
RunicAltarEmiRecipe.addRunicAltarWidgets(widgets, this, input, PLATE, output.get(0));
widgets.add(new ManaWidget(2, 100, mana, ManaPoolBlockEntity.MAX_MANA));
double step = 360.0 / input.size();
widgets.add(new BlendTextureWidget(TEXTURE, CENTER_X - 23, CENTER_Y - 23, 64, 64, 42, 29));
for (int i = 0; i < input.size(); i++) {
EmiIngredient ing = input.get(i);
widgets.addSlot(ing, BotaniaEmiPlugin.rotateXAround(CENTER_X, CENTER_Y - 30, CENTER_X, CENTER_Y, step * i),
BotaniaEmiPlugin.rotateYAround(CENTER_X, CENTER_Y - 30, CENTER_X, CENTER_Y, step * i)).drawBack(false);
}
widgets.addSlot(PLATE, CENTER_X, 80).drawBack(false).catalyst(true);
widgets.addSlot(output.get(0), CENTER_X, CENTER_Y).drawBack(false).recipeContext(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void draw(RunicAltarRecipe recipe, @NotNull IRecipeSlotsView slotsView, @

@Override
public void setRecipe(@NotNull IRecipeLayoutBuilder builder, @NotNull RunicAltarRecipe recipe, @NotNull IFocusGroup focusGroup) {
PetalApothecaryRecipeCategory.setRecipeLayout(builder, recipe.getIngredients(), BotaniaBlocks.defaultAltar,
PetalApothecaryRecipeCategory.setRecipeLayout(builder, recipe.getIngredients(), BotaniaBlocks.runeAltar,
recipe.getResultItem(RegistryAccess.EMPTY), LIVINGROCK);
}

Expand Down

0 comments on commit 9387a65

Please sign in to comment.