diff --git a/src/client/java/aztech/modern_industrialization/machines/gui/MachineScreen.java b/src/client/java/aztech/modern_industrialization/machines/gui/MachineScreen.java index ab75a6164..46371153e 100644 --- a/src/client/java/aztech/modern_industrialization/machines/gui/MachineScreen.java +++ b/src/client/java/aztech/modern_industrialization/machines/gui/MachineScreen.java @@ -212,9 +212,13 @@ protected void renderBg(GuiGraphics guiGraphics, float delta, int mouseX, int mo private void renderConfigurableSlotBackgrounds(GuiGraphics guiGraphics) { for (Slot slot : this.menu.slots) { if (slot instanceof BackgroundRenderedSlot brs) { + var atlas = brs.getBackgroundAtlasLocation(); + if (atlas == null) { + continue; + } int px = leftPos + slot.x - 1; int py = topPos + slot.y - 1; - guiGraphics.blit(SLOT_ATLAS, px, py, brs.getBackgroundU(), brs.getBackgroundV(), 18, 18); + guiGraphics.blit(atlas, px, py, brs.getBackgroundU(), brs.getBackgroundV(), 18, 18); } } } diff --git a/src/main/java/aztech/modern_industrialization/inventory/BackgroundRenderedSlot.java b/src/main/java/aztech/modern_industrialization/inventory/BackgroundRenderedSlot.java index f0cb1f6a3..0586b0152 100644 --- a/src/main/java/aztech/modern_industrialization/inventory/BackgroundRenderedSlot.java +++ b/src/main/java/aztech/modern_industrialization/inventory/BackgroundRenderedSlot.java @@ -23,10 +23,22 @@ */ package aztech.modern_industrialization.inventory; +import aztech.modern_industrialization.MI; +import net.minecraft.resources.ResourceLocation; +import org.jetbrains.annotations.Nullable; + /** * Implement this on a slot to render its background automatically. */ public interface BackgroundRenderedSlot { + /** + * @return the {@link ResourceLocation} of the slot atlas texture to use for the slot background. Return null to render no background. + */ + @Nullable + default ResourceLocation getBackgroundAtlasLocation() { + return MI.id("textures/gui/container/slot_atlas.png"); + } + default int getBackgroundU() { return 0; }