Skip to content

Commit 78e160e

Browse files
committed
Fix debug map command showing broken render-time if tile hasnt been rendered
1 parent 93a14ef commit 78e160e

File tree

1 file changed

+6
-3
lines changed
  • common/src/main/java/de/bluecolored/bluemap/common/commands/commands

1 file changed

+6
-3
lines changed

common/src/main/java/de/bluecolored/bluemap/common/commands/commands/DebugCommand.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ public Component map(CommandSource source, @Argument("map") BmMap map, @Argument
192192
Vector2i tilePos = map.getHiresModelManager().getTileGrid().getCell(blockPos);
193193

194194
TileInfoRegion.TileInfo tileInfo = map.getMapTileState().get(tilePos.getX(), tilePos.getY());
195+
int tileRenderTime = tileInfo.getRenderTime();
195196

196197
int lastChunkHash = map.getMapChunkState().get(chunkPos.getX(), chunkPos.getY());
197198
int currentChunkHash = 0;
@@ -235,10 +236,12 @@ public void accept(int chunkX, int chunkZ, int timestamp) {
235236
text(z >> 4).color(HIGHLIGHT_COLOR)
236237
)
237238
.appendNewline()
238-
.append(details(BASE_COLOR,
239-
item("rendered", durationFormat(Instant.ofEpochSecond(tileInfo.getRenderTime()))).append(text(" ago")),
239+
.append(details(BASE_COLOR, stripNulls(
240+
(tileRenderTime > 0) ?
241+
item("rendered", durationFormat(Instant.ofEpochSecond(tileRenderTime)))
242+
.append(text(" ago")) : null,
240243
item("state", tileInfo.getState().getKey().getFormatted())
241-
))
244+
)))
242245
)
243246
));
244247

0 commit comments

Comments
 (0)