Compare commits

...
Sign in to create a new pull request.

78 commits

Author SHA1 Message Date
Vitaly Turovsky
0fb7614ece Merge branch 'next' into nextgen-merge 2025-04-09 05:46:57 +03:00
Vitaly Turovsky
3918f77877 up lockfile 2025-04-09 05:41:19 +03:00
Vitaly Turovsky
3a6b079704 unify things 2025-04-09 05:39:36 +03:00
Vitaly Turovsky
97f807f922 revert things 2025-04-09 05:39:29 +03:00
Vitaly Turovsky
79b31ab106 Merge branch 'next' into nextgen-physics 2025-04-09 05:30:59 +03:00
Vitaly Turovsky
d9bc5cbca9 up finish 2025-04-07 23:45:19 +03:00
Vitaly Turovsky
cd69cef03b up? 2025-04-07 21:31:15 +03:00
Vitaly Turovsky
e8f81bd080 Merge remote-tracking branch 'origin/next' into nextgen-physics 2025-04-07 21:31:02 +03:00
Vitaly Turovsky
804256e4f8 up physics & mineflayer 2025-04-07 21:28:24 +03:00
Vitaly Turovsky
0839889d21 Merge remote-tracking branch 'origin/next' into nextgen-physics 2025-03-30 17:29:31 +03:00
Vitaly Turovsky
07e7c6f227 revert physics for test 2025-03-26 06:47:04 +03:00
Vitaly Turovsky
b47258301c revert unknown chaange 2025-03-26 05:13:15 +03:00
Vitaly Turovsky
e7c240694f up 2025-03-26 05:03:37 +03:00
Vitaly Turovsky
14e20a2cf6 Merge remote-tracking branch 'origin/next' into nextgen-physics 2025-03-26 05:02:32 +03:00
Vitaly Turovsky
9057d3acb5 revert stuff 2025-03-26 00:05:55 +03:00
Vitaly Turovsky
547658f489 Merge remote-tracking branch 'origin/next' into nextgen-physics 2025-03-26 00:03:28 +03:00
Vitaly Turovsky
bf9c47dd26 fix test 2025-03-26 00:01:28 +03:00
Vitaly Turovsky
9cede6dbbc final fixes 2025-03-26 00:01:28 +03:00
Vitaly Turovsky
6a5ac4f8d2 make initial resource pack load optimised, rework it 2025-03-26 00:01:28 +03:00
Vitaly Turovsky
2630a57d35 renderers cleanup 2025-03-26 00:01:28 +03:00
Vitaly Turovsky
20569747ca fix mesher config pass 2025-03-26 00:01:27 +03:00
Vitaly Turovsky
9888bd55c1 fix: allow to go back when not crashed game 2025-03-26 00:01:27 +03:00
Vitaly
b501893ab2 ip pkgs 2025-03-23 03:13:52 +00:00
Vitaly Turovsky
e2b78333a1 Merge remote-tracking branch 'origin/renderer-rewrite' into nextgen-physics 2025-03-21 16:33:42 +03:00
Vitaly Turovsky
e917764b76 fix lint 2025-03-21 13:58:53 +03:00
Vitaly Turovsky
ed041972c4 disable in other way 2025-03-21 13:50:11 +03:00
Vitaly Turovsky
b579ee1767 Revert "disable playground"
This reverts commit 5eedb3c456.
2025-03-21 13:48:39 +03:00
Vitaly Turovsky
d450a31547 fix typo 2025-03-21 11:27:12 +03:00
Vitaly Turovsky
853e0e1d84 up readme 2025-03-21 11:05:19 +03:00
Vitaly Turovsky
8ddac97414 dont use bot 2025-03-21 11:02:30 +03:00
Vitaly Turovsky
5eedb3c456 disable playground 2025-03-21 10:59:46 +03:00
Vitaly Turovsky
11abbfcbb1 disable check 2025-03-21 07:07:56 +03:00
Vitaly Turovsky
8ee4dc37e7 disable displaying unknown non interactible entitites 2025-03-21 07:07:26 +03:00
Vitaly Turovsky
dc2ad7ccce disable signs, disable playground since its not used by anyone 2025-03-21 06:36:15 +03:00
Vitaly Turovsky
b483923009 rm unused three imports 2025-03-21 06:22:30 +03:00
Vitaly Turovsky
82d0638eb8 Merge remote-tracking branch 'origin/next' into renderer-rewrite 2025-03-21 06:20:58 +03:00
Vitaly Turovsky
cae2b612ba fix all remaining reactive state linking 2025-03-21 06:19:36 +03:00
Vitaly Turovsky
f88e9c8b61 Refactor renderer state management and move vr 2025-03-21 06:11:31 +03:00
Vitaly Turovsky
136b051695 smooth camera movement! 2025-03-21 05:16:30 +03:00
Vitaly Turovsky
9fedafe776 move threejs entities & cursor block to renderer 2025-03-21 05:07:27 +03:00
Vitaly Turovsky
ccb00043cf fix reload hand 2025-03-20 22:38:23 +03:00
Vitaly Turovsky
c1a7765fcb final code cleanup i think 2025-03-20 22:10:14 +03:00
Vitaly Turovsky
de3eddad89 a lot of imports update, data cleanup, add thousands errors 2025-03-20 05:36:22 +03:00
Vitaly Turovsky
e851f4fac2 Merge remote-tracking branch 'origin/next' into nextgen-physics 2025-03-20 05:15:31 +03:00
Vitaly Turovsky
f2f1c2538e 10x inventory performance 2025-03-20 04:53:52 +03:00
Vitaly Turovsky
5364085030 fix possible crash on non existing server data update 2025-03-20 04:37:02 +03:00
Vitaly Turovsky
400f5982be update server data for index 0 2025-03-20 04:34:55 +03:00
Vitaly Turovsky
dc073cd559 Merge remote-tracking branch 'origin/next' into renderer-rewrite 2025-03-19 01:26:02 +03:00
Vitaly Turovsky
6eb50cde24 last dont crash 2025-03-19 01:25:03 +03:00
Vitaly Turovsky
67d90a56fb Merge remote-tracking branch 'origin/next' into renderer-rewrite 2025-03-19 01:24:34 +03:00
Vitaly Turovsky
f2307632a2 Merge remote-tracking branch 'origin/next' into nextgen-physics 2025-03-18 20:51:34 +03:00
Vitaly Turovsky
d74d860726 Merge remote-tracking branch 'origin/next' into renderer-rewrite 2025-03-15 05:36:54 +03:00
Vitaly Turovsky
4d4637f710 Merge remote-tracking branch 'origin/next' into nextgen-physics 2025-03-15 04:33:12 +03:00
Vitaly Turovsky
847314d50f hide hand in spectator 2025-03-15 02:18:51 +03:00
Vitaly Turovsky
8a3c84745d test flying! 2025-03-15 02:18:44 +03:00
Vitaly Turovsky
3a9e2aa384 fix 2025-03-15 00:46:21 +03:00
Vitaly Turovsky
7cc562bd02 Merge remote-tracking branch 'origin/next' into nextgen-physics 2025-03-15 00:45:55 +03:00
Vitaly Turovsky
0597a3dad2 make library versions less annoying 2025-03-09 04:57:48 +03:00
Vitaly
cefdf5362f Merge branch 'next' into nextgen-physics 2025-03-07 15:59:22 +00:00
Vitaly Turovsky
d197859d47 big resourcemanager refactor 2025-03-05 15:30:04 +03:00
Vitaly Turovsky
1861edf567 delayLoadUntilFocus 2025-03-04 14:17:44 +03:00
Vitaly Turovsky
d8294d565b even more appViewer usage 2025-03-04 13:53:28 +03:00
Vitaly Turovsky
4381ef4f75 removing bobbing & panorama 2025-03-04 12:57:04 +03:00
Vitaly Turovsky
c65db9a8cb a working refactor 2025-03-04 12:12:42 +03:00
Vitaly Turovsky
34972e4e71 Merge branch 'next' into nextgen-physics 2025-02-27 05:16:21 +03:00
Vitaly
638dd6711e
Merge branch 'next' into nextgen-physics 2025-02-15 05:31:40 +03:00
Vitaly
9356daaefc
Merge branch 'next' into nextgen-physics 2025-02-13 23:27:44 +03:00
Vitaly Turovsky
fb10179691 set 1.19.4 for now! 2025-02-03 10:26:24 +03:00
Vitaly Turovsky
7e74633c14 Merge branch 'next' into nextgen-physics 2025-02-03 10:25:47 +03:00
Vitaly Turovsky
2d7ec12a75 Merge branch 'next' into nextgen-physics 2025-02-03 10:25:08 +03:00
Vitaly Turovsky
c626d105ff use actually useful server 2025-01-31 18:44:26 +03:00
Vitaly Turovsky
8db6b5bb51 fix library versions 2025-01-31 06:00:50 +03:00
Vitaly Turovsky
2848ab63d3 disable silly creative fly patching 2025-01-31 05:30:59 +03:00
Vitaly Turovsky
537658476d use gen mineflayer 2025-01-30 21:38:35 +03:00
Vitaly Turovsky
044153c2dc up ver 2025-01-30 21:36:23 +03:00
Vitaly Turovsky
380c21486b make it finally pass grim checks! 2025-01-30 21:33:30 +03:00
Vitaly Turovsky
aed5b40516 use local 2025-01-29 03:31:16 +03:00
Vitaly Turovsky
3051cc35f5 up pkg 2025-01-29 03:30:25 +03:00
3 changed files with 4713 additions and 5234 deletions

View file

@ -119,11 +119,11 @@
"workbox-build": "^7.0.0"
},
"devDependencies": {
"@rsbuild/core": "^1.0.1-beta.9",
"@rsbuild/plugin-node-polyfill": "^1.0.3",
"@rsbuild/plugin-react": "^1.0.1-beta.9",
"@rsbuild/plugin-type-check": "^1.0.1-beta.9",
"@rsbuild/plugin-typed-css-modules": "^1.0.1",
"@rsbuild/core": "1.0.1-beta.9",
"@rsbuild/plugin-node-polyfill": "1.0.3",
"@rsbuild/plugin-react": "1.0.1-beta.9",
"@rsbuild/plugin-type-check": "1.0.1-beta.9",
"@rsbuild/plugin-typed-css-modules": "1.0.1",
"@storybook/addon-essentials": "^7.4.6",
"@storybook/addon-links": "^7.4.6",
"@storybook/blocks": "^7.4.6",
@ -154,7 +154,7 @@
"mc-assets": "^0.2.52",
"mineflayer-mouse": "^0.1.7",
"minecraft-inventory-gui": "github:zardoy/minecraft-inventory-gui#next",
"mineflayer": "github:zardoy/mineflayer",
"mineflayer": "github:GenerelSchwerz/mineflayer",
"mineflayer-pathfinder": "^2.4.4",
"npm-run-all": "^4.1.5",
"os-browserify": "^0.3.0",
@ -195,9 +195,9 @@
},
"pnpm": {
"overrides": {
"@nxg-org/mineflayer-physics-util": "1.8.5",
"buffer": "^6.0.3",
"vec3": "0.1.10",
"@nxg-org/mineflayer-physics-util": "1.5.8",
"three": "0.154.0",
"diamond-square": "github:zardoy/diamond-square",
"prismarine-block": "github:zardoy/prismarine-block#next-era",

10024
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -714,142 +714,32 @@ document.addEventListener('visibilitychange', (e) => {
}
})
// #region creative fly
// these controls are more like for gamemode 3
const makeInterval = (fn, interval) => {
const intervalId = setInterval(fn, interval)
const cleanup = () => {
clearInterval(intervalId)
cleanup.active = false
}
cleanup.active = true
return cleanup
}
const isFlying = () => bot.physics.gravity === 0
let endFlyLoop: ReturnType<typeof makeInterval> | undefined
const currentFlyVector = new Vec3(0, 0, 0)
window.currentFlyVector = currentFlyVector
// todo cleanup
const flyingPressedKeys = {
down: false,
up: false
}
const startFlyLoop = () => {
if (!isFlying()) return
endFlyLoop?.()
endFlyLoop = makeInterval(() => {
if (!bot) {
endFlyLoop?.()
return
}
bot.entity.position.add(currentFlyVector.clone().multiply(new Vec3(0, 0.5, 0)))
}, 50)
}
// todo we will get rid of patching it when refactor controls
let originalSetControlState
const patchedSetControlState = (action, state) => {
if (!isFlying()) {
return originalSetControlState(action, state)
}
const actionPerFlyVector = {
jump: new Vec3(0, 1, 0),
sneak: new Vec3(0, -1, 0),
}
const changeVec = actionPerFlyVector[action]
if (!changeVec) {
return originalSetControlState(action, state)
}
if (flyingPressedKeys[state === 'jump' ? 'up' : 'down'] === state) return
const toAddVec = changeVec.scaled(state ? 1 : -1)
for (const coord of ['x', 'y', 'z']) {
if (toAddVec[coord] === 0) continue
if (currentFlyVector[coord] === toAddVec[coord]) return
}
currentFlyVector.add(toAddVec)
flyingPressedKeys[state === 'jump' ? 'up' : 'down'] = state
}
const isFlying = () => (bot.entity as any).flying
const startFlying = (sendAbilities = true) => {
bot.entity['creativeFly'] = true
if (sendAbilities) {
bot._client.write('abilities', {
flags: 2,
})
}
// window.flyingSpeed will be removed
bot.physics['airborneAcceleration'] = window.flyingSpeed ?? 0.1 // todo use abilities
bot.entity.velocity = new Vec3(0, 0, 0)
bot.creative.startFlying()
startFlyLoop()
(bot.entity as any).flying = true
}
const endFlying = (sendAbilities = true) => {
bot.entity['creativeFly'] = false
if (bot.physics.gravity !== 0) return
if (!isFlying()) return
if (sendAbilities) {
bot._client.write('abilities', {
flags: 0,
})
}
Object.assign(flyingPressedKeys, {
up: false,
down: false
})
currentFlyVector.set(0, 0, 0)
bot.physics['airborneAcceleration'] = standardAirborneAcceleration
bot.creative.stopFlying()
endFlyLoop?.()
(bot.entity as any).flying = false
}
let allowFlying = false
export const onBotCreate = () => {
let wasSpectatorFlying = false
bot._client.on('abilities', ({ flags }) => {
allowFlying = !!(flags & 4)
if (flags & 2) { // flying
toggleFly(true, false)
} else {
toggleFly(false, false)
}
})
const gamemodeCheck = () => {
if (bot.game.gameMode === 'spectator') {
allowFlying = true
toggleFly(true, false)
wasSpectatorFlying = true
} else if (wasSpectatorFlying) {
toggleFly(false, false)
wasSpectatorFlying = false
}
}
bot.on('game', () => {
gamemodeCheck()
})
bot.on('login', () => {
gamemodeCheck()
})
}
const standardAirborneAcceleration = 0.02
const toggleFly = (newState = !isFlying(), sendAbilities?: boolean) => {
// if (bot.game.gameMode !== 'creative' && bot.game.gameMode !== 'spectator') return
if (!allowFlying) return
if (bot.setControlState !== patchedSetControlState) {
originalSetControlState = bot.setControlState
bot.setControlState = patchedSetControlState
}
if (!bot.entity.canFly) return
if (newState) {
startFlying(sendAbilities)
@ -858,7 +748,6 @@ const toggleFly = (newState = !isFlying(), sendAbilities?: boolean) => {
}
gameAdditionalState.isFlying = isFlying()
}
// #endregion
const selectItem = async () => {
const block = bot.blockAtCursor(5)