Skip to content

Commit

Permalink
Use FileNotFoundException instead of just Throwable
Browse files Browse the repository at this point in the history
  • Loading branch information
ekulxam authored and HamaIndustries committed Nov 7, 2024
1 parent d2c929e commit 7f537bf
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import net.minecraft.util.math.RotationAxis;
import org.joml.Vector3f;

import java.io.FileNotFoundException;

public record SpriteBlockEntityRenderer(BlockEntityRendererFactory.Context context) implements BlockEntityRenderer<SpriteBlockEntity> {
private static final Vector3f[] vertices = new Vector3f[] {
new Vector3f(-0.5F, -0.5F, 0.0F),
Expand Down Expand Up @@ -45,12 +47,12 @@ public void render(SpriteBlockEntity entity, float f, MatrixStack matrices, Vert
ResourceManager resourceManager = ((TextureManagerAccessor) textureManager).glowcase$getResourceManager();
try {
resourceManager.getResourceOrThrow(identifier);
} catch (Throwable ignored) {
} catch (FileNotFoundException ignored) {
/* if the texture (file) does not exist, just replace it.
this happens a lot when edit a sprite block, so I'm adding it to avoid log spam
- SkyNotTheLimit
*/
identifier = Glowcase.id("textures/sprite/invalid.png"); // todo: get missing texture and put a giant red X on it
identifier = Glowcase.id("textures/sprite/invalid.png");
}
}
var vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutout(identifier));
Expand Down

0 comments on commit 7f537bf

Please sign in to comment.