Skip to content

Commit 216fbb9

Browse files
authored
Improve version support and add support for 1.19 and 1.20. (#411)
* Improve version support and add support for 1.19 and 1.20. * add new versions to ci.yml * update * Rename readme file.
1 parent 6ec952c commit 216fbb9

File tree

20 files changed

+48
-21
lines changed

20 files changed

+48
-21
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
strategy:
2424
matrix:
25-
mcVersion: ['1.8.8', '1.9.4', '1.10.2', '1.11.2', '1.12.2', '1.13.2', '1.14.4', '1.15.2', '1.16.1', '1.16.4', '1.17.1', '1.18.1']
25+
mcVersion: ['1.8.8', '1.9.4', '1.10.2', '1.11.2', '1.12.2', '1.13.2', '1.14.4', '1.15.2', '1.16.1', '1.16.4', '1.17.1', '1.18.1', '1.19.1', '1.20.1']
2626
fail-fast: false
2727

2828
steps:

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ package-lock.json
44
versions/
55
public/index.js*
66
public/worker.js*
7-
public/supportedVersions.json
87
public/textures/
98
public/blocksStates/
109
examples/standalone/public/index.js
1110
examples/standalone/public/worker.js
12-
examples/standalone/public/supportedVersions.json
1311
examples/standalone/public/textures/
1412
examples/standalone/public/blocksStates/
1513
*.DS_Store

.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ package-lock.json
44
versions/
55
examples/standalone/public/index.js
66
examples/standalone/public/worker.js
7-
examples/standalone/public/supportedVersions.json
87
examples/standalone/public/textures/
98
examples/standalone/public/blocksStates/

readme.md renamed to README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Web based viewer for servers and bots
1313

1414
[<img src="https://prismarinejs.github.io/prismarine-viewer/test_1.18.1.png" alt="viewer" width="300">](https://prismarinejs.github.io/prismarine-viewer/)
1515

16+
Supports versions 1.8.8, 1.9.4, 1.10.2, 1.11.2, 1.12.2, 1.13.2, 1.14.4, 1.15.2, 1.16.1, 1.16.4, 1.17.1, 1.18.1, 1.19.1, 1.20.1.
17+
1618
## Install
1719

1820
```bash

examples/core/headless.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ const start = (bot, { viewDistance = 6, output = 'output.mp4', frames = 200, wid
1717
const renderer = new THREE.WebGLRenderer({ canvas })
1818
const viewer = new Viewer(renderer)
1919

20-
viewer.setVersion(bot.version)
20+
if (!viewer.setVersion(bot.version)) {
21+
return false
22+
}
2123
viewer.setFirstPersonCamera(bot.entity.position, bot.entity.yaw, bot.entity.pitch)
2224

2325
// Load world

examples/electron/client/localViewer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ class LocalViewer {
2828

2929
// Create viewer
3030
this.viewer = new Viewer(this.renderer)
31-
this.viewer.setVersion(this.version)
31+
if (!this.viewer.setVersion(this.version)) {
32+
return false
33+
}
3234
// Attach controls to viewer
3335
this.controls = new MapControls(this.viewer.camera, this.renderer.domElement)
3436
// Enable damping (inertia) on movement

examples/exporter/3dmodel.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ const main = async () => {
3131

3232
await schem.paste(world, new Vec3(0, 60, 0))
3333

34-
viewer.setVersion(version)
34+
if (viewer.setVersion(version)) {
35+
return false
36+
}
3537

3638
// Load world
3739
const worldView = new WorldView(world, viewDistance, center)

examples/exporter/screenshot.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ const main = async () => {
3232

3333
await schem.paste(world, new Vec3(0, 60, 0))
3434

35-
viewer.setVersion(version)
35+
if (viewer.setVersion(version)) {
36+
return false
37+
}
3638

3739
// Load world
3840
const worldView = new WorldView(world, viewDistance, center)

examples/standalone/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ async function main () {
2929

3030
// Create viewer
3131
const viewer = new Viewer(renderer)
32-
viewer.setVersion(version)
32+
if (viewer.setVersion(version)) {
33+
return false
34+
}
3335
// Attach controls to viewer
3436
const controls = new MapControls(viewer.camera, renderer.domElement)
3537

examples/standalone/webpack.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const config = {
3535
{ from: '../../public/blocksStates/', to: './blocksStates/' },
3636
{ from: '../../public/textures/*.png', to: './textures/' },
3737
{ from: '../../public/worker.js', to: './' },
38-
{ from: '../../public/supportedVersions.json', to: './' }
3938
]
4039
})
4140
],

0 commit comments

Comments
 (0)