Skip to content

Commit 563df3a

Browse files
committed
Make getBackgroundAtlasLocation not nullable
1 parent 1156945 commit 563df3a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/client/java/aztech/modern_industrialization/machines/gui/MachineScreen.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,13 @@ protected void renderBg(GuiGraphics guiGraphics, float delta, int mouseX, int mo
212212
private void renderConfigurableSlotBackgrounds(GuiGraphics guiGraphics) {
213213
for (Slot slot : this.menu.slots) {
214214
if (slot.isActive() && slot instanceof BackgroundRenderedSlot brs) {
215+
var atlas = brs.getBackgroundAtlasLocation();
215216
int px = leftPos + slot.x - 1;
216217
int py = topPos + slot.y - 1;
217218
if (slot.getItem().isEmpty()) {
218-
var atlas = brs.getBackgroundAtlasLocation();
219-
guiGraphics.blit(atlas == null ? SLOT_ATLAS : atlas, px, py, brs.getBackgroundU(), brs.getBackgroundV(), 18, 18);
219+
guiGraphics.blit(atlas, px, py, brs.getBackgroundU(), brs.getBackgroundV(), 18, 18);
220220
} else {
221-
guiGraphics.blit(SLOT_ATLAS, px, py, 0, 0, 18, 18);
221+
guiGraphics.blit(atlas, px, py, 0, 0, 18, 18);
222222
}
223223
}
224224
}

src/main/java/aztech/modern_industrialization/inventory/BackgroundRenderedSlot.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,18 @@
2323
*/
2424
package aztech.modern_industrialization.inventory;
2525

26+
import aztech.modern_industrialization.MI;
2627
import net.minecraft.resources.ResourceLocation;
27-
import org.jetbrains.annotations.Nullable;
2828

2929
/**
3030
* Implement this on a slot to render its background automatically.
3131
*/
3232
public interface BackgroundRenderedSlot {
3333
/**
34-
* @return the {@link ResourceLocation} of the slot atlas texture to use for the slot background. When null, uses the MI slot atlas
34+
* @return the {@link ResourceLocation} of the slot atlas texture to use for the slot background.
3535
*/
36-
@Nullable
3736
default ResourceLocation getBackgroundAtlasLocation() {
38-
return null;
37+
return MI.id("textures/gui/container/slot_atlas.png");
3938
}
4039

4140
default int getBackgroundU() {

0 commit comments

Comments
 (0)