Skip to content

Commit

Permalink
fix: never get stuck in unloaded chunks! @sa2urami
Browse files Browse the repository at this point in the history
feat: fully supported spectator mode & basic creative fly fixes
  • Loading branch information
zardoy committed Oct 28, 2024
1 parent 5fa019e commit 6b23eb6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"prismarine-world": "github:zardoy/prismarine-world#next-era",
"minecraft-data": "3.76.0",
"prismarine-provider-anvil": "github:zardoy/prismarine-provider-anvil#everything",
"prismarine-physics": "github:zardoy/prismarine-physics",
"minecraft-protocol": "github:PrismarineJS/node-minecraft-protocol#master",
"react": "^18.2.0",
"prismarine-chunk": "github:zardoy/prismarine-chunk",
Expand Down
30 changes: 16 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ const patchedSetControlState = (action, state) => {
}

const startFlying = (sendAbilities = true) => {
bot.entity['creativeFly'] = true
if (sendAbilities) {
bot._client.write('abilities', {
flags: 2,
Expand All @@ -616,6 +617,7 @@ const startFlying = (sendAbilities = true) => {
}

const endFlying = (sendAbilities = true) => {
bot.entity['creativeFly'] = false
if (bot.physics.gravity !== 0) return
if (sendAbilities) {
bot._client.write('abilities', {
Expand Down

0 comments on commit 6b23eb6

Please sign in to comment.