Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #284

Merged
merged 56 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
fda38bb
fix custom channel crash
zardoy Feb 19, 2025
730cf65
feat: add detailed block assets parsing (blockstates + models) in F3 …
zardoy Feb 20, 2025
2ea74b2
fix: literally fix the notification component
zardoy Feb 20, 2025
8e4987e
fix: add resourcepack texture processing error catching
zardoy Feb 20, 2025
7110b8c
fix: improve rendering of armor to closer match game and prevent z-fi…
Phoenix616 Feb 20, 2025
2f81baf
fix: improve rendering of armor to closer match game and prevent z-fi…
zardoy Feb 21, 2025
a268c69
feat: rework atlas packing so now almost any resourepack with differe…
zardoy Feb 21, 2025
ba6a618
feat: add support for custom sounds and sounds.json
zardoy Feb 21, 2025
f0d5ad6
fix: fix visual issue when loading screen disappears
zardoy Feb 21, 2025
78d923d
a way to have packets logger always enabled
zardoy Feb 21, 2025
81a6922
fix: fix sound id mapping for some versions like 1.16.5
zardoy Feb 22, 2025
1387cb0
feat: Replay packets server functionality! (#287)
zardoy Feb 23, 2025
334e8a5
fix a few bugs in packet, replayer
zardoy Feb 23, 2025
0505b64
fix: fix shift desync issue, dedupe
zardoy Feb 23, 2025
75e4440
fix autocomplete in replay
zardoy Feb 23, 2025
9613a0e
fix: fix bossbar flickering
zardoy Feb 23, 2025
bdea1fc
a huge progress on packet replay component, fix bugs add switches
zardoy Feb 23, 2025
2cb8bea
fix types
zardoy Feb 23, 2025
2e3363d
a lot of replay code cleanup
zardoy Feb 23, 2025
2f29a9a
fix stupid errors
zardoy Feb 24, 2025
cde2392
fix: change chat completions filtering to be not aggressive
zardoy Feb 24, 2025
2f200a8
fix: fix hardcoded sounds played when resource is requested
zardoy Feb 24, 2025
6d29413
add transparent block model override
zardoy Feb 24, 2025
0b2d676
fix: fix a lof of bugs in base transition classes and fix bug with po…
zardoy Feb 24, 2025
077dc9d
fix: fix hand performance because of unnecessary texture rewrites
zardoy Feb 24, 2025
2833b33
fix: display err when sound mappings not found
zardoy Feb 24, 2025
b7560f7
fix custom block models regression
zardoy Feb 25, 2025
acd8144
feat: initial config.json is now bundled on build step, which is requ…
zardoy Feb 26, 2025
e8d980b
add brand new progress reporter
zardoy Feb 26, 2025
59cb442
fix: display notification on user resourecepack enable
zardoy Feb 26, 2025
ecf5572
stop publishing UI to npm since no one uses it
zardoy Feb 26, 2025
deedcda
correctly merge local config when building
zardoy Feb 26, 2025
89fd5dd
add external folder for forks code (ext functionality)
zardoy Feb 26, 2025
322e2f9
fix sounds
zardoy Feb 26, 2025
8ff0592
feat: add config option for pause screen links (#288)
Phoenix616 Feb 26, 2025
52ae41a
Add better chat link prompt screen (#290)
Phoenix616 Feb 26, 2025
edad57a
feat: allow to load client without free space on device (or no write …
zardoy Feb 26, 2025
2414111
feat: add packets recording control to pause menu, display packets vi…
zardoy Feb 26, 2025
dffadbb
wip jei channel
zardoy Feb 26, 2025
d348a44
add a way to disable recording button on pause menu, refactor
zardoy Feb 27, 2025
dec93c2
fix react warning
zardoy Feb 27, 2025
fa9c081
fix: seagrass and kelp are always waterlogged
zardoy Feb 27, 2025
ceb4cb0
feat: Refactor mouse controls, fixing all false entity/item interacti…
zardoy Feb 27, 2025
10f1706
fix: fix whole pipeline of rendering custom items from rp: add them t…
zardoy Mar 3, 2025
b0da1e4
fix: fix crashes on packets logging recording
zardoy Mar 3, 2025
2619e5d
fix: was not possible to click notification, make error routing more …
zardoy Mar 3, 2025
2a8f514
add build zip workflow
zardoy Mar 3, 2025
874cafc
add self host zip publishing with release
zardoy Mar 3, 2025
1d4dc0d
fix define in arg build
zardoy Mar 3, 2025
4b54be6
ci: adjust esbuild build arg syntax for prod
zardoy Mar 3, 2025
1c700aa
feat(config-json): Only either bundle or load from remote (#291)
zardoy Mar 4, 2025
465ce35
feat: display motd/players info for ws servers (still no icon sadly)
zardoy Mar 5, 2025
998f0f0
fix: fix sentry #6092213276 DataCloneError: Cannot decode detached Ar…
zardoy Mar 5, 2025
0db49e7
feat: Full support for rendering blocks in inventory GUI powered by d…
zardoy Mar 5, 2025
b9df1bc
fix enabling lighting falsey when load for chunks is enabled
zardoy Mar 5, 2025
6fb18d4
fixes & workarounds rendering items in inventory (some were broken si…
zardoy Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/build-zip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Make Self Host Zip

on:
workflow_dispatch:

jobs:
build-and-bundle:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@master

- uses: actions/setup-node@v4
with:
node-version: 22

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install dependencies
run: pnpm install

- name: Build project
run: pnpm build

- name: Bundle server.js
run: |
pnpm esbuild server.js --bundle --platform=node --outfile=bundled-server.js --define:process.env.NODE_ENV="'production'"

- name: Create distribution package
run: |
mkdir -p package
cp -r dist package/
cp bundled-server.js package/server.js
cd package
zip -r ../self-host.zip .

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: self-host
path: self-host.zip
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- run: pnpm build-storybook
- run: pnpm test-unit
- run: pnpm lint
- run: pnpm tsx scripts/buildNpmReact.ts
# - run: pnpm tsx scripts/buildNpmReact.ts
- run: nohup pnpm prod-start &
- run: nohup pnpm test-mc-server &
- uses: cypress-io/github-action@v5
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/next-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
echo "{\"latestTag\": \"$(git rev-parse --short $GITHUB_SHA)\", \"isCommit\": true}" > assets/release.json
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
env:
CONFIG_JSON_SOURCE: BUNDLED
- run: pnpm build-storybook
- name: Copy playground files
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
echo "{\"latestTag\": \"$(git rev-parse --short ${{ github.event.pull_request.head.sha }})\", \"isCommit\": true}" > assets/release.json
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
env:
CONFIG_JSON_SOURCE: BUNDLED
- run: pnpm build-storybook
- name: Copy playground files
run: |
Expand Down
39 changes: 29 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: vercel build --token=${{ secrets.VERCEL_TOKEN }} --prod
env:
CONFIG_JSON_SOURCE: BUNDLED
- run: pnpm build-storybook
- name: Copy playground files
run: |
Expand All @@ -43,24 +45,41 @@ jobs:
with:
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} --prod
id: deploy
# publish to github
- run: cp vercel.json .vercel/output/static/vercel.json
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .vercel/output/static
force_orphan: true

- name: Build self-host version
run: pnpm build
- name: Bundle server.js
run: |
pnpm esbuild server.js --bundle --platform=node --outfile=bundled-server.js --define:process.env.NODE_ENV="'production'"

- name: Create zip package
run: |
mkdir -p package
cp -r dist package/
cp bundled-server.js package/server.js
cd package
zip -r ../self-host.zip .

- run: |
pnpx zardoy-release node --footer "This release URL: ${{ steps.deploy.outputs.stdout }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# has possible output: tag
id: release

# has output
- run: cp vercel.json .vercel/output/static/vercel.json
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .vercel/output/static
force_orphan: true
- name: Set publishing config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: pnpm tsx scripts/buildNpmReact.ts ${{ steps.release.outputs.tag }}
if: steps.release.outputs.tag
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# - run: pnpm tsx scripts/buildNpmReact.ts ${{ steps.release.outputs.tag }}
# if: steps.release.outputs.tag
# env:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ RUN npm i -g [email protected]
# Build arguments
ARG DOWNLOAD_SOUNDS=false
ARG DISABLE_SERVICE_WORKER=false
ARG CONFIG_JSON_SOURCE=REMOTE
# TODO need flat --no-root-optional
RUN node ./scripts/dockerPrepare.mjs
RUN pnpm i
Expand All @@ -22,8 +23,8 @@ RUN if [ "$DOWNLOAD_SOUNDS" = "true" ] ; then node scripts/downloadSoundsMap.mjs
# ENTRYPOINT ["pnpm", "run", "run-all"]

# only for prod
RUN GITHUB_REPOSITORY=zardoy/minecraft-web-client \
DISABLE_SERVICE_WORKER=$DISABLE_SERVICE_WORKER \
RUN DISABLE_SERVICE_WORKER=$DISABLE_SERVICE_WORKER \
CONFIG_JSON_SOURCE=$CONFIG_JSON_SOURCE \
pnpm run build

# ---- Run Stage ----
Expand Down
1 change: 1 addition & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ General:

- **`?setting=<setting_name>:<setting_value>`** - Set and lock the setting on load. You can set multiple settings by separating them with `&` e.g. `?setting=autoParkour:true&setting=renderDistance:4`
- `?modal=<modal>` - Open specific modal on page load eg `keybindings`. Very useful on UI changes testing during dev. For path use `,` as separator. To get currently opened modal type this in the console: `activeModalStack.at(-1).reactType`
- `?replayFileUrl=<url>` - Load and start a packet replay session from a URL with a integrated server. For debugging / previewing recorded sessions. The file must be CORS enabled.

Server specific:

Expand Down
14 changes: 14 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"peerJsServer": "",
"peerJsServerFallback": "https://p2p.mcraft.fun",
"promoteServers": [
{
"ip": "ws://mcraft.ryzyn.xyz",
"version": "1.19.4"
},
{
"ip": "ws://play.mcraft.fun"
},
Expand All @@ -17,5 +21,15 @@
"version": "1.20.3",
"description": "Very nice a polite server. Must try for everyone!"
}
],
"pauseLinks": [
[
{
"type": "github"
},
{
"type": "discord"
}
]
]
}
1 change: 1 addition & 0 deletions experiments/state.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<script src="state.ts" type="module"></script>
37 changes: 37 additions & 0 deletions experiments/state.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { SmoothSwitcher } from '../renderer/viewer/lib/smoothSwitcher'

const div = document.createElement('div')
div.style.width = '100px'
div.style.height = '100px'
div.style.backgroundColor = 'red'
document.body.appendChild(div)

const pos = {x: 0, y: 0}

const positionSwitcher = new SmoothSwitcher(() => pos, (key, value) => {
pos[key] = value
})
globalThis.positionSwitcher = positionSwitcher

document.body.addEventListener('keydown', e => {
if (e.code === 'ArrowLeft' || e.code === 'ArrowRight') {
const to = {
x: e.code === 'ArrowLeft' ? -100 : 100
}
console.log(pos, to)
positionSwitcher.transitionTo(to, e.code === 'ArrowLeft' ? 'Left' : 'Right', () => {
console.log('Switched to ', e.code === 'ArrowLeft' ? 'Left' : 'Right')
})
}
if (e.code === 'Space') {
pos.x = 200
}
})

const render = () => {
positionSwitcher.update()
div.style.transform = `translate(${pos.x}px, ${pos.y}px)`
requestAnimationFrame(render)
}

render()
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@
}
// load error handling
const onError = (errorOrMessage, log = false) => {
const message = errorOrMessage instanceof Error ? (errorOrMessage.stack ?? errorOrMessage.message) : errorOrMessage
let message = errorOrMessage instanceof Error ? (errorOrMessage.stack ?? errorOrMessage.message) : errorOrMessage
if (log) console.log(message)
if (typeof message !== 'string') message = String(message)
if (document.querySelector('.initial-loader') && document.querySelector('.initial-loader').querySelector('.title').textContent !== 'Error') {
document.querySelector('.initial-loader').querySelector('.title').textContent = 'Error'
const [errorMessage, ...errorStack] = message.split('\n')
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"web",
"client"
],
"release": {
"attachReleaseFiles": "self-host.zip"
},
"publish": {
"preset": {
"publishOnlyIfChanged": true,
Expand Down Expand Up @@ -81,7 +84,7 @@
"mojangson": "^2.0.4",
"net-browserify": "github:zardoy/prismarinejs-net-browserify",
"node-gzip": "^1.1.2",
"mcraft-fun-mineflayer": "0.0.3",
"mcraft-fun-mineflayer": "^0.1.8",
"peerjs": "^1.5.0",
"pixelarticons": "^1.8.1",
"pretty-bytes": "^6.1.1",
Expand Down Expand Up @@ -145,7 +148,8 @@
"http-browserify": "^1.7.0",
"http-server": "^14.1.1",
"https-browserify": "^1.0.0",
"mc-assets": "^0.2.34",
"mc-assets": "^0.2.42",
"mineflayer-mouse": "^0.0.5",
"minecraft-inventory-gui": "github:zardoy/minecraft-inventory-gui#next",
"mineflayer": "github:zardoy/mineflayer",
"mineflayer-pathfinder": "^2.4.4",
Expand Down Expand Up @@ -188,6 +192,7 @@
"pnpm": {
"overrides": {
"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",
Expand Down
Loading
Loading