Skip to content

Commit

Permalink
made SubCategory use a supplier for the icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Jan 26, 2025
1 parent 203b59b commit 4642147
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public RecipeMapCategory(IRecipeMap map, RecipeType<IRecipe> type, GuiData gui,
background = guiHelper.drawableBuilder(gui.getTexture(guiTier, "machine"), area.x, area.y, area.z, area.w).addPadding(0, (map.getInfoRenderer().getRows() <= 0 ? 0 : 7 + (10 *map.getInfoRenderer().getRows())), 0, 0).build();
progressBar = guiHelper.drawableBuilder(gui.getMachineData().getProgressTexture(this.guiTier), progress.x, progress.y, progress.z, progress.w).setTextureSize(progress.z, progress.w * 2).buildAnimated(50, fromDir(gui.getMachineData().getDir()), !gui.getMachineData().doesBarFill());
progressBackground = guiHelper.drawableBuilder(gui.getMachineData().getProgressTexture(this.guiTier), 0, 0, progress.z, progress.w).setTextureSize(progress.z, progress.w * 2).build();
Object icon = subCategory.icon();
Object icon = subCategory.icon().get();
if (icon != null) {
if (icon instanceof ItemStack itemStack) {
this.icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, itemStack);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import muramasa.antimatter.recipe.IRecipe;

import java.util.function.Predicate;
import java.util.function.Supplier;

public record SubCategory(String langKey, Object icon, Predicate<IRecipe> predicate) {
public record SubCategory(String langKey, Supplier<Object> icon, Predicate<IRecipe> predicate) {
}

0 comments on commit 4642147

Please sign in to comment.