Skip to content

Commit 1f7d2d4

Browse files
committed
FIX disable problematic boat & minecart riding!
FIX could not open hopper on 1.16.5
1 parent fa68808 commit 1f7d2d4

File tree

4 files changed

+37
-8
lines changed

4 files changed

+37
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
"mc-assets": "^0.2.62",
158158
"minecraft-inventory-gui": "github:zardoy/minecraft-inventory-gui#next",
159159
"mineflayer": "github:zardoy/mineflayer#gen-the-master",
160-
"mineflayer-mouse": "^0.1.21",
160+
"mineflayer-mouse": "^0.1.23",
161161
"npm-run-all": "^4.1.5",
162162
"os-browserify": "^0.3.0",
163163
"path-browserify": "^1.0.1",

pnpm-lock.yaml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/inventoryWindows.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ const implementedContainersGuiMap = {
331331
'minecraft:generic_9x4': 'Generic95Win',
332332
'minecraft:generic_9x5': 'Generic95Win',
333333
// hopper
334+
'minecraft:hopper': 'HopperWin',
334335
'minecraft:generic_5x1': 'HopperWin',
335336
'minecraft:generic_9x6': 'LargeChestWin',
336337
'minecraft:generic_3x3': 'DropDispenseWin',

src/react/DebugOverlay.tsx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useEffect, useRef, useState } from 'react'
2+
import type { Entity } from 'prismarine-entity'
23
import { useSnapshot } from 'valtio'
34
import type { Block } from 'prismarine-block'
45
import { getThreeJsRendererMethods } from 'renderer/viewer/three/threeJsMethods'
@@ -39,6 +40,7 @@ export default () => {
3940
const [timeOfDay, setTimeOfDay] = useState(0)
4041
const [dimension, setDimension] = useState('')
4142
const [cursorBlock, setCursorBlock] = useState<Block | null>(null)
43+
const [cursorEntity, setCursorEntity] = useState<Entity | null>(null)
4244
const [blockInfo, setBlockInfo] = useState<{ customBlockName?: string, modelInfo?: BlockStateModelInfo } | null>(null)
4345
const [clientTps, setClientTps] = useState(0)
4446
const [serverTps, setServerTps] = useState(null as null | { value: number, frozen: boolean })
@@ -55,6 +57,14 @@ export default () => {
5557

5658
const viewDegToMinecraft = (yaw) => yaw % 360 - 180 * (yaw < 0 ? -1 : 1)
5759

60+
const shortenUuid = (uuid: string | undefined): string | undefined => {
61+
if (!uuid) return undefined
62+
// Format: 2383-*-3243 (first 4 chars, *, last 4 chars)
63+
const cleaned = uuid.replaceAll('-', '')
64+
if (cleaned.length < 8) return uuid
65+
return `${cleaned.slice(0, 4)}-*-${cleaned.slice(-4)}`
66+
}
67+
5868
const readPacket = (data, { name }, _buf, fullBuffer) => {
5969
if (fullBuffer) {
6070
const size = fullBuffer.byteLength
@@ -129,7 +139,9 @@ export default () => {
129139
setDimension(bot.game.dimension)
130140
setDay(bot.time.day)
131141
setTimeOfDay(bot.time.timeOfDay)
132-
setCursorBlock(bot.mouse.getCursorState().cursorBlock)
142+
const cursorState = bot.mouse.getCursorState()
143+
setCursorBlock(cursorState.cursorBlock)
144+
setCursorEntity(cursorState.entity)
133145
}, 100)
134146

135147
const notFrequentUpdateInterval = setInterval(async () => {
@@ -212,6 +224,22 @@ export default () => {
212224
{cursorBlock ? (
213225
<p>Looking at: {cursorBlock.position.x} {cursorBlock.position.y} {cursorBlock.position.z}</p>
214226
) : ''}
227+
{cursorEntity ? (<>
228+
<div className={styles.empty} />
229+
<p>E: {cursorEntity.name}</p>
230+
{cursorEntity.displayName && <p>{cursorEntity.displayName}</p>}
231+
{cursorEntity.id !== undefined && <p>ID: {cursorEntity.id}</p>}
232+
{shortenUuid(cursorEntity.uuid) && <p>UUID: {shortenUuid(cursorEntity.uuid)}</p>}
233+
{cursorEntity.username && <p>Username: {cursorEntity.username}</p>}
234+
{cursorEntity.position && (
235+
<p>{cursorEntity.position.x.toFixed(2)} {cursorEntity.position.y.toFixed(2)} {cursorEntity.position.z.toFixed(2)}</p>
236+
)}
237+
{cursorEntity.yaw !== undefined && <p>Yaw: {cursorEntity.yaw.toFixed(1)}</p>}
238+
{cursorEntity.pitch !== undefined && <p>Pitch: {cursorEntity.pitch.toFixed(1)}</p>}
239+
{cursorEntity.type && <p>Type: {cursorEntity.type}</p>}
240+
{cursorEntity.health !== undefined && <p>Health: {cursorEntity.health.toFixed(1)}</p>}
241+
</>)
242+
: ''}
215243
<div className={styles.empty} />
216244
{blockInfo && (() => {
217245
const { customBlockName, modelInfo } = blockInfo

0 commit comments

Comments
 (0)