Skip to content

Commit 52b99ca

Browse files
committed
remove renderer
1 parent 007782b commit 52b99ca

File tree

199 files changed

+207
-47890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+207
-47890
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,6 @@ Paths:
3333
- `src` - main app source code
3434
- `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.
3535

36-
### Renderer: Playground & Mesher (`renderer`)
37-
38-
- Playground Scripts:
39-
- Start: `pnpm run-playground` (playground, mesher + server) or `pnpm watch-playground`
40-
- Build: `pnpm build-playground` or `node renderer/esbuild.mjs`
41-
42-
- Mesher Scripts:
43-
- Start: `pnpm watch-mesher`
44-
- Build: `pnpm build-mesher`
45-
46-
Paths:
47-
48-
- `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:
49-
- `renderer/viewer/lib/worldrenderer.ts` - adding new objects to three.js happens here (sections)
50-
- `renderer/viewer/lib/models.ts` - preparing data for rendering (blocks) - happens in worker: out file - `worker.js`, building - `renderer/buildWorker.mjs`
51-
- `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.
52-
53-
### Storybook (`.storybook`)
54-
55-
Storybook is a tool for easier developing and testing React components.
56-
Path of all Storybook stories is `src/react/**/*.stories.tsx`.
57-
58-
- Scripts:
59-
- Start: `pnpm storybook`
60-
- Build: `pnpm build-storybook`
61-
6236
## Core-related
6337

6438
How different modules are used:
@@ -69,7 +43,7 @@ How different modules are used:
6943

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

72-
## Cypress Tests (E2E)
46+
## Cypress Tests (Browser Integration)
7347

7448
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.
7549

config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
}
3232
],
3333
"rightSideText": "A Minecraft client clone in the browser!",
34-
"splashText": "Thanks for testing my chaos!",
34+
"splashText": "Mind the bugs—thanks for being here!",
3535
"splashTextFallback": "Welcome!",
3636
"pauseLinks": [
3737
[

experiments/state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SmoothSwitcher } from '../renderer/viewer/lib/smoothSwitcher'
1+
import { SmoothSwitcher } from 'minecraft-renderer/src/lib/smoothSwitcher'
22

33
const div = document.createElement('div')
44
div.style.width = '100px'

experiments/three-fireworks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as THREE from 'three'
22
import { FirstPersonControls } from 'three/addons/controls/FirstPersonControls.js'
3-
import { FireworksManager } from '../renderer/viewer/three/fireworks'
3+
import { FireworksManager } from 'minecraft-renderer/src/three/fireworks'
44

55
// Create scene, camera and renderer
66
const scene = new THREE.Scene()

experiments/three-item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as THREE from 'three'
22
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'
33
import itemsAtlas from 'mc-assets/dist/itemsAtlasLegacy.png'
4-
import { createItemMeshFromCanvas, createItemMesh } from '../renderer/viewer/three/itemMesh'
4+
import { createItemMeshFromCanvas, createItemMesh } from 'minecraft-renderer/src/three/itemMesh'
55

66
// Create scene, camera and renderer
77
const scene = new THREE.Scene()

experiments/three-labels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as THREE from 'three'
22
import { FirstPersonControls } from 'three/addons/controls/FirstPersonControls.js'
3-
import { createWaypointSprite, WAYPOINT_CONFIG } from '../renderer/viewer/three/waypointSprite'
3+
import { createWaypointSprite, WAYPOINT_CONFIG } from 'minecraft-renderer/src/three/waypointSprite'
44

55
// Create scene, camera and renderer
66
const scene = new THREE.Scene()

package.json

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"scripts": {
66
"dev-rsbuild": "rsbuild dev",
77
"dev-proxy": "node server.js",
8-
"start": "run-p dev-proxy dev-rsbuild watch-mesher",
9-
"start2": "run-p dev-rsbuild watch-mesher",
8+
"start": "run-p dev-proxy dev-rsbuild",
9+
"start2": "run-p dev-rsbuild",
1010
"start-metrics": "ENABLE_METRICS=true rsbuild dev",
1111
"build": "pnpm build-other-workers && rsbuild build",
1212
"build-analyze": "BUNDLE_ANALYZE=true rsbuild build && pnpm build-other-workers",
@@ -25,14 +25,6 @@
2525
"storybook": "storybook dev -p 6006",
2626
"build-storybook": "storybook build && node scripts/build.js moveStorybookFiles",
2727
"start-experiments": "vite --config experiments/vite.config.ts --host",
28-
"watch-other-workers": "echo NOT IMPLEMENTED",
29-
"build-other-workers": "echo NOT IMPLEMENTED",
30-
"build-mesher": "node renderer/buildMesherWorker.mjs",
31-
"watch-mesher": "pnpm build-mesher -w",
32-
"run-playground": "run-p watch-mesher watch-other-workers watch-playground",
33-
"run-all": "run-p start run-playground",
34-
"build-playground": "rsbuild build --config renderer/rsbuild.config.ts",
35-
"watch-playground": "rsbuild dev --config renderer/rsbuild.config.ts",
3628
"update-git-deps": "tsx scripts/updateGitDeps.ts",
3729
"request-data": "tsx scripts/requestData.ts"
3830
},
@@ -89,6 +81,7 @@
8981
"mcraft-fun-mineflayer": "^0.1.23",
9082
"minecraft-data": "3.98.0",
9183
"minecraft-protocol": "github:PrismarineJS/node-minecraft-protocol#master",
84+
"minecraft-renderer": "^0.1.5",
9285
"mineflayer-item-map-downloader": "github:zardoy/mineflayer-item-map-downloader",
9386
"mojangson": "^2.0.4",
9487
"net-browserify": "github:zardoy/prismarinejs-net-browserify",
@@ -163,7 +156,6 @@
163156
"path-browserify": "^1.0.1",
164157
"path-exists-cli": "^2.0.0",
165158
"process": "github:PrismarineJS/node-process",
166-
"renderer": "link:renderer",
167159
"rimraf": "^5.0.1",
168160
"storybook": "^7.4.6",
169161
"stream-browserify": "^3.0.0",
@@ -202,6 +194,7 @@
202194
"buffer": "^6.0.3",
203195
"vec3": "0.1.10",
204196
"three": "0.154.0",
197+
"@types/three": "0.154.0",
205198
"diamond-square": "github:zardoy/diamond-square",
206199
"prismarine-block": "github:zardoy/prismarine-block#next-era",
207200
"prismarine-world": "github:zardoy/prismarine-world#next-era",

0 commit comments

Comments
 (0)