Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
28 changes: 1 addition & 27 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,6 @@ Paths:
- `src` - main app source code
- `src/react` - React components - almost all UI is in this folder. Almost every component has its base (reused in app and storybook) and `Provider` - which is a component that provides context to its children. Consider looking at DeathScreen component to see how it's used.

### Renderer: Playground & Mesher (`renderer`)

- Playground Scripts:
- Start: `pnpm run-playground` (playground, mesher + server) or `pnpm watch-playground`
- Build: `pnpm build-playground` or `node renderer/esbuild.mjs`

- Mesher Scripts:
- Start: `pnpm watch-mesher`
- Build: `pnpm build-mesher`

Paths:

- `renderer` - Improved and refactored version of <https://github.com/PrismarineJS/prismarine-viewer>. Here is everything related to rendering the game world itself (no ui at all). Two most important parts here are:
- `renderer/viewer/lib/worldrenderer.ts` - adding new objects to three.js happens here (sections)
- `renderer/viewer/lib/models.ts` - preparing data for rendering (blocks) - happens in worker: out file - `worker.js`, building - `renderer/buildWorker.mjs`
- `renderer/playground/playground.ts` - Playground (source of <mcraft.fun/playground.html>) Use this for testing any rendering changes. You can also modify the playground code.

### Storybook (`.storybook`)

Storybook is a tool for easier developing and testing React components.
Path of all Storybook stories is `src/react/**/*.stories.tsx`.

- Scripts:
- Start: `pnpm storybook`
- Build: `pnpm build-storybook`

## Core-related

How different modules are used:
Expand All @@ -69,7 +43,7 @@ How different modules are used:

To start the main web app and playground, run `pnpm run-all`. Note is doesn't start storybook and tests.

## Cypress Tests (E2E)
## Cypress Tests (Browser Integration)

Cypress tests are located in `cypress` folder. To run them, run `pnpm test-mc-server` and then `pnpm test:cypress` when the `pnpm prod-start` is running (or change the port to 3000 to test with the dev server). Usually you don't need to run these until you get issues on the CI.

Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
],
"rightSideText": "A Minecraft client clone in the browser!",
"splashText": "Thanks for testing my chaos!",
"splashText": "Mind the bugs—thanks for being here!",
"splashTextFallback": "Welcome!",
"pauseLinks": [
[
Expand Down
2 changes: 1 addition & 1 deletion experiments/state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SmoothSwitcher } from '../renderer/viewer/lib/smoothSwitcher'
import { SmoothSwitcher } from 'minecraft-renderer/src/lib/smoothSwitcher'

const div = document.createElement('div')
div.style.width = '100px'
Expand Down
2 changes: 1 addition & 1 deletion experiments/three-fireworks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as THREE from 'three'
import { FirstPersonControls } from 'three/addons/controls/FirstPersonControls.js'
import { FireworksManager } from '../renderer/viewer/three/fireworks'
import { FireworksManager } from 'minecraft-renderer/src/three/fireworks'

// Create scene, camera and renderer
const scene = new THREE.Scene()
Expand Down
2 changes: 1 addition & 1 deletion experiments/three-item.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as THREE from 'three'
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'
import itemsAtlas from 'mc-assets/dist/itemsAtlasLegacy.png'
import { createItemMeshFromCanvas, createItemMesh } from '../renderer/viewer/three/itemMesh'
import { createItemMeshFromCanvas, createItemMesh } from 'minecraft-renderer/src/three/itemMesh'

// Create scene, camera and renderer
const scene = new THREE.Scene()
Expand Down
2 changes: 1 addition & 1 deletion experiments/three-labels.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as THREE from 'three'
import { FirstPersonControls } from 'three/addons/controls/FirstPersonControls.js'
import { createWaypointSprite, WAYPOINT_CONFIG } from '../renderer/viewer/three/waypointSprite'
import { createWaypointSprite, WAYPOINT_CONFIG } from 'minecraft-renderer/src/three/waypointSprite'

// Create scene, camera and renderer
const scene = new THREE.Scene()
Expand Down
15 changes: 4 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"scripts": {
"dev-rsbuild": "rsbuild dev",
"dev-proxy": "node server.js",
"start": "run-p dev-proxy dev-rsbuild watch-mesher",
"start2": "run-p dev-rsbuild watch-mesher",
"start": "run-p dev-proxy dev-rsbuild",
"start2": "run-p dev-rsbuild",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Build script references removed build-other-workers script

The build and build-analyze scripts reference pnpm build-other-workers, but this PR removes the build-other-workers script definition (which was "echo NOT IMPLEMENTED"). Running pnpm build will now fail because the build-other-workers script no longer exists.

Fix in Cursor Fix in Web

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Lint script references removed renderer folder

The lint script includes renderer in its glob pattern {src,cypress,renderer}/**/*.{ts,js,jsx,tsx}, but the renderer folder and its link:renderer devDependency were removed in this commit. Running pnpm lint may fail or behave unexpectedly when trying to lint a non-existent directory.

Fix in Cursor Fix in Web

"start-metrics": "ENABLE_METRICS=true rsbuild dev",
"build": "pnpm build-other-workers && rsbuild build",
"build-analyze": "BUNDLE_ANALYZE=true rsbuild build && pnpm build-other-workers",
Expand All @@ -25,14 +25,6 @@
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build && node scripts/build.js moveStorybookFiles",
"start-experiments": "vite --config experiments/vite.config.ts --host",
"watch-other-workers": "echo NOT IMPLEMENTED",
"build-other-workers": "echo NOT IMPLEMENTED",
"build-mesher": "node renderer/buildMesherWorker.mjs",
"watch-mesher": "pnpm build-mesher -w",
"run-playground": "run-p watch-mesher watch-other-workers watch-playground",
"run-all": "run-p start run-playground",
"build-playground": "rsbuild build --config renderer/rsbuild.config.ts",
"watch-playground": "rsbuild dev --config renderer/rsbuild.config.ts",
"update-git-deps": "tsx scripts/updateGitDeps.ts",
"request-data": "tsx scripts/requestData.ts"
},
Expand Down Expand Up @@ -89,6 +81,7 @@
"mcraft-fun-mineflayer": "^0.1.23",
"minecraft-data": "3.98.0",
"minecraft-protocol": "github:PrismarineJS/node-minecraft-protocol#master",
"minecraft-renderer": "^0.1.5",
"mineflayer-item-map-downloader": "github:zardoy/mineflayer-item-map-downloader",
"mojangson": "^2.0.4",
"net-browserify": "github:zardoy/prismarinejs-net-browserify",
Expand Down Expand Up @@ -163,7 +156,6 @@
"path-browserify": "^1.0.1",
"path-exists-cli": "^2.0.0",
"process": "github:PrismarineJS/node-process",
"renderer": "link:renderer",
"rimraf": "^5.0.1",
"storybook": "^7.4.6",
"stream-browserify": "^3.0.0",
Expand Down Expand Up @@ -202,6 +194,7 @@
"buffer": "^6.0.3",
"vec3": "0.1.10",
"three": "0.154.0",
"@types/three": "0.154.0",
"diamond-square": "github:zardoy/diamond-square",
"prismarine-block": "github:zardoy/prismarine-block#next-era",
"prismarine-world": "github:zardoy/prismarine-world#next-era",
Expand Down
Loading
Loading