Skip to content

Commit a11f5cb

Browse files
committed
Last 1.20.1 commit before branching
1 parent 8ede38e commit a11f5cb

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/main/java/com/ldtteam/blockui/controls/ButtonImage.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
import com.ldtteam.blockui.util.records.SizeI;
88
import com.mojang.blaze3d.vertex.PoseStack;
99
import com.mojang.blaze3d.systems.RenderSystem;
10+
import net.minecraft.client.renderer.texture.MissingTextureAtlasSprite;
1011
import net.minecraft.resources.ResourceLocation;
1112

1213
import java.util.Objects;
1314

1415
import net.minecraft.util.Mth;
16+
import net.minecraftforge.fml.loading.FMLEnvironment;
1517

1618
/**
1719
* Clickable image.
@@ -336,9 +338,17 @@ public void setImageDisabled(final ResourceLocation loc, final int offsetX, fina
336338
@Override
337339
public void drawSelf(final BOGuiGraphics target, final double mx, final double my)
338340
{
341+
if (!FMLEnvironment.production)
342+
{
343+
Objects.requireNonNull(image, () -> id + " | " + window.getXmlResourceLocation());
344+
}
345+
else if (image == null)
346+
{
347+
image = MissingTextureAtlasSprite.getLocation();
348+
}
349+
339350
final PoseStack ms = target.pose();
340351

341-
Objects.requireNonNull(image, () -> id + " | " + window.getXmlResourceLocation());
342352
ResourceLocation bind = image;
343353
int u = imageOffsetX;
344354
int v = imageOffsetY;

0 commit comments

Comments
 (0)