Skip to content

Commit

Permalink
add safety for bad fluid registrations (#8234)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiakil committed Dec 20, 2024
1 parent 792b8e7 commit 6c1a492
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/mekanism/client/render/MekanismRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.texture.MissingTextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureAtlas;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.core.BlockPos;
Expand Down Expand Up @@ -104,6 +105,9 @@ public static TextureAtlasSprite getChemicalTexture(@NotNull Chemical chemical)
}

public static TextureAtlasSprite getSprite(ResourceLocation spriteLocation) {
if (spriteLocation == null) { // e.g. badly implemented fluids
spriteLocation = MissingTextureAtlasSprite.getLocation();
}
return Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(spriteLocation);
}

Expand Down

0 comments on commit 6c1a492

Please sign in to comment.