hide hand in spectator
This commit is contained in:
parent
8a3c84745d
commit
847314d50f
3 changed files with 6 additions and 1 deletions
|
|
@ -24,6 +24,7 @@ export interface IPlayerState {
|
|||
getItemUsageTicks?(): number
|
||||
// isUsingItem?(): boolean
|
||||
getHeldItem?(isLeftHand: boolean): HandItemBlock | undefined
|
||||
gameMode?: string
|
||||
username?: string
|
||||
onlineMode?: boolean
|
||||
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ export class WorldRendererThree extends WorldRendererCommon {
|
|||
// eslint-disable-next-line @typescript-eslint/non-nullable-type-assertion-style
|
||||
const cam = this.camera instanceof THREE.Group ? this.camera.children.find(child => child instanceof THREE.PerspectiveCamera) as THREE.PerspectiveCamera : this.camera
|
||||
this.renderer.render(this.scene, cam)
|
||||
if (this.config.showHand && !this.freeFlyMode) {
|
||||
if (this.config.showHand && !this.freeFlyMode && this.playerState.gameMode !== 'spectator') {
|
||||
this.holdingBlock.render(this.camera, this.renderer, viewer.ambientLight, viewer.directionalLight)
|
||||
this.holdingBlockLeft.render(this.camera, this.renderer, viewer.ambientLight, viewer.directionalLight)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ export class PlayerStateManager implements IPlayerState {
|
|||
return bot.player?.username ?? ''
|
||||
}
|
||||
|
||||
get gameMode () {
|
||||
return bot.game?.gameMode
|
||||
}
|
||||
|
||||
reactive = proxy({
|
||||
playerSkin: undefined as string | undefined,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue