Skip to content

Commit 0b72ea6

Browse files
committed
fix: add time to debug overlay
1 parent 33a6f4d commit 0b72ea6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/react/DebugOverlay.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default () => {
3434
const [blockL, setBlockL] = useState(0)
3535
const [biomeId, setBiomeId] = useState(0)
3636
const [day, setDay] = useState(0)
37+
const [timeOfDay, setTimeOfDay] = useState(0)
3738
const [dimension, setDimension] = useState('')
3839
const [cursorBlock, setCursorBlock] = useState<Block | null>(null)
3940
const [blockInfo, setBlockInfo] = useState<{ customBlockName?: string, modelInfo?: BlockStateModelInfo } | null>(null)
@@ -132,6 +133,7 @@ export default () => {
132133
setBiomeId(bot.world.getBiome(bot.entity.position))
133134
setDimension(bot.game.dimension)
134135
setDay(bot.time.day)
136+
setTimeOfDay(bot.time.timeOfDay)
135137
setCursorBlock(bot.mouse.getCursorState().cursorBlock)
136138
}, 100)
137139

@@ -185,7 +187,7 @@ export default () => {
185187
<p>Light: {blockL} ({skyL} sky)</p>
186188

187189
<p>Biome: minecraft:{loadedData.biomesArray[biomeId]?.name ?? 'unknown biome'}</p>
188-
<p>Day: {day}</p>
190+
<p>Day: {day} Time: {timeOfDay}</p>
189191
<div className={styles.empty} />
190192
{Object.entries(appViewer.backend?.getDebugOverlay?.().left ?? {}).map(([name, value]) => <p key={name}>{name}: {value}</p>)}
191193
</div>

0 commit comments

Comments
 (0)