Skip to content

Commit 15a2eb8

Browse files
committed
less spammy error messages
1 parent 72b96dd commit 15a2eb8

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

src/main/java/com/falsepattern/falsetweaks/modules/threadedupdates/ThreadedChunkUpdateHelper.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
import cpw.mods.fml.common.FMLCommonHandler;
3939
import cpw.mods.fml.common.Loader;
4040
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
41+
42+
import it.unimi.dsi.fastutil.ints.IntArraySet;
43+
import it.unimi.dsi.fastutil.ints.IntSet;
4144
import lombok.RequiredArgsConstructor;
4245
import lombok.val;
4346
import net.minecraft.block.Block;
@@ -199,6 +202,8 @@ private static int doChunkUpdateForRenderPass(WorldRenderer wr, UpdateTask task,
199202
return flags;
200203
}
201204

205+
private static final IntSet alreadyWarnedRenderTypes = new IntArraySet();
206+
202207
private static int doChunkUpdateForRenderPassBlock(WorldRenderer wr, UpdateTask task, ChunkCache chunkcache, Tessellator tess, int pass, RenderBlocks renderblocks, int x, int y, int z, int flags) {
203208
Block block = chunkcache.getBlock(x, y, z);
204209

@@ -230,7 +235,17 @@ private static int doChunkUpdateForRenderPassBlock(WorldRenderer wr, UpdateTask
230235
tess.setTranslation(-wr.posX, -wr.posY, -wr.posZ);
231236
}
232237

233-
flags |= renderblocks.renderBlockByRenderType(block, x, y, z) ? BIT_RenderedSomething : 0;
238+
try {
239+
flags |= renderblocks.renderBlockByRenderType(block, x, y, z) ? BIT_RenderedSomething : 0;
240+
} catch (Exception e) {
241+
synchronized (alreadyWarnedRenderTypes) {
242+
val rt = block.getRenderType();
243+
if (!alreadyWarnedRenderTypes.contains(rt)) {
244+
alreadyWarnedRenderTypes.add(rt);
245+
Share.log.error("Exception while rendering a block!", e);
246+
}
247+
}
248+
}
234249

235250
if (block.getRenderType() == 0 && x == playerX && y == playerY && z == playerZ) {
236251
renderblocks.setRenderFromInside(true);

src/main/resources/assets/falsetweaks/lang/en_US.lang

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config.falsetweaks.triangulator.enable_quad_triangulation=Triangulator: Enable quad triangulation
22
config.falsetweaks.triangulator.fix_block_crack=Triangulator: Block edge crack fix
33
config.falsetweaks.triangulator.render_hook_compat_mode=Triangulator: Render hook compatibility mode
4+
config.falsetweaks.triangulator.suppress_calibration=Triangulator: Suppress calibration prompt
45
config.falsetweaks.triangulator.block_crack_fix_epsilon=Triangulator: Block crack fix epsilon
56
config.falsetweaks.triangulator.block_crack_fix_blacklist=Triangulator: Block crack fix blacklist
67
config.falsetweaks.voxelizer.forced_layers=Voxelizer: Forced layers

0 commit comments

Comments
 (0)