From 353bec4c6b718ab3a2b54f147a35d04fa274c058 Mon Sep 17 00:00:00 2001 From: Vitaly Date: Sun, 9 Jun 2024 18:12:34 +0300 Subject: [PATCH 01/18] fix: fix entity label display for older versions of minecraft --- prismarine-viewer/viewer/lib/entities.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/prismarine-viewer/viewer/lib/entities.js b/prismarine-viewer/viewer/lib/entities.js index 28fc6d89..94f06e0c 100644 --- a/prismarine-viewer/viewer/lib/entities.js +++ b/prismarine-viewer/viewer/lib/entities.js @@ -267,11 +267,15 @@ export class Entities extends EventEmitter { } - displaySimpleText(jsonLike) { + parseEntityLabel(jsonLike) { if (!jsonLike) return - const parsed = typeof jsonLike === 'string' ? mojangson.simplify(mojangson.parse(jsonLike)) : nbt.simplify(jsonLike) - const text = flat(parsed).map(x => x.text) - return text.join('') + try { + const parsed = typeof jsonLike === 'string' ? mojangson.simplify(mojangson.parse(jsonLike)) : nbt.simplify(jsonLike) + const text = flat(parsed).map(x => x.text) + return text.join('') + } catch (err) { + return jsonLike + } } update(/** @type {import('prismarine-entity').Entity & {delete?, pos}} */entity, overrides) { @@ -410,7 +414,7 @@ export class Entities extends EventEmitter { } } // not player - const displayText = entity.metadata?.[3] && this.displaySimpleText(entity.metadata[2]) + const displayText = entity.metadata?.[3] && this.parseEntityLabel(entity.metadata[2]) if (entity.name !== 'player' && displayText) { addNametag({ ...entity, username: displayText }, this.entitiesOptions, this.entities[entity.id].children.find(c => c.name === 'mesh')) } From 7f3d5ca1f0ead78528f065c55ba3724f951b875b Mon Sep 17 00:00:00 2001 From: Vitaly Turovsky Date: Mon, 10 Jun 2024 03:27:34 +0300 Subject: [PATCH 02/18] rename project to minecraft-web-client fixes issue146 --- README.NPM.MD | 2 +- package.json | 2 +- package.npm.json | 2 +- scripts/downloadSoundsMap.mjs | 2 +- scripts/prepareSounds.mjs | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.NPM.MD b/README.NPM.MD index 24c90bc9..c036adba 100644 --- a/README.NPM.MD +++ b/README.NPM.MD @@ -24,7 +24,7 @@ const App = () => { } ``` -See [Storybook](https://mcraft.fun/storybook/) or [Storybook (Mirror link)](https://mcon.vercel.app/storybook/) for more examples and full components list. Also take a look at the full [standalone example](https://github.com/zardoy/prismarine-web-client/tree/experiments/UiStandaloneExample.tsx). +See [Storybook](https://mcraft.fun/storybook/) or [Storybook (Mirror link)](https://mcon.vercel.app/storybook/) for more examples and full components list. Also take a look at the full [standalone example](https://github.com/zardoy/minecraft-web-client/tree/experiments/UiStandaloneExample.tsx). There are two types of components: diff --git a/package.json b/package.json index fa28ae5d..7bbde636 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "prismarine-web-client", + "name": "minecraft-web-client", "version": "0.0.0-dev", "description": "A minecraft client running in a browser", "scripts": { diff --git a/package.npm.json b/package.npm.json index bae8b60f..7e13d67b 100644 --- a/package.npm.json +++ b/package.npm.json @@ -26,7 +26,7 @@ }, "module": "./dist/react/npmReactComponents.js", "types": "./dist/react/npmReactComponents.d.ts", - "repository": "zardoy/prismarine-web-client", + "repository": "zardoy/minecraft-web-client", "version": "0.0.0-dev", "dependencies": {}, "peerDependencies": { diff --git a/scripts/downloadSoundsMap.mjs b/scripts/downloadSoundsMap.mjs index 066a3df7..3c335f8f 100644 --- a/scripts/downloadSoundsMap.mjs +++ b/scripts/downloadSoundsMap.mjs @@ -1,6 +1,6 @@ import fs from 'fs' -const url = 'https://github.com/zardoy/prismarine-web-client/raw/sounds-generated/sounds.js' +const url = 'https://github.com/zardoy/minecraft-web-client/raw/sounds-generated/sounds.js' const savePath = 'dist/sounds.js' fetch(url).then(res => res.text()).then(data => { fs.writeFileSync(savePath, data, 'utf8') diff --git a/scripts/prepareSounds.mjs b/scripts/prepareSounds.mjs index 4ed119cb..8f3e5bef 100644 --- a/scripts/prepareSounds.mjs +++ b/scripts/prepareSounds.mjs @@ -61,7 +61,7 @@ const downloadAllSounds = async () => { } prevSounds = soundAssets } - async function downloadSound ({ name, hash, size }, namePath, log) { + async function downloadSound({ name, hash, size }, namePath, log) { const savePath = path.resolve(`generated/sounds/${namePath}`) if (fs.existsSync(savePath)) { // console.log('skipped', name) @@ -86,7 +86,7 @@ const downloadAllSounds = async () => { } writer.close() } - async function downloadSounds (assets, addPath = '') { + async function downloadSounds(assets, addPath = '') { for (let i = 0; i < assets.length; i += 5) { await Promise.all(assets.slice(i, i + 5).map((asset, j) => downloadSound(asset, `${addPath}${asset.name}`, () => { console.log('downloading', addPath, asset.name, i + j, '/', assets.length) @@ -135,7 +135,7 @@ const convertSounds = async () => { } const CONCURRENCY = 5 - for(let i = 0; i < toConvert.length; i += CONCURRENCY) { + for (let i = 0; i < toConvert.length; i += CONCURRENCY) { await Promise.all(toConvert.slice(i, i + CONCURRENCY).map((oggPath, j) => convertSound(i + j))) } } @@ -221,7 +221,7 @@ const makeSoundsBundle = async () => { const allSoundsMeta = { format: 'mp3', - baseUrl: 'https://raw.githubusercontent.com/zardoy/prismarine-web-client/sounds-generated/sounds/' + baseUrl: 'https://raw.githubusercontent.com/zardoy/minecraft-web-client/sounds-generated/sounds/' } await build({ From 7f4edbedba20b22bd9b903c780a2c268679d6463 Mon Sep 17 00:00:00 2001 From: Vitaly Turovsky Date: Tue, 11 Jun 2024 03:26:24 +0300 Subject: [PATCH 03/18] rm manimali, replace with a better server --- config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index 1bbbfd47..e4f86060 100644 --- a/config.json +++ b/config.json @@ -15,9 +15,9 @@ "description": "One of the best servers here. Join now!" }, { - "ip": "play.minemalia.com", + "ip": "sus.shhnowisnottheti.me", "version": "1.18.2", - "description": "Only login with existing accounts." + "description": "Creative, your own 'boxes' (islands)" } ] } From 38e4efc79b4054bfc354ccaaf6fe5c5f572a3978 Mon Sep 17 00:00:00 2001 From: Wolf2323 Date: Tue, 11 Jun 2024 20:14:58 +0200 Subject: [PATCH 04/18] fix: improve signs models & text, added all missing sign types (#143) Co-authored-by: Vitaly Turovsky --- prismarine-viewer/viewer/lib/mesher/models.ts | 4 +- .../viewer/lib/mesher/test/tests.test.ts | 22 -- .../viewer/lib/worldrendererThree.ts | 27 +- prismarine-viewer/viewer/prepare/atlas.ts | 49 +-- .../data/1.13/blockModels/sign/oak.json | 6 + .../data/1.13/blockModels/sign/oak_wall.json | 6 + .../data/1.13/blockModels/sign/sign.json | 140 +++++++ .../data/1.13/blockModels/sign/sign_wall.json | 72 ++++ .../data/1.13/blockStates/sign/sign.json | 67 ++++ .../data/1.13/blockStates/sign/wall_sign.json | 19 + .../data/1.14/blockModels/sign/acacia.json | 6 + .../1.14/blockModels/sign/acacia_wall.json | 6 + .../data/1.14/blockModels/sign/birch.json | 6 + .../1.14/blockModels/sign/birch_wall.json | 6 + .../data/1.14/blockModels/sign/dark_oak.json | 6 + .../1.14/blockModels/sign/dark_oak_wall.json | 6 + .../data/1.14/blockModels/sign/jungle.json | 6 + .../1.14/blockModels/sign/jungle_wall.json | 7 + .../data/1.14/blockModels/sign/spruce.json | 6 + .../1.14/blockModels/sign/spruce_wall.json | 6 + .../1.14/blockStates/sign/acacia_sign.json | 67 ++++ .../blockStates/sign/acacia_wall_sign.json | 19 + .../1.14/blockStates/sign/birch_sign.json | 67 ++++ .../blockStates/sign/birch_wall_sign.json | 19 + .../1.14/blockStates/sign/dark_oak_sign.json | 67 ++++ .../blockStates/sign/dark_oak_wall_sign.json | 19 + .../1.14/blockStates/sign/jungle_sign.json | 67 ++++ .../blockStates/sign/jungle_wall_sign.json | 19 + .../data/1.14/blockStates/sign/oak_sign.json | 67 ++++ .../1.14/blockStates/sign/oak_wall_sign.json | 19 + .../1.14/blockStates/sign/spruce_sign.json | 67 ++++ .../blockStates/sign/spruce_wall_sign.json | 19 + .../data/1.16/blockModels/sign/crimson.json | 6 + .../1.16/blockModels/sign/crimson_wall.json | 6 + .../data/1.16/blockModels/sign/warped.json | 6 + .../1.16/blockModels/sign/warped_wall.json | 6 + .../1.16/blockStates/sign/crimson_sign.json | 67 ++++ .../blockStates/sign/crimson_wall_sign.json | 19 + .../1.16/blockStates/sign/warped_sign.json | 67 ++++ .../blockStates/sign/warped_wall_sign.json | 19 + .../data/1.19/blockModels/sign/mangrove.json | 6 + .../1.19/blockModels/sign/mangrove_wall.json | 6 + .../1.19/blockStates/sign/mangrove_sign.json | 67 ++++ .../blockStates/sign/mangrove_wall_sign.json | 19 + .../1.20/blockModels/sign/acacia_hanging.json | 7 + .../blockModels/sign/acacia_wall_hanging.json | 7 + .../data/1.20/blockModels/sign/bamboo.json | 6 + .../1.20/blockModels/sign/bamboo_hanging.json | 7 + .../1.20/blockModels/sign/bamboo_wall.json | 6 + .../blockModels/sign/bamboo_wall_hanging.json | 7 + .../1.20/blockModels/sign/birch_hanging.json | 7 + .../blockModels/sign/birch_wall_hanging.json | 7 + .../data/1.20/blockModels/sign/cherry.json | 6 + .../1.20/blockModels/sign/cherry_hanging.json | 7 + .../1.20/blockModels/sign/cherry_wall.json | 6 + .../blockModels/sign/cherry_wall_hanging.json | 7 + .../blockModels/sign/crimson_hanging.json | 7 + .../sign/crimson_wall_hanging.json | 7 + .../blockModels/sign/dark_oak_hanging.json | 7 + .../sign/dark_oak_wall_hanging.json | 7 + .../data/1.20/blockModels/sign/hanging.json | 115 ++++++ .../1.20/blockModels/sign/jungle_hanging.json | 7 + .../blockModels/sign/jungle_wall_hanging.json | 7 + .../blockModels/sign/mangrove_hanging.json | 7 + .../sign/mangrove_wall_hanging.json | 7 + .../1.20/blockModels/sign/oak_hanging.json | 7 + .../blockModels/sign/oak_wall_hanging.json | 7 + .../1.20/blockModels/sign/spruce_hanging.json | 7 + .../blockModels/sign/spruce_wall_hanging.json | 7 + .../1.20/blockModels/sign/wall_hanging.json | 347 ++++++++++++++++++ .../1.20/blockModels/sign/warped_hanging.json | 7 + .../blockModels/sign/warped_wall_hanging.json | 7 + .../blockStates/sign/acacia_hanging_sign.json | 67 ++++ .../sign/acacia_wall_hanging_sign.json | 19 + .../blockStates/sign/bamboo_hanging_sign.json | 67 ++++ .../1.20/blockStates/sign/bamboo_sign.json | 67 ++++ .../sign/bamboo_wall_hanging_sign.json | 19 + .../blockStates/sign/bamboo_wall_sign.json | 19 + .../blockStates/sign/birch_hanging_sign.json | 67 ++++ .../sign/birch_wall_hanging_sign.json | 19 + .../blockStates/sign/cherry_hanging_sign.json | 67 ++++ .../1.20/blockStates/sign/cherry_sign.json | 67 ++++ .../sign/cherry_wall_hanging_sign.json | 19 + .../blockStates/sign/cherry_wall_sign.json | 19 + .../sign/crimson_hanging_sign.json | 67 ++++ .../sign/crimson_wall_hanging_sign.json | 19 + .../sign/dark_oak_hanging_sign.json | 67 ++++ .../sign/dark_oak_wall_hanging_sign.json | 19 + .../blockStates/sign/jungle_hanging_sign.json | 67 ++++ .../sign/jungle_wall_hanging_sign.json | 19 + .../sign/mangrove_hanging_sign.json | 67 ++++ .../sign/mangrove_wall_hanging_sign.json | 19 + .../blockStates/sign/oak_hanging_sign.json | 67 ++++ .../sign/oak_wall_hanging_sign.json | 19 + .../blockStates/sign/spruce_hanging_sign.json | 67 ++++ .../sign/spruce_wall_hanging_sign.json | 19 + .../blockStates/sign/warped_hanging_sign.json | 67 ++++ .../sign/warped_wall_hanging_sign.json | 19 + .../viewer/prepare/modelsBuilder.ts | 10 +- .../viewer/prepare/moreGeneratedBlocks.ts | 193 +++------- 100 files changed, 3048 insertions(+), 196 deletions(-) create mode 100644 prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/oak.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/oak_wall.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/sign_wall.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.13/blockStates/sign/sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.13/blockStates/sign/wall_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/acacia.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/acacia_wall.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/birch.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/birch_wall.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/dark_oak.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/dark_oak_wall.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/jungle.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/jungle_wall.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/spruce.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/spruce_wall.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/acacia_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/acacia_wall_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/birch_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/birch_wall_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/dark_oak_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/dark_oak_wall_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/jungle_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/jungle_wall_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/oak_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/oak_wall_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/spruce_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/spruce_wall_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/crimson.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/crimson_wall.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/warped.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/warped_wall.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/crimson_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/crimson_wall_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/warped_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/warped_wall_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.19/blockModels/sign/mangrove.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.19/blockModels/sign/mangrove_wall.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.19/blockStates/sign/mangrove_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.19/blockStates/sign/mangrove_wall_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/acacia_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/acacia_wall_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo_wall.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo_wall_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/birch_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/birch_wall_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry_wall.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry_wall_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/crimson_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/crimson_wall_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/dark_oak_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/dark_oak_wall_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/jungle_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/jungle_wall_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/mangrove_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/mangrove_wall_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/oak_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/oak_wall_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/spruce_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/spruce_wall_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/wall_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/warped_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/warped_wall_hanging.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/acacia_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/acacia_wall_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_wall_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_wall_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/birch_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/birch_wall_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_wall_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_wall_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/crimson_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/crimson_wall_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/dark_oak_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/dark_oak_wall_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/jungle_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/jungle_wall_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/mangrove_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/mangrove_wall_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/oak_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/oak_wall_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/spruce_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/spruce_wall_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/warped_hanging_sign.json create mode 100644 prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/warped_wall_hanging_sign.json diff --git a/prismarine-viewer/viewer/lib/mesher/models.ts b/prismarine-viewer/viewer/lib/mesher/models.ts index 39148aaa..c978c240 100644 --- a/prismarine-viewer/viewer/lib/mesher/models.ts +++ b/prismarine-viewer/viewer/lib/mesher/models.ts @@ -520,9 +520,11 @@ export function getSectionGeometry (sx, sy, sz, world: World) { "west": 1, "east": 3 } - const isWall = block.name.endsWith('wall_sign') || block.name.endsWith('hanging_sign') + const isWall = block.name.endsWith('wall_sign') || block.name.endsWith('wall_hanging_sign') + const isHanging = block.name.endsWith('hanging_sign') attr.signs[key] = { isWall, + isHanging, rotation: isWall ? facingRotationMap[props.facing] : +props.rotation } } diff --git a/prismarine-viewer/viewer/lib/mesher/test/tests.test.ts b/prismarine-viewer/viewer/lib/mesher/test/tests.test.ts index 5a80fa49..de5db815 100644 --- a/prismarine-viewer/viewer/lib/mesher/test/tests.test.ts +++ b/prismarine-viewer/viewer/lib/mesher/test/tests.test.ts @@ -45,12 +45,6 @@ test('Known blocks are not rendered', () => { // should be fixed, but to avoid regressions & for visibility expect(invalidBlocks).toMatchInlineSnapshot(` { - "acacia_hanging_sign": true, - "acacia_wall_hanging_sign": true, - "bamboo_hanging_sign": true, - "bamboo_wall_hanging_sign": true, - "birch_hanging_sign": true, - "birch_wall_hanging_sign": true, "black_banner": true, "black_bed": true, "black_candle": true, @@ -65,18 +59,12 @@ test('Known blocks are not rendered', () => { "brown_wall_banner": true, "bubble_column": true, "candle": true, - "cherry_hanging_sign": true, - "cherry_wall_hanging_sign": true, "creeper_head": true, "creeper_wall_head": true, - "crimson_hanging_sign": true, - "crimson_wall_hanging_sign": true, "cyan_banner": true, "cyan_bed": true, "cyan_candle": true, "cyan_wall_banner": true, - "dark_oak_hanging_sign": true, - "dark_oak_wall_hanging_sign": true, "dragon_head": true, "dragon_wall_head": true, "end_gateway": true, @@ -89,8 +77,6 @@ test('Known blocks are not rendered', () => { "green_bed": true, "green_candle": true, "green_wall_banner": true, - "jungle_hanging_sign": true, - "jungle_wall_hanging_sign": true, "light_blue_banner": true, "light_blue_bed": true, "light_blue_candle": true, @@ -107,10 +93,6 @@ test('Known blocks are not rendered', () => { "magenta_bed": true, "magenta_candle": true, "magenta_wall_banner": true, - "mangrove_hanging_sign": true, - "mangrove_wall_hanging_sign": true, - "oak_hanging_sign": true, - "oak_wall_hanging_sign": true, "orange_banner": true, "orange_bed": true, "orange_candle": true, @@ -138,12 +120,8 @@ test('Known blocks are not rendered', () => { "skeleton_skull": true, "skeleton_wall_skull": true, "snow": true, - "spruce_hanging_sign": true, - "spruce_wall_hanging_sign": true, "structure_void": true, "turtle_egg": true, - "warped_hanging_sign": true, - "warped_wall_hanging_sign": true, "water_cauldron": true, "white_banner": true, "white_bed": true, diff --git a/prismarine-viewer/viewer/lib/worldrendererThree.ts b/prismarine-viewer/viewer/lib/worldrendererThree.ts index 4d28519a..095e5a94 100644 --- a/prismarine-viewer/viewer/lib/worldrendererThree.ts +++ b/prismarine-viewer/viewer/lib/worldrendererThree.ts @@ -112,11 +112,11 @@ export class WorldRendererThree extends WorldRendererCommon { } // should not compute it once if (Object.keys(data.geometry.signs).length) { - for (const [posKey, { isWall, rotation }] of Object.entries(data.geometry.signs)) { + for (const [posKey, { isWall, isHanging, rotation }] of Object.entries(data.geometry.signs)) { const [x, y, z] = posKey.split(',') const signBlockEntity = this.blockEntities[posKey] if (!signBlockEntity) continue - const sign = this.renderSign(new Vec3(+x, +y, +z), rotation, isWall, nbt.simplify(signBlockEntity)) + const sign = this.renderSign(new Vec3(+x, +y, +z), rotation, isWall, isHanging, nbt.simplify(signBlockEntity)) if (!sign) continue object.add(sign) } @@ -165,7 +165,7 @@ export class WorldRendererThree extends WorldRendererCommon { this.renderer.render(this.scene, this.camera) } - renderSign (position: Vec3, rotation: number, isWall: boolean, blockEntity) { + renderSign (position: Vec3, rotation: number, isWall: boolean, isHanging: boolean, blockEntity) { const tex = this.getSignTexture(position, blockEntity) if (!tex) return @@ -182,13 +182,16 @@ export class WorldRendererThree extends WorldRendererCommon { mesh.renderOrder = 999 // todo @sa2urami shouldnt all this be done in worker? - mesh.scale.set(1, 7 / 16, 1) - if (isWall) { - mesh.position.set(0, 0, -(8 - 1.5) / 16 + 0.001) + const lineHeight = 7 / 16; + const scaleFactor = isHanging ? 1.3 : 1 + mesh.scale.set(1 * scaleFactor, lineHeight * scaleFactor, 1 * scaleFactor) + + const thickness = (isHanging ? 2 : 1.5) / 16 + const wallSpacing = 0.25 / 16; + if (isWall && !isHanging) { + mesh.position.set(0, 0, -0.5 + thickness + wallSpacing + 0.0001) } else { - // standing - const faceEnd = 8.75 - mesh.position.set(0, 0, (faceEnd - 16 / 2) / 16 + 0.001) + mesh.position.set(0, 0, thickness / 2 + 0.0001) } const group = new THREE.Group() @@ -196,8 +199,10 @@ export class WorldRendererThree extends WorldRendererCommon { rotation * (isWall ? 90 : 45 / 2) ), 0) group.add(mesh) - const y = isWall ? 4.5 / 16 + mesh.scale.y / 2 : (1 - (mesh.scale.y / 2)) - group.position.set(position.x + 0.5, position.y + y, position.z + 0.5) + const height = (isHanging ? 10 : 8)/16 + const heightOffset = (isHanging ? 0 : isWall ? 4.333 : 9.333) / 16 + const textPosition = height/2 + heightOffset + group.position.set(position.x + 0.5, position.y + textPosition, position.z + 0.5) return group } diff --git a/prismarine-viewer/viewer/prepare/atlas.ts b/prismarine-viewer/viewer/prepare/atlas.ts index fc3e4029..cf73fdc4 100644 --- a/prismarine-viewer/viewer/prepare/atlas.ts +++ b/prismarine-viewer/viewer/prepare/atlas.ts @@ -49,19 +49,18 @@ export const makeTextureAtlas = (input: string[], getInputData: (name) => { cont const texturesIndex = {} - let skipXY = [] as [x: number, y: number][] - let offset = 0 + let nextX = 0 + let nextY = 0 + let rowMaxY = 0 + + const goToNextRow = () => { + nextX = 0 + nextY += rowMaxY + rowMaxY = 0 + } + const suSv = tileSize / imgSize for (const i in input) { - const pos = +i + offset - const x = (pos % texSize) * tileSize - const y = Math.floor(pos / texSize) * tileSize - - if (skipXY.some(([sx, sy]) => sx === x + 1 && sy === y)) { - // todo more offsets - offset++ - } - const img = new Image() const keyValue = input[i] const inputData = getInputData(keyValue) @@ -76,16 +75,24 @@ export const makeTextureAtlas = (input: string[], getInputData: (name) => { cont renderHeight = Math.ceil(img.height / tileSize) * tileSize su = renderWidth / imgSize sv = renderHeight / imgSize - if (renderWidth > tileSize) { - offset += Math.ceil(renderWidth / tileSize) - 1 - } - if (renderHeight > tileSize) { - const skipYs = Math.ceil(renderHeight / tileSize) - 1 - for (let i = 1; i <= skipYs; i++) { - skipXY.push([x, y + i]) - } + if (renderHeight > imgSize || renderWidth > imgSize) { + throw new Error('Texture ' + keyValue + ' is too big') } } + + if (nextX + renderWidth > imgSize) { + goToNextRow() + } + + const x = nextX + const y = nextY + + nextX += renderWidth + rowMaxY = Math.max(rowMaxY, renderHeight) + if (nextX >= imgSize) { + goToNextRow() + } + g.drawImage(img, 0, 0, renderWidth, renderHeight, x, y, renderWidth, renderHeight) const cleanName = keyValue.split('.').slice(0, -1).join('.') || keyValue @@ -116,7 +123,7 @@ export function makeBlockTextureAtlas (mcAssets: McAssets) { // const textureFiles = mostEncounteredBlocks.map(x => x + '.png') textureFiles.unshift(...localTextures) - const { generated: additionalTextures, twoTileTextures, origSizeTextures } = getAdditionalTextures() + const { generated: additionalTextures, origSizeTextures } = getAdditionalTextures() textureFiles.push(...Object.keys(additionalTextures)) const atlas = makeTextureAtlas(textureFiles, name => { @@ -129,7 +136,7 @@ export function makeBlockTextureAtlas (mcAssets: McAssets) { return { contents, - tileWidthMult: twoTileTextures.includes(name) ? 2 : undefined, + // tileWidthMult: twoTileTextures.includes(name) ? 2 : undefined, origSizeTextures } }) diff --git a/prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/oak.json b/prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/oak.json new file mode 100644 index 00000000..2f16a429 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/oak.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign", + "textures": { + "sign": "entity/sign" + } +} diff --git a/prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/oak_wall.json b/prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/oak_wall.json new file mode 100644 index 00000000..dfdb230f --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/oak_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign_wall", + "textures": { + "sign": "entity/sign" + } +} diff --git a/prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/sign.json b/prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/sign.json new file mode 100644 index 00000000..4562cfae --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/sign.json @@ -0,0 +1,140 @@ +{ + "elements": [ + { + "from": [ + 7.25, + 0, + 7.25 + ], + "to": [ + 8.75, + 9.333, + 8.75 + ], + "faces": { + "north": { + "uv": [ + 1.5, + 8, + 2, + 15 + ], + "texture": "#sign" + }, + "east": { + "uv": [ + 1, + 8, + 1.5, + 15 + ], + "texture": "#sign" + }, + "south": { + "uv": [ + 0.5, + 8, + 1, + 15 + ], + "texture": "#sign" + }, + "west": { + "uv": [ + 0, + 8, + 0.5, + 15 + ], + "texture": "#sign" + }, + "up": { + "uv": [ + 0.5, + 7, + 1, + 8 + ], + "texture": "#sign" + }, + "down": { + "uv": [ + 1, + 7, + 1.5, + 8 + ], + "texture": "#sign" + } + } + }, + { + "from": [ + 0, + 9.333, + 7.25 + ], + "to": [ + 16, + 17.333, + 8.75 + ], + "faces": { + "north": { + "uv": [ + 7, + 1, + 13, + 7 + ], + "texture": "#sign" + }, + "east": { + "uv": [ + 6.5, + 1, + 7, + 7 + ], + "texture": "#sign" + }, + "south": { + "uv": [ + 0.5, + 1, + 6.5, + 7 + ], + "texture": "#sign" + }, + "west": { + "uv": [ + 0, + 1, + 0.5, + 7 + ], + "texture": "#sign" + }, + "up": { + "uv": [ + 0.5, + 0, + 6.5, + 1 + ], + "texture": "#sign" + }, + "down": { + "uv": [ + 6.5, + 1, + 12.5, + 0 + ], + "texture": "#sign" + } + } + } + ] +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/sign_wall.json b/prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/sign_wall.json new file mode 100644 index 00000000..b743c983 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.13/blockModels/sign/sign_wall.json @@ -0,0 +1,72 @@ +{ + "elements": [ + { + "from": [ + 0, + 4.333, + 0.25 + ], + "to": [ + 16, + 12.333, + 1.75 + ], + "faces": { + "north": { + "uv": [ + 7, + 1, + 13, + 7 + ], + "texture": "#sign" + }, + "east": { + "uv": [ + 6.5, + 1, + 7, + 7 + ], + "texture": "#sign" + }, + "south": { + "uv": [ + 0.5, + 1, + 6.5, + 7 + ], + "texture": "#sign" + }, + "west": { + "uv": [ + 0, + 1, + 0.5, + 7 + ], + "texture": "#sign" + }, + "up": { + "uv": [ + 0.5, + 0, + 6.5, + 1 + ], + "texture": "#sign" + }, + "down": { + "uv": [ + 6.5, + 1, + 12.5, + 0 + ], + "texture": "#sign" + } + } + } + ] +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.13/blockStates/sign/sign.json b/prismarine-viewer/viewer/prepare/data/1.13/blockStates/sign/sign.json new file mode 100644 index 00000000..4ebcedcd --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.13/blockStates/sign/sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/oak" + }, + "rotation=1": { + "model": "sign/oak", + "y": 22.5 + }, + "rotation=2": { + "model": "sign/oak", + "y": 45 + }, + "rotation=3": { + "model": "sign/oak", + "y": 67.5 + }, + "rotation=4": { + "model": "sign/oak", + "y": 90 + }, + "rotation=5": { + "model": "sign/oak", + "y": 112.5 + }, + "rotation=6": { + "model": "sign/oak", + "y": 135 + }, + "rotation=7": { + "model": "sign/oak", + "y": 157.5 + }, + "rotation=8": { + "model": "sign/oak", + "y": 180 + }, + "rotation=9": { + "model": "sign/oak", + "y": 202.5 + }, + "rotation=10": { + "model": "sign/oak", + "y": 225 + }, + "rotation=11": { + "model": "sign/oak", + "y": 247.5 + }, + "rotation=12": { + "model": "sign/oak", + "y": 270 + }, + "rotation=13": { + "model": "sign/oak", + "y": 292.5 + }, + "rotation=14": { + "model": "sign/oak", + "y": 315 + }, + "rotation=15": { + "model": "sign/oak", + "y": 337.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.13/blockStates/sign/wall_sign.json b/prismarine-viewer/viewer/prepare/data/1.13/blockStates/sign/wall_sign.json new file mode 100644 index 00000000..26453d53 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.13/blockStates/sign/wall_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=south": { + "model": "sign/oak_wall" + }, + "facing=west": { + "model": "sign/oak_wall", + "y": 90 + }, + "facing=north": { + "model": "sign/oak_wall", + "y": 180 + }, + "facing=east": { + "model": "sign/oak_wall", + "y": 270 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/acacia.json b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/acacia.json new file mode 100644 index 00000000..7057ded0 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/acacia.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign", + "textures": { + "sign": "entity/signs/acacia" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/acacia_wall.json b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/acacia_wall.json new file mode 100644 index 00000000..70b755bf --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/acacia_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign_wall", + "textures": { + "sign": "entity/signs/acacia" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/birch.json b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/birch.json new file mode 100644 index 00000000..d20d1438 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/birch.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign", + "textures": { + "sign": "entity/signs/birch" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/birch_wall.json b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/birch_wall.json new file mode 100644 index 00000000..c7983bee --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/birch_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign_wall", + "textures": { + "sign": "entity/signs/birch" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/dark_oak.json b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/dark_oak.json new file mode 100644 index 00000000..803add52 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/dark_oak.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign", + "textures": { + "sign": "entity/signs/dark_oak" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/dark_oak_wall.json b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/dark_oak_wall.json new file mode 100644 index 00000000..b410acfe --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/dark_oak_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign_wall", + "textures": { + "sign": "entity/signs/dark_oak" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/jungle.json b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/jungle.json new file mode 100644 index 00000000..17d52250 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/jungle.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign", + "textures": { + "sign": "entity/signs/jungle" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/jungle_wall.json b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/jungle_wall.json new file mode 100644 index 00000000..bfe6c8f8 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/jungle_wall.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/sign_wall", + "textures": { + "sign": "entity/signs/jungle" + } +} diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/spruce.json b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/spruce.json new file mode 100644 index 00000000..8f2b2179 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/spruce.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign", + "textures": { + "sign": "entity/signs/spruce" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/spruce_wall.json b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/spruce_wall.json new file mode 100644 index 00000000..1509eb3c --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockModels/sign/spruce_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign_wall", + "textures": { + "sign": "entity/signs/spruce" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/acacia_sign.json b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/acacia_sign.json new file mode 100644 index 00000000..370c2c84 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/acacia_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/acacia" + }, + "rotation=1": { + "model": "sign/acacia", + "y": 22.5 + }, + "rotation=2": { + "model": "sign/acacia", + "y": 45 + }, + "rotation=3": { + "model": "sign/acacia", + "y": 67.5 + }, + "rotation=4": { + "model": "sign/acacia", + "y": 90 + }, + "rotation=5": { + "model": "sign/acacia", + "y": 112.5 + }, + "rotation=6": { + "model": "sign/acacia", + "y": 135 + }, + "rotation=7": { + "model": "sign/acacia", + "y": 157.5 + }, + "rotation=8": { + "model": "sign/acacia", + "y": 180 + }, + "rotation=9": { + "model": "sign/acacia", + "y": 202.5 + }, + "rotation=10": { + "model": "sign/acacia", + "y": 225 + }, + "rotation=11": { + "model": "sign/acacia", + "y": 247.5 + }, + "rotation=12": { + "model": "sign/acacia", + "y": 270 + }, + "rotation=13": { + "model": "sign/acacia", + "y": 292.5 + }, + "rotation=14": { + "model": "sign/acacia", + "y": 315 + }, + "rotation=15": { + "model": "sign/acacia", + "y": 337.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/acacia_wall_sign.json b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/acacia_wall_sign.json new file mode 100644 index 00000000..b524b126 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/acacia_wall_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=south": { + "model": "sign/acacia_wall" + }, + "facing=west": { + "model": "sign/acacia_wall", + "y": 90 + }, + "facing=north": { + "model": "sign/acacia_wall", + "y": 180 + }, + "facing=east": { + "model": "sign/acacia_wall", + "y": 270 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/birch_sign.json b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/birch_sign.json new file mode 100644 index 00000000..2ffe5fd5 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/birch_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/birch" + }, + "rotation=1": { + "model": "sign/birch", + "y": 22.5 + }, + "rotation=2": { + "model": "sign/birch", + "y": 45 + }, + "rotation=3": { + "model": "sign/birch", + "y": 67.5 + }, + "rotation=4": { + "model": "sign/birch", + "y": 90 + }, + "rotation=5": { + "model": "sign/birch", + "y": 112.5 + }, + "rotation=6": { + "model": "sign/birch", + "y": 135 + }, + "rotation=7": { + "model": "sign/birch", + "y": 157.5 + }, + "rotation=8": { + "model": "sign/birch", + "y": 180 + }, + "rotation=9": { + "model": "sign/birch", + "y": 202.5 + }, + "rotation=10": { + "model": "sign/birch", + "y": 225 + }, + "rotation=11": { + "model": "sign/birch", + "y": 247.5 + }, + "rotation=12": { + "model": "sign/birch", + "y": 270 + }, + "rotation=13": { + "model": "sign/birch", + "y": 292.5 + }, + "rotation=14": { + "model": "sign/birch", + "y": 315 + }, + "rotation=15": { + "model": "sign/birch", + "y": 337.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/birch_wall_sign.json b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/birch_wall_sign.json new file mode 100644 index 00000000..622924b5 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/birch_wall_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=south": { + "model": "sign/birch_wall" + }, + "facing=west": { + "model": "sign/birch_wall", + "y": 90 + }, + "facing=north": { + "model": "sign/birch_wall", + "y": 180 + }, + "facing=east": { + "model": "sign/birch_wall", + "y": 270 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/dark_oak_sign.json b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/dark_oak_sign.json new file mode 100644 index 00000000..6001019b --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/dark_oak_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/dark_oak" + }, + "rotation=1": { + "model": "sign/dark_oak", + "y": 22.5 + }, + "rotation=2": { + "model": "sign/dark_oak", + "y": 45 + }, + "rotation=3": { + "model": "sign/dark_oak", + "y": 67.5 + }, + "rotation=4": { + "model": "sign/dark_oak", + "y": 90 + }, + "rotation=5": { + "model": "sign/dark_oak", + "y": 112.5 + }, + "rotation=6": { + "model": "sign/dark_oak", + "y": 135 + }, + "rotation=7": { + "model": "sign/dark_oak", + "y": 157.5 + }, + "rotation=8": { + "model": "sign/dark_oak", + "y": 180 + }, + "rotation=9": { + "model": "sign/dark_oak", + "y": 202.5 + }, + "rotation=10": { + "model": "sign/dark_oak", + "y": 225 + }, + "rotation=11": { + "model": "sign/dark_oak", + "y": 247.5 + }, + "rotation=12": { + "model": "sign/dark_oak", + "y": 270 + }, + "rotation=13": { + "model": "sign/dark_oak", + "y": 292.5 + }, + "rotation=14": { + "model": "sign/dark_oak", + "y": 315 + }, + "rotation=15": { + "model": "sign/dark_oak", + "y": 337.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/dark_oak_wall_sign.json b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/dark_oak_wall_sign.json new file mode 100644 index 00000000..4b5cc921 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/dark_oak_wall_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=south": { + "model": "sign/dark_oak_wall" + }, + "facing=west": { + "model": "sign/dark_oak_wall", + "y": 90 + }, + "facing=north": { + "model": "sign/dark_oak_wall", + "y": 180 + }, + "facing=east": { + "model": "sign/dark_oak_wall", + "y": 270 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/jungle_sign.json b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/jungle_sign.json new file mode 100644 index 00000000..983c2d68 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/jungle_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/jungle" + }, + "rotation=1": { + "model": "sign/jungle", + "y": 22.5 + }, + "rotation=2": { + "model": "sign/jungle", + "y": 45 + }, + "rotation=3": { + "model": "sign/jungle", + "y": 67.5 + }, + "rotation=4": { + "model": "sign/jungle", + "y": 90 + }, + "rotation=5": { + "model": "sign/jungle", + "y": 112.5 + }, + "rotation=6": { + "model": "sign/jungle", + "y": 135 + }, + "rotation=7": { + "model": "sign/jungle", + "y": 157.5 + }, + "rotation=8": { + "model": "sign/jungle", + "y": 180 + }, + "rotation=9": { + "model": "sign/jungle", + "y": 202.5 + }, + "rotation=10": { + "model": "sign/jungle", + "y": 225 + }, + "rotation=11": { + "model": "sign/jungle", + "y": 247.5 + }, + "rotation=12": { + "model": "sign/jungle", + "y": 270 + }, + "rotation=13": { + "model": "sign/jungle", + "y": 292.5 + }, + "rotation=14": { + "model": "sign/jungle", + "y": 315 + }, + "rotation=15": { + "model": "sign/jungle", + "y": 337.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/jungle_wall_sign.json b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/jungle_wall_sign.json new file mode 100644 index 00000000..898f7323 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/jungle_wall_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=south": { + "model": "sign/jungle_wall" + }, + "facing=west": { + "model": "sign/jungle_wall", + "y": 90 + }, + "facing=north": { + "model": "sign/jungle_wall", + "y": 180 + }, + "facing=east": { + "model": "sign/jungle_wall", + "y": 270 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/oak_sign.json b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/oak_sign.json new file mode 100644 index 00000000..4ebcedcd --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/oak_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/oak" + }, + "rotation=1": { + "model": "sign/oak", + "y": 22.5 + }, + "rotation=2": { + "model": "sign/oak", + "y": 45 + }, + "rotation=3": { + "model": "sign/oak", + "y": 67.5 + }, + "rotation=4": { + "model": "sign/oak", + "y": 90 + }, + "rotation=5": { + "model": "sign/oak", + "y": 112.5 + }, + "rotation=6": { + "model": "sign/oak", + "y": 135 + }, + "rotation=7": { + "model": "sign/oak", + "y": 157.5 + }, + "rotation=8": { + "model": "sign/oak", + "y": 180 + }, + "rotation=9": { + "model": "sign/oak", + "y": 202.5 + }, + "rotation=10": { + "model": "sign/oak", + "y": 225 + }, + "rotation=11": { + "model": "sign/oak", + "y": 247.5 + }, + "rotation=12": { + "model": "sign/oak", + "y": 270 + }, + "rotation=13": { + "model": "sign/oak", + "y": 292.5 + }, + "rotation=14": { + "model": "sign/oak", + "y": 315 + }, + "rotation=15": { + "model": "sign/oak", + "y": 337.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/oak_wall_sign.json b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/oak_wall_sign.json new file mode 100644 index 00000000..26453d53 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/oak_wall_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=south": { + "model": "sign/oak_wall" + }, + "facing=west": { + "model": "sign/oak_wall", + "y": 90 + }, + "facing=north": { + "model": "sign/oak_wall", + "y": 180 + }, + "facing=east": { + "model": "sign/oak_wall", + "y": 270 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/spruce_sign.json b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/spruce_sign.json new file mode 100644 index 00000000..78722223 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/spruce_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/spruce" + }, + "rotation=1": { + "model": "sign/spruce", + "y": 22.5 + }, + "rotation=2": { + "model": "sign/spruce", + "y": 45 + }, + "rotation=3": { + "model": "sign/spruce", + "y": 67.5 + }, + "rotation=4": { + "model": "sign/spruce", + "y": 90 + }, + "rotation=5": { + "model": "sign/spruce", + "y": 112.5 + }, + "rotation=6": { + "model": "sign/spruce", + "y": 135 + }, + "rotation=7": { + "model": "sign/spruce", + "y": 157.5 + }, + "rotation=8": { + "model": "sign/spruce", + "y": 180 + }, + "rotation=9": { + "model": "sign/spruce", + "y": 202.5 + }, + "rotation=10": { + "model": "sign/spruce", + "y": 225 + }, + "rotation=11": { + "model": "sign/spruce", + "y": 247.5 + }, + "rotation=12": { + "model": "sign/spruce", + "y": 270 + }, + "rotation=13": { + "model": "sign/spruce", + "y": 292.5 + }, + "rotation=14": { + "model": "sign/spruce", + "y": 315 + }, + "rotation=15": { + "model": "sign/spruce", + "y": 337.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/spruce_wall_sign.json b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/spruce_wall_sign.json new file mode 100644 index 00000000..8366709a --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.14/blockStates/sign/spruce_wall_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=south": { + "model": "sign/spruce_wall" + }, + "facing=west": { + "model": "sign/spruce_wall", + "y": 90 + }, + "facing=north": { + "model": "sign/spruce_wall", + "y": 180 + }, + "facing=east": { + "model": "sign/spruce_wall", + "y": 270 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/crimson.json b/prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/crimson.json new file mode 100644 index 00000000..201e42ad --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/crimson.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign", + "textures": { + "sign": "entity/signs/crimson" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/crimson_wall.json b/prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/crimson_wall.json new file mode 100644 index 00000000..3faf8661 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/crimson_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign_wall", + "textures": { + "sign": "entity/signs/crimson" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/warped.json b/prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/warped.json new file mode 100644 index 00000000..6dd3269e --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/warped.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign", + "textures": { + "sign": "entity/signs/warped" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/warped_wall.json b/prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/warped_wall.json new file mode 100644 index 00000000..a046ec14 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.16/blockModels/sign/warped_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign_wall", + "textures": { + "sign": "entity/signs/warped" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/crimson_sign.json b/prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/crimson_sign.json new file mode 100644 index 00000000..5df00a29 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/crimson_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/crimson" + }, + "rotation=1": { + "model": "sign/crimson", + "y": 22.5 + }, + "rotation=2": { + "model": "sign/crimson", + "y": 45 + }, + "rotation=3": { + "model": "sign/crimson", + "y": 67.5 + }, + "rotation=4": { + "model": "sign/crimson", + "y": 90 + }, + "rotation=5": { + "model": "sign/crimson", + "y": 112.5 + }, + "rotation=6": { + "model": "sign/crimson", + "y": 135 + }, + "rotation=7": { + "model": "sign/crimson", + "y": 157.5 + }, + "rotation=8": { + "model": "sign/crimson", + "y": 180 + }, + "rotation=9": { + "model": "sign/crimson", + "y": 202.5 + }, + "rotation=10": { + "model": "sign/crimson", + "y": 225 + }, + "rotation=11": { + "model": "sign/crimson", + "y": 247.5 + }, + "rotation=12": { + "model": "sign/crimson", + "y": 270 + }, + "rotation=13": { + "model": "sign/crimson", + "y": 292.5 + }, + "rotation=14": { + "model": "sign/crimson", + "y": 315 + }, + "rotation=15": { + "model": "sign/crimson", + "y": 337.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/crimson_wall_sign.json b/prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/crimson_wall_sign.json new file mode 100644 index 00000000..149227b2 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/crimson_wall_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=south": { + "model": "sign/crimson_wall" + }, + "facing=west": { + "model": "sign/crimson_wall", + "y": 90 + }, + "facing=north": { + "model": "sign/crimson_wall", + "y": 180 + }, + "facing=east": { + "model": "sign/crimson_wall", + "y": 270 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/warped_sign.json b/prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/warped_sign.json new file mode 100644 index 00000000..4af216ca --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/warped_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/warped" + }, + "rotation=1": { + "model": "sign/warped", + "y": 22.5 + }, + "rotation=2": { + "model": "sign/warped", + "y": 45 + }, + "rotation=3": { + "model": "sign/warped", + "y": 67.5 + }, + "rotation=4": { + "model": "sign/warped", + "y": 90 + }, + "rotation=5": { + "model": "sign/warped", + "y": 112.5 + }, + "rotation=6": { + "model": "sign/warped", + "y": 135 + }, + "rotation=7": { + "model": "sign/warped", + "y": 157.5 + }, + "rotation=8": { + "model": "sign/warped", + "y": 180 + }, + "rotation=9": { + "model": "sign/warped", + "y": 202.5 + }, + "rotation=10": { + "model": "sign/warped", + "y": 225 + }, + "rotation=11": { + "model": "sign/warped", + "y": 247.5 + }, + "rotation=12": { + "model": "sign/warped", + "y": 270 + }, + "rotation=13": { + "model": "sign/warped", + "y": 292.5 + }, + "rotation=14": { + "model": "sign/warped", + "y": 315 + }, + "rotation=15": { + "model": "sign/warped", + "y": 337.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/warped_wall_sign.json b/prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/warped_wall_sign.json new file mode 100644 index 00000000..b1d7f5e0 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.16/blockStates/sign/warped_wall_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=south": { + "model": "sign/warped_wall" + }, + "facing=west": { + "model": "sign/warped_wall", + "y": 90 + }, + "facing=north": { + "model": "sign/warped_wall", + "y": 180 + }, + "facing=east": { + "model": "sign/warped_wall", + "y": 270 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.19/blockModels/sign/mangrove.json b/prismarine-viewer/viewer/prepare/data/1.19/blockModels/sign/mangrove.json new file mode 100644 index 00000000..bb82e85a --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.19/blockModels/sign/mangrove.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign", + "textures": { + "sign": "entity/signs/mangrove" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.19/blockModels/sign/mangrove_wall.json b/prismarine-viewer/viewer/prepare/data/1.19/blockModels/sign/mangrove_wall.json new file mode 100644 index 00000000..30e9bd55 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.19/blockModels/sign/mangrove_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign_wall", + "textures": { + "sign": "entity/signs/mangrove" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.19/blockStates/sign/mangrove_sign.json b/prismarine-viewer/viewer/prepare/data/1.19/blockStates/sign/mangrove_sign.json new file mode 100644 index 00000000..54a92e7e --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.19/blockStates/sign/mangrove_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/mangrove" + }, + "rotation=1": { + "model": "sign/mangrove", + "y": 22.5 + }, + "rotation=2": { + "model": "sign/mangrove", + "y": 45 + }, + "rotation=3": { + "model": "sign/mangrove", + "y": 67.5 + }, + "rotation=4": { + "model": "sign/mangrove", + "y": 90 + }, + "rotation=5": { + "model": "sign/mangrove", + "y": 112.5 + }, + "rotation=6": { + "model": "sign/mangrove", + "y": 135 + }, + "rotation=7": { + "model": "sign/mangrove", + "y": 157.5 + }, + "rotation=8": { + "model": "sign/mangrove", + "y": 180 + }, + "rotation=9": { + "model": "sign/mangrove", + "y": 202.5 + }, + "rotation=10": { + "model": "sign/mangrove", + "y": 225 + }, + "rotation=11": { + "model": "sign/mangrove", + "y": 247.5 + }, + "rotation=12": { + "model": "sign/mangrove", + "y": 270 + }, + "rotation=13": { + "model": "sign/mangrove", + "y": 292.5 + }, + "rotation=14": { + "model": "sign/mangrove", + "y": 315 + }, + "rotation=15": { + "model": "sign/mangrove", + "y": 337.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.19/blockStates/sign/mangrove_wall_sign.json b/prismarine-viewer/viewer/prepare/data/1.19/blockStates/sign/mangrove_wall_sign.json new file mode 100644 index 00000000..d00760e7 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.19/blockStates/sign/mangrove_wall_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=south": { + "model": "sign/mangrove_wall" + }, + "facing=west": { + "model": "sign/mangrove_wall", + "y": 90 + }, + "facing=north": { + "model": "sign/mangrove_wall", + "y": 180 + }, + "facing=east": { + "model": "sign/mangrove_wall", + "y": 270 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/acacia_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/acacia_hanging.json new file mode 100644 index 00000000..13702388 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/acacia_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/hanging", + "textures": { + "wood": "entity/signs/hanging/acacia" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/acacia_wall_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/acacia_wall_hanging.json new file mode 100644 index 00000000..1e2a9d85 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/acacia_wall_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/wall_hanging", + "textures": { + "wood": "entity/signs/hanging/acacia" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo.json new file mode 100644 index 00000000..6c9fd930 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign", + "textures": { + "sign": "entity/signs/bamboo" + } +} diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo_hanging.json new file mode 100644 index 00000000..c5302b1b --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/hanging", + "textures": { + "wood": "entity/signs/hanging/bamboo" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo_wall.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo_wall.json new file mode 100644 index 00000000..bf726f10 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign_wall", + "textures": { + "sign": "entity/signs/bamboo" + } +} diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo_wall_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo_wall_hanging.json new file mode 100644 index 00000000..d3a46453 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/bamboo_wall_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/wall_hanging", + "textures": { + "wood": "entity/signs/hanging/bamboo" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/birch_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/birch_hanging.json new file mode 100644 index 00000000..71a4b708 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/birch_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/hanging", + "textures": { + "wood": "entity/signs/hanging/birch" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/birch_wall_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/birch_wall_hanging.json new file mode 100644 index 00000000..13b215a5 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/birch_wall_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/wall_hanging", + "textures": { + "wood": "entity/signs/hanging/birch" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry.json new file mode 100644 index 00000000..406c6318 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign", + "textures": { + "sign": "entity/signs/cherry" + } +} diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry_hanging.json new file mode 100644 index 00000000..6ff4c5b7 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/hanging", + "textures": { + "wood": "entity/signs/hanging/cherry" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry_wall.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry_wall.json new file mode 100644 index 00000000..b3b07061 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "sign/sign_wall", + "textures": { + "sign": "entity/signs/cherry" + } +} diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry_wall_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry_wall_hanging.json new file mode 100644 index 00000000..aeef94bd --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/cherry_wall_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/wall_hanging", + "textures": { + "wood": "entity/signs/hanging/cherry" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/crimson_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/crimson_hanging.json new file mode 100644 index 00000000..a6c9286a --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/crimson_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/hanging", + "textures": { + "wood": "entity/signs/hanging/crimson" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/crimson_wall_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/crimson_wall_hanging.json new file mode 100644 index 00000000..20889940 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/crimson_wall_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/wall_hanging", + "textures": { + "wood": "entity/signs/hanging/crimson" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/dark_oak_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/dark_oak_hanging.json new file mode 100644 index 00000000..506c4440 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/dark_oak_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/hanging", + "textures": { + "wood": "entity/signs/hanging/dark_oak" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/dark_oak_wall_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/dark_oak_wall_hanging.json new file mode 100644 index 00000000..21c1ebd5 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/dark_oak_wall_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/wall_hanging", + "textures": { + "wood": "entity/signs/hanging/dark_oak" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/hanging.json new file mode 100644 index 00000000..52d90ee3 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/hanging.json @@ -0,0 +1,115 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "ambientocclusion": false, + "texture_size": [ + 64, + 32 + ], + "textures": { + "wood": "entity/signs/hanging/oak" + }, + "elements": [ + { + "name": "Sign", + "from": [ + 1, + 0, + 7 + ], + "to": [ + 15, + 10, + 9 + ], + "faces": { + "north": { + "uv": [ + 4.5, + 7, + 8, + 12 + ], + "texture": "#wood" + }, + "east": { + "uv": [ + 4, + 7, + 4.5, + 12 + ], + "texture": "#wood" + }, + "south": { + "uv": [ + 0.5, + 7, + 4, + 12 + ], + "texture": "#wood" + }, + "west": { + "uv": [ + 0, + 7, + 0.5, + 12 + ], + "texture": "#wood" + }, + "up": { + "uv": [ + 4, + 6, + 0.5, + 7 + ], + "rotation": 180, + "texture": "#wood" + }, + "down": { + "uv": [ + 4, + 7, + 7.5, + 6 + ], + "texture": "#wood" + } + } + }, + { + "from": [ + 2, + 10, + 8 + ], + "to": [ + 14, + 16, + 8 + ], + "faces": { + "north": { + "uv": [ + 3.5, + 3, + 6.5, + 6 + ], + "texture": "#wood" + }, + "south": { + "uv": [ + 3.5, + 3, + 6.5, + 6 + ], + "texture": "#wood" + } + } + } + ] +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/jungle_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/jungle_hanging.json new file mode 100644 index 00000000..db141f6d --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/jungle_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/hanging", + "textures": { + "wood": "entity/signs/hanging/jungle" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/jungle_wall_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/jungle_wall_hanging.json new file mode 100644 index 00000000..aefe92f3 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/jungle_wall_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/wall_hanging", + "textures": { + "wood": "entity/signs/hanging/jungle" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/mangrove_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/mangrove_hanging.json new file mode 100644 index 00000000..e84c41f2 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/mangrove_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/hanging", + "textures": { + "wood": "entity/signs/hanging/mangrove" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/mangrove_wall_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/mangrove_wall_hanging.json new file mode 100644 index 00000000..e5feb72e --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/mangrove_wall_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/wall_hanging", + "textures": { + "wood": "entity/signs/hanging/mangrove" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/oak_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/oak_hanging.json new file mode 100644 index 00000000..7437c82f --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/oak_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/hanging", + "textures": { + "wood": "entity/signs/hanging/oak" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/oak_wall_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/oak_wall_hanging.json new file mode 100644 index 00000000..3c8d9e5e --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/oak_wall_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/wall_hanging", + "textures": { + "wood": "entity/signs/hanging/oak" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/spruce_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/spruce_hanging.json new file mode 100644 index 00000000..3dee635d --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/spruce_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/hanging", + "textures": { + "wood": "entity/signs/hanging/spruce" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/spruce_wall_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/spruce_wall_hanging.json new file mode 100644 index 00000000..71e66b9c --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/spruce_wall_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/wall_hanging", + "textures": { + "wood": "entity/signs/hanging/spruce" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/wall_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/wall_hanging.json new file mode 100644 index 00000000..424ffe37 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/wall_hanging.json @@ -0,0 +1,347 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "ambientocclusion": false, + "texture_size": [ + 64, + 32 + ], + "textures": { + "wood": "entity/signs/hanging/oak" + }, + "elements": [ + { + "name": "Sign", + "from": [ + 1, + 0, + 7 + ], + "to": [ + 15, + 10, + 9 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 8, + 8, + 8 + ] + }, + "faces": { + "north": { + "uv": [ + 4.5, + 7, + 8, + 12 + ], + "texture": "#wood" + }, + "east": { + "uv": [ + 4, + 7, + 4.5, + 12 + ], + "texture": "#wood" + }, + "south": { + "uv": [ + 0.5, + 7, + 4, + 12 + ], + "texture": "#wood" + }, + "west": { + "uv": [ + 0, + 7, + 0.5, + 12 + ], + "texture": "#wood" + }, + "up": { + "uv": [ + 4, + 6, + 0.5, + 7 + ], + "rotation": 180, + "texture": "#wood" + }, + "down": { + "uv": [ + 4, + 7, + 7.5, + 6 + ], + "texture": "#wood" + } + } + }, + { + "name": "Hanger", + "from": [ + 0, + 14, + 6 + ], + "to": [ + 16, + 16, + 10 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 8, + 8, + 8 + ] + }, + "faces": { + "north": { + "uv": [ + 6, + 2, + 10, + 3 + ], + "texture": "#wood" + }, + "east": { + "uv": [ + 0, + 2, + 1, + 3 + ], + "texture": "#wood" + }, + "south": { + "uv": [ + 1, + 2, + 5, + 3 + ], + "texture": "#wood" + }, + "west": { + "uv": [ + 0, + 2, + 1, + 3 + ], + "texture": "#wood" + }, + "up": { + "uv": [ + 1, + 0, + 5, + 2 + ], + "rotation": 180, + "texture": "#wood" + }, + "down": { + "uv": [ + 5, + 0, + 9, + 2 + ], + "texture": "#wood" + } + } + }, + { + "name": "ChainA1", + "from": [ + 4.8, + 10, + 10.5 + ], + "to": [ + 6.2, + 14, + 10.5 + ], + "shade": false, + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 8, + 8 + ], + "rescale": true + }, + "faces": { + "north": { + "uv": [ + 1.5, + 3, + 2.25, + 6 + ], + "texture": "#wood" + }, + "south": { + "uv": [ + 1.5, + 3, + 2.25, + 6 + ], + "texture": "#wood" + } + } + }, + { + "name": "ChainB2", + "from": [ + 10.5, + 10, + 4.8 + ], + "to": [ + 10.5, + 14, + 6.2 + ], + "shade": false, + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 8, + 8 + ], + "rescale": true + }, + "faces": { + "east": { + "uv": [ + 0, + 3, + 0.75, + 6 + ], + "texture": "#wood" + }, + "west": { + "uv": [ + 0, + 3, + 0.75, + 6 + ], + "texture": "#wood" + } + } + }, + { + "name": "ChainB1", + "from": [ + 9.8, + 10, + 5.5 + ], + "to": [ + 11.2, + 14, + 5.5 + ], + "shade": false, + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 8, + 8 + ], + "rescale": true + }, + "faces": { + "north": { + "uv": [ + 1.5, + 3, + 2.25, + 6 + ], + "texture": "#wood" + }, + "south": { + "uv": [ + 1.5, + 3, + 2.25, + 6 + ], + "texture": "#wood" + } + } + }, + { + "name": "ChainA2", + "from": [ + 5.5, + 10, + 9.8 + ], + "to": [ + 5.5, + 14, + 11.2 + ], + "shade": false, + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 8, + 8 + ], + "rescale": true + }, + "faces": { + "east": { + "uv": [ + 0, + 3, + 0.75, + 6 + ], + "texture": "#wood" + }, + "west": { + "uv": [ + 0, + 3, + 0.75, + 6 + ], + "texture": "#wood" + } + } + } + ] +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/warped_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/warped_hanging.json new file mode 100644 index 00000000..015ba2c0 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/warped_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/hanging", + "textures": { + "wood": "entity/signs/hanging/warped" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/warped_wall_hanging.json b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/warped_wall_hanging.json new file mode 100644 index 00000000..8870c317 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockModels/sign/warped_wall_hanging.json @@ -0,0 +1,7 @@ +{ + "credit": "Made with Blockbench by TyBraniff for Bluemaps support.", + "parent": "sign/wall_hanging", + "textures": { + "wood": "entity/signs/hanging/warped" + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/acacia_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/acacia_hanging_sign.json new file mode 100644 index 00000000..18a25013 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/acacia_hanging_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/acacia_hanging", + "y": 180 + }, + "rotation=1": { + "model": "sign/acacia_hanging", + "y": 202.5 + }, + "rotation=2": { + "model": "sign/acacia_hanging", + "y": 225 + }, + "rotation=3": { + "model": "sign/acacia_hanging", + "y": 247.5 + }, + "rotation=4": { + "model": "sign/acacia_hanging", + "y": 270 + }, + "rotation=5": { + "model": "sign/acacia_hanging", + "y": 292.5 + }, + "rotation=6": { + "model": "sign/acacia_hanging", + "y": 315 + }, + "rotation=7": { + "model": "sign/acacia_hanging", + "y": 337.5 + }, + "rotation=8": { + "model": "sign/acacia_hanging" + }, + "rotation=9": { + "model": "sign/acacia_hanging", + "y": 22.5 + }, + "rotation=10": { + "model": "sign/acacia_hanging", + "y": 45 + }, + "rotation=11": { + "model": "sign/acacia_hanging", + "y": 67.5 + }, + "rotation=12": { + "model": "sign/acacia_hanging", + "y": 90 + }, + "rotation=13": { + "model": "sign/acacia_hanging", + "y": 112.5 + }, + "rotation=14": { + "model": "sign/acacia_hanging", + "y": 135 + }, + "rotation=15": { + "model": "sign/acacia_hanging", + "y": 157.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/acacia_wall_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/acacia_wall_hanging_sign.json new file mode 100644 index 00000000..edbae40d --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/acacia_wall_hanging_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "sign/acacia_wall_hanging", + "y": 90 + }, + "facing=south": { + "model": "sign/acacia_wall_hanging", + "y": 180 + }, + "facing=west": { + "model": "sign/acacia_wall_hanging", + "y": 270 + }, + "facing=north": { + "model": "sign/acacia_wall_hanging" + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_hanging_sign.json new file mode 100644 index 00000000..5ff1854b --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_hanging_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/bamboo_hanging", + "y": 180 + }, + "rotation=1": { + "model": "sign/bamboo_hanging", + "y": 202.5 + }, + "rotation=2": { + "model": "sign/bamboo_hanging", + "y": 225 + }, + "rotation=3": { + "model": "sign/bamboo_hanging", + "y": 247.5 + }, + "rotation=4": { + "model": "sign/bamboo_hanging", + "y": 270 + }, + "rotation=5": { + "model": "sign/bamboo_hanging", + "y": 292.5 + }, + "rotation=6": { + "model": "sign/bamboo_hanging", + "y": 315 + }, + "rotation=7": { + "model": "sign/bamboo_hanging", + "y": 337.5 + }, + "rotation=8": { + "model": "sign/bamboo_hanging" + }, + "rotation=9": { + "model": "sign/bamboo_hanging", + "y": 22.5 + }, + "rotation=10": { + "model": "sign/bamboo_hanging", + "y": 45 + }, + "rotation=11": { + "model": "sign/bamboo_hanging", + "y": 67.5 + }, + "rotation=12": { + "model": "sign/bamboo_hanging", + "y": 90 + }, + "rotation=13": { + "model": "sign/bamboo_hanging", + "y": 112.5 + }, + "rotation=14": { + "model": "sign/bamboo_hanging", + "y": 135 + }, + "rotation=15": { + "model": "sign/bamboo_hanging", + "y": 157.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_sign.json new file mode 100644 index 00000000..1041460a --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/bamboo" + }, + "rotation=1": { + "model": "sign/bamboo", + "y": 22.5 + }, + "rotation=2": { + "model": "sign/bamboo", + "y": 45 + }, + "rotation=3": { + "model": "sign/bamboo", + "y": 67.5 + }, + "rotation=4": { + "model": "sign/bamboo", + "y": 90 + }, + "rotation=5": { + "model": "sign/bamboo", + "y": 112.5 + }, + "rotation=6": { + "model": "sign/bamboo", + "y": 135 + }, + "rotation=7": { + "model": "sign/bamboo", + "y": 157.5 + }, + "rotation=8": { + "model": "sign/bamboo", + "y": 180 + }, + "rotation=9": { + "model": "sign/bamboo", + "y": 202.5 + }, + "rotation=10": { + "model": "sign/bamboo", + "y": 225 + }, + "rotation=11": { + "model": "sign/bamboo", + "y": 247.5 + }, + "rotation=12": { + "model": "sign/bamboo", + "y": 270 + }, + "rotation=13": { + "model": "sign/bamboo", + "y": 292.5 + }, + "rotation=14": { + "model": "sign/bamboo", + "y": 315 + }, + "rotation=15": { + "model": "sign/bamboo", + "y": 337.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_wall_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_wall_hanging_sign.json new file mode 100644 index 00000000..3bd24804 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_wall_hanging_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "sign/bamboo_wall_hanging", + "y": 90 + }, + "facing=south": { + "model": "sign/bamboo_wall_hanging", + "y": 180 + }, + "facing=west": { + "model": "sign/bamboo_wall_hanging", + "y": 270 + }, + "facing=north": { + "model": "sign/bamboo_wall_hanging" + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_wall_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_wall_sign.json new file mode 100644 index 00000000..8b5ce481 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/bamboo_wall_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=south": { + "model": "sign/bamboo_wall" + }, + "facing=west": { + "model": "sign/bamboo_wall", + "y": 90 + }, + "facing=north": { + "model": "sign/bamboo_wall", + "y": 180 + }, + "facing=east": { + "model": "sign/bamboo_wall", + "y": 270 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/birch_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/birch_hanging_sign.json new file mode 100644 index 00000000..6052d4f7 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/birch_hanging_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/birch_hanging", + "y": 180 + }, + "rotation=1": { + "model": "sign/birch_hanging", + "y": 202.5 + }, + "rotation=2": { + "model": "sign/birch_hanging", + "y": 225 + }, + "rotation=3": { + "model": "sign/birch_hanging", + "y": 247.5 + }, + "rotation=4": { + "model": "sign/birch_hanging", + "y": 270 + }, + "rotation=5": { + "model": "sign/birch_hanging", + "y": 292.5 + }, + "rotation=6": { + "model": "sign/birch_hanging", + "y": 315 + }, + "rotation=7": { + "model": "sign/birch_hanging", + "y": 337.5 + }, + "rotation=8": { + "model": "sign/birch_hanging" + }, + "rotation=9": { + "model": "sign/birch_hanging", + "y": 22.5 + }, + "rotation=10": { + "model": "sign/birch_hanging", + "y": 45 + }, + "rotation=11": { + "model": "sign/birch_hanging", + "y": 67.5 + }, + "rotation=12": { + "model": "sign/birch_hanging", + "y": 90 + }, + "rotation=13": { + "model": "sign/birch_hanging", + "y": 112.5 + }, + "rotation=14": { + "model": "sign/birch_hanging", + "y": 135 + }, + "rotation=15": { + "model": "sign/birch_hanging", + "y": 157.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/birch_wall_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/birch_wall_hanging_sign.json new file mode 100644 index 00000000..656e8093 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/birch_wall_hanging_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "sign/birch_wall_hanging", + "y": 90 + }, + "facing=south": { + "model": "sign/birch_wall_hanging", + "y": 180 + }, + "facing=west": { + "model": "sign/birch_wall_hanging", + "y": 270 + }, + "facing=north": { + "model": "sign/birch_wall_hanging" + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_hanging_sign.json new file mode 100644 index 00000000..32ce33dc --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_hanging_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/cherry_hanging", + "y": 180 + }, + "rotation=1": { + "model": "sign/cherry_hanging", + "y": 202.5 + }, + "rotation=2": { + "model": "sign/cherry_hanging", + "y": 225 + }, + "rotation=3": { + "model": "sign/cherry_hanging", + "y": 247.5 + }, + "rotation=4": { + "model": "sign/cherry_hanging", + "y": 270 + }, + "rotation=5": { + "model": "sign/cherry_hanging", + "y": 292.5 + }, + "rotation=6": { + "model": "sign/cherry_hanging", + "y": 315 + }, + "rotation=7": { + "model": "sign/cherry_hanging", + "y": 337.5 + }, + "rotation=8": { + "model": "sign/cherry_hanging" + }, + "rotation=9": { + "model": "sign/cherry_hanging", + "y": 22.5 + }, + "rotation=10": { + "model": "sign/cherry_hanging", + "y": 45 + }, + "rotation=11": { + "model": "sign/cherry_hanging", + "y": 67.5 + }, + "rotation=12": { + "model": "sign/cherry_hanging", + "y": 90 + }, + "rotation=13": { + "model": "sign/cherry_hanging", + "y": 112.5 + }, + "rotation=14": { + "model": "sign/cherry_hanging", + "y": 135 + }, + "rotation=15": { + "model": "sign/cherry_hanging", + "y": 157.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_sign.json new file mode 100644 index 00000000..4e562a26 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/cherry" + }, + "rotation=1": { + "model": "sign/cherry", + "y": 22.5 + }, + "rotation=2": { + "model": "sign/cherry", + "y": 45 + }, + "rotation=3": { + "model": "sign/cherry", + "y": 67.5 + }, + "rotation=4": { + "model": "sign/cherry", + "y": 90 + }, + "rotation=5": { + "model": "sign/cherry", + "y": 112.5 + }, + "rotation=6": { + "model": "sign/cherry", + "y": 135 + }, + "rotation=7": { + "model": "sign/cherry", + "y": 157.5 + }, + "rotation=8": { + "model": "sign/cherry", + "y": 180 + }, + "rotation=9": { + "model": "sign/cherry", + "y": 202.5 + }, + "rotation=10": { + "model": "sign/cherry", + "y": 225 + }, + "rotation=11": { + "model": "sign/cherry", + "y": 247.5 + }, + "rotation=12": { + "model": "sign/cherry", + "y": 270 + }, + "rotation=13": { + "model": "sign/cherry", + "y": 292.5 + }, + "rotation=14": { + "model": "sign/cherry", + "y": 315 + }, + "rotation=15": { + "model": "sign/cherry", + "y": 337.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_wall_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_wall_hanging_sign.json new file mode 100644 index 00000000..3e0a2d04 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_wall_hanging_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "sign/cherry_wall_hanging", + "y": 90 + }, + "facing=south": { + "model": "sign/cherry_wall_hanging", + "y": 180 + }, + "facing=west": { + "model": "sign/cherry_wall_hanging", + "y": 270 + }, + "facing=north": { + "model": "sign/cherry_wall_hanging" + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_wall_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_wall_sign.json new file mode 100644 index 00000000..1b13342c --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/cherry_wall_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=south": { + "model": "sign/cherry_wall" + }, + "facing=west": { + "model": "sign/cherry_wall", + "y": 90 + }, + "facing=north": { + "model": "sign/cherry_wall", + "y": 180 + }, + "facing=east": { + "model": "sign/cherry_wall", + "y": 270 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/crimson_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/crimson_hanging_sign.json new file mode 100644 index 00000000..6e4131f2 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/crimson_hanging_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/crimson_hanging", + "y": 180 + }, + "rotation=1": { + "model": "sign/crimson_hanging", + "y": 202.5 + }, + "rotation=2": { + "model": "sign/crimson_hanging", + "y": 225 + }, + "rotation=3": { + "model": "sign/crimson_hanging", + "y": 247.5 + }, + "rotation=4": { + "model": "sign/crimson_hanging", + "y": 270 + }, + "rotation=5": { + "model": "sign/crimson_hanging", + "y": 292.5 + }, + "rotation=6": { + "model": "sign/crimson_hanging", + "y": 315 + }, + "rotation=7": { + "model": "sign/crimson_hanging", + "y": 337.5 + }, + "rotation=8": { + "model": "sign/crimson_hanging" + }, + "rotation=9": { + "model": "sign/crimson_hanging", + "y": 22.5 + }, + "rotation=10": { + "model": "sign/crimson_hanging", + "y": 45 + }, + "rotation=11": { + "model": "sign/crimson_hanging", + "y": 67.5 + }, + "rotation=12": { + "model": "sign/crimson_hanging", + "y": 90 + }, + "rotation=13": { + "model": "sign/crimson_hanging", + "y": 112.5 + }, + "rotation=14": { + "model": "sign/crimson_hanging", + "y": 135 + }, + "rotation=15": { + "model": "sign/crimson_hanging", + "y": 157.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/crimson_wall_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/crimson_wall_hanging_sign.json new file mode 100644 index 00000000..63c560ae --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/crimson_wall_hanging_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "sign/crimson_wall_hanging", + "y": 90 + }, + "facing=south": { + "model": "sign/crimson_wall_hanging", + "y": 180 + }, + "facing=west": { + "model": "sign/crimson_wall_hanging", + "y": 270 + }, + "facing=north": { + "model": "sign/crimson_wall_hanging" + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/dark_oak_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/dark_oak_hanging_sign.json new file mode 100644 index 00000000..a2bc0458 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/dark_oak_hanging_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/dark_oak_hanging", + "y": 180 + }, + "rotation=1": { + "model": "sign/dark_oak_hanging", + "y": 202.5 + }, + "rotation=2": { + "model": "sign/dark_oak_hanging", + "y": 225 + }, + "rotation=3": { + "model": "sign/dark_oak_hanging", + "y": 247.5 + }, + "rotation=4": { + "model": "sign/dark_oak_hanging", + "y": 270 + }, + "rotation=5": { + "model": "sign/dark_oak_hanging", + "y": 292.5 + }, + "rotation=6": { + "model": "sign/dark_oak_hanging", + "y": 315 + }, + "rotation=7": { + "model": "sign/dark_oak_hanging", + "y": 337.5 + }, + "rotation=8": { + "model": "sign/dark_oak_hanging" + }, + "rotation=9": { + "model": "sign/dark_oak_hanging", + "y": 22.5 + }, + "rotation=10": { + "model": "sign/dark_oak_hanging", + "y": 45 + }, + "rotation=11": { + "model": "sign/dark_oak_hanging", + "y": 67.5 + }, + "rotation=12": { + "model": "sign/dark_oak_hanging", + "y": 90 + }, + "rotation=13": { + "model": "sign/dark_oak_hanging", + "y": 112.5 + }, + "rotation=14": { + "model": "sign/dark_oak_hanging", + "y": 135 + }, + "rotation=15": { + "model": "sign/dark_oak_hanging", + "y": 157.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/dark_oak_wall_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/dark_oak_wall_hanging_sign.json new file mode 100644 index 00000000..138154f9 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/dark_oak_wall_hanging_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "sign/dark_oak_wall_hanging", + "y": 90 + }, + "facing=south": { + "model": "sign/dark_oak_wall_hanging", + "y": 180 + }, + "facing=west": { + "model": "sign/dark_oak_wall_hanging", + "y": 270 + }, + "facing=north": { + "model": "sign/dark_oak_wall_hanging" + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/jungle_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/jungle_hanging_sign.json new file mode 100644 index 00000000..9f1f9eeb --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/jungle_hanging_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/jungle_hanging", + "y": 180 + }, + "rotation=1": { + "model": "sign/jungle_hanging", + "y": 202.5 + }, + "rotation=2": { + "model": "sign/jungle_hanging", + "y": 225 + }, + "rotation=3": { + "model": "sign/jungle_hanging", + "y": 247.5 + }, + "rotation=4": { + "model": "sign/jungle_hanging", + "y": 270 + }, + "rotation=5": { + "model": "sign/jungle_hanging", + "y": 292.5 + }, + "rotation=6": { + "model": "sign/jungle_hanging", + "y": 315 + }, + "rotation=7": { + "model": "sign/jungle_hanging", + "y": 337.5 + }, + "rotation=8": { + "model": "sign/jungle_hanging" + }, + "rotation=9": { + "model": "sign/jungle_hanging", + "y": 22.5 + }, + "rotation=10": { + "model": "sign/jungle_hanging", + "y": 45 + }, + "rotation=11": { + "model": "sign/jungle_hanging", + "y": 67.5 + }, + "rotation=12": { + "model": "sign/jungle_hanging", + "y": 90 + }, + "rotation=13": { + "model": "sign/jungle_hanging", + "y": 112.5 + }, + "rotation=14": { + "model": "sign/jungle_hanging", + "y": 135 + }, + "rotation=15": { + "model": "sign/jungle_hanging", + "y": 157.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/jungle_wall_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/jungle_wall_hanging_sign.json new file mode 100644 index 00000000..3bdb8191 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/jungle_wall_hanging_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "sign/jungle_wall_hanging", + "y": 90 + }, + "facing=south": { + "model": "sign/jungle_wall_hanging", + "y": 180 + }, + "facing=west": { + "model": "sign/jungle_wall_hanging", + "y": 270 + }, + "facing=north": { + "model": "sign/jungle_wall_hanging" + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/mangrove_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/mangrove_hanging_sign.json new file mode 100644 index 00000000..ff977160 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/mangrove_hanging_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/mangrove_hanging", + "y": 180 + }, + "rotation=1": { + "model": "sign/mangrove_hanging", + "y": 202.5 + }, + "rotation=2": { + "model": "sign/mangrove_hanging", + "y": 225 + }, + "rotation=3": { + "model": "sign/mangrove_hanging", + "y": 247.5 + }, + "rotation=4": { + "model": "sign/mangrove_hanging", + "y": 270 + }, + "rotation=5": { + "model": "sign/mangrove_hanging", + "y": 292.5 + }, + "rotation=6": { + "model": "sign/mangrove_hanging", + "y": 315 + }, + "rotation=7": { + "model": "sign/mangrove_hanging", + "y": 337.5 + }, + "rotation=8": { + "model": "sign/mangrove_hanging" + }, + "rotation=9": { + "model": "sign/mangrove_hanging", + "y": 22.5 + }, + "rotation=10": { + "model": "sign/mangrove_hanging", + "y": 45 + }, + "rotation=11": { + "model": "sign/mangrove_hanging", + "y": 67.5 + }, + "rotation=12": { + "model": "sign/mangrove_hanging", + "y": 90 + }, + "rotation=13": { + "model": "sign/mangrove_hanging", + "y": 112.5 + }, + "rotation=14": { + "model": "sign/mangrove_hanging", + "y": 135 + }, + "rotation=15": { + "model": "sign/mangrove_hanging", + "y": 157.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/mangrove_wall_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/mangrove_wall_hanging_sign.json new file mode 100644 index 00000000..9d1d019a --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/mangrove_wall_hanging_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "sign/mangrove_wall_hanging", + "y": 90 + }, + "facing=south": { + "model": "sign/mangrove_wall_hanging", + "y": 180 + }, + "facing=west": { + "model": "sign/mangrove_wall_hanging", + "y": 270 + }, + "facing=north": { + "model": "sign/mangrove_wall_hanging" + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/oak_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/oak_hanging_sign.json new file mode 100644 index 00000000..01e66da8 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/oak_hanging_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/oak_hanging", + "y": 180 + }, + "rotation=1": { + "model": "sign/oak_hanging", + "y": 202.5 + }, + "rotation=2": { + "model": "sign/oak_hanging", + "y": 225 + }, + "rotation=3": { + "model": "sign/oak_hanging", + "y": 247.5 + }, + "rotation=4": { + "model": "sign/oak_hanging", + "y": 270 + }, + "rotation=5": { + "model": "sign/oak_hanging", + "y": 292.5 + }, + "rotation=6": { + "model": "sign/oak_hanging", + "y": 315 + }, + "rotation=7": { + "model": "sign/oak_hanging", + "y": 337.5 + }, + "rotation=8": { + "model": "sign/oak_hanging" + }, + "rotation=9": { + "model": "sign/oak_hanging", + "y": 22.5 + }, + "rotation=10": { + "model": "sign/oak_hanging", + "y": 45 + }, + "rotation=11": { + "model": "sign/oak_hanging", + "y": 67.5 + }, + "rotation=12": { + "model": "sign/oak_hanging", + "y": 90 + }, + "rotation=13": { + "model": "sign/oak_hanging", + "y": 112.5 + }, + "rotation=14": { + "model": "sign/oak_hanging", + "y": 135 + }, + "rotation=15": { + "model": "sign/oak_hanging", + "y": 157.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/oak_wall_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/oak_wall_hanging_sign.json new file mode 100644 index 00000000..9af80947 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/oak_wall_hanging_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "sign/oak_wall_hanging", + "y": 90 + }, + "facing=south": { + "model": "sign/oak_wall_hanging", + "y": 180 + }, + "facing=west": { + "model": "sign/oak_wall_hanging", + "y": 270 + }, + "facing=north": { + "model": "sign/oak_wall_hanging" + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/spruce_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/spruce_hanging_sign.json new file mode 100644 index 00000000..ee9509f6 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/spruce_hanging_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/spruce_hanging", + "y": 180 + }, + "rotation=1": { + "model": "sign/spruce_hanging", + "y": 202.5 + }, + "rotation=2": { + "model": "sign/spruce_hanging", + "y": 225 + }, + "rotation=3": { + "model": "sign/spruce_hanging", + "y": 247.5 + }, + "rotation=4": { + "model": "sign/spruce_hanging", + "y": 270 + }, + "rotation=5": { + "model": "sign/spruce_hanging", + "y": 292.5 + }, + "rotation=6": { + "model": "sign/spruce_hanging", + "y": 315 + }, + "rotation=7": { + "model": "sign/spruce_hanging", + "y": 337.5 + }, + "rotation=8": { + "model": "sign/spruce_hanging" + }, + "rotation=9": { + "model": "sign/spruce_hanging", + "y": 22.5 + }, + "rotation=10": { + "model": "sign/spruce_hanging", + "y": 45 + }, + "rotation=11": { + "model": "sign/spruce_hanging", + "y": 67.5 + }, + "rotation=12": { + "model": "sign/spruce_hanging", + "y": 90 + }, + "rotation=13": { + "model": "sign/spruce_hanging", + "y": 112.5 + }, + "rotation=14": { + "model": "sign/spruce_hanging", + "y": 135 + }, + "rotation=15": { + "model": "sign/spruce_hanging", + "y": 157.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/spruce_wall_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/spruce_wall_hanging_sign.json new file mode 100644 index 00000000..0b9ec25a --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/spruce_wall_hanging_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "sign/spruce_wall_hanging", + "y": 90 + }, + "facing=south": { + "model": "sign/spruce_wall_hanging", + "y": 180 + }, + "facing=west": { + "model": "sign/spruce_wall_hanging", + "y": 270 + }, + "facing=north": { + "model": "sign/spruce_wall_hanging" + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/warped_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/warped_hanging_sign.json new file mode 100644 index 00000000..93764856 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/warped_hanging_sign.json @@ -0,0 +1,67 @@ +{ + "variants": { + "rotation=0": { + "model": "sign/warped_hanging", + "y": 180 + }, + "rotation=1": { + "model": "sign/warped_hanging", + "y": 202.5 + }, + "rotation=2": { + "model": "sign/warped_hanging", + "y": 225 + }, + "rotation=3": { + "model": "sign/warped_hanging", + "y": 247.5 + }, + "rotation=4": { + "model": "sign/warped_hanging", + "y": 270 + }, + "rotation=5": { + "model": "sign/warped_hanging", + "y": 292.5 + }, + "rotation=6": { + "model": "sign/warped_hanging", + "y": 315 + }, + "rotation=7": { + "model": "sign/warped_hanging", + "y": 337.5 + }, + "rotation=8": { + "model": "sign/warped_hanging" + }, + "rotation=9": { + "model": "sign/warped_hanging", + "y": 22.5 + }, + "rotation=10": { + "model": "sign/warped_hanging", + "y": 45 + }, + "rotation=11": { + "model": "sign/warped_hanging", + "y": 67.5 + }, + "rotation=12": { + "model": "sign/warped_hanging", + "y": 90 + }, + "rotation=13": { + "model": "sign/warped_hanging", + "y": 112.5 + }, + "rotation=14": { + "model": "sign/warped_hanging", + "y": 135 + }, + "rotation=15": { + "model": "sign/warped_hanging", + "y": 157.5 + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/warped_wall_hanging_sign.json b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/warped_wall_hanging_sign.json new file mode 100644 index 00000000..378e80f8 --- /dev/null +++ b/prismarine-viewer/viewer/prepare/data/1.20/blockStates/sign/warped_wall_hanging_sign.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=east": { + "model": "sign/warped_wall_hanging", + "y": 90 + }, + "facing=south": { + "model": "sign/warped_wall_hanging", + "y": 180 + }, + "facing=west": { + "model": "sign/warped_wall_hanging", + "y": 270 + }, + "facing=north": { + "model": "sign/warped_wall_hanging" + } + } +} \ No newline at end of file diff --git a/prismarine-viewer/viewer/prepare/modelsBuilder.ts b/prismarine-viewer/viewer/prepare/modelsBuilder.ts index 2a0cac57..b6e5268f 100644 --- a/prismarine-viewer/viewer/prepare/modelsBuilder.ts +++ b/prismarine-viewer/viewer/prepare/modelsBuilder.ts @@ -161,7 +161,7 @@ function prepareModel (model: BlockModel, texturesJson) { const getFinalTexture = (originalBlockName) => { // texture name e.g. blocks/anvil_base - const cleanBlockName = cleanupBlockName(originalBlockName); + const cleanBlockName = cleanupBlockName(originalBlockName) return { ...texturesJson[cleanBlockName], /* __debugName: cleanBlockName */ } } @@ -187,10 +187,12 @@ function prepareModel (model: BlockModel, texturesJson) { for (const sideName of Object.keys(elem.faces)) { const face = elem.faces[sideName] + const textureRaw = face.texture.charAt(0) === '#' + ? finalTextures![face.texture.slice(1)] + : getFinalTexture(face.texture) + if (!textureRaw) throw new Error(`Texture ${face.texture} in ${JSON.stringify(model.textures)} not found`) const finalTexture = deepCopy( - face.texture.charAt(0) === '#' - ? finalTextures![face.texture.slice(1)] - : getFinalTexture(face.texture) + textureRaw ) const _from = elem.from diff --git a/prismarine-viewer/viewer/prepare/moreGeneratedBlocks.ts b/prismarine-viewer/viewer/prepare/moreGeneratedBlocks.ts index b343e595..e64b7cff 100644 --- a/prismarine-viewer/viewer/prepare/moreGeneratedBlocks.ts +++ b/prismarine-viewer/viewer/prepare/moreGeneratedBlocks.ts @@ -4,9 +4,10 @@ import { McAssets } from './modelsBuilder' import path from 'path' import fs from 'fs' import { fileURLToPath } from 'url' +import { versionToNumber } from './utils' // todo refactor -const twoTileTextures: string[] = [] +const handledBlocks = ['water', 'lava', 'barrier'] const origSizeTextures: string[] = [] let currentImage: Jimp let currentBlockName: string @@ -121,115 +122,6 @@ const handleShulkerBox = async (dataBase: string, match: RegExpExecArray) => { await addSimpleCubeWithSides(shulkerBoxTextures) } -const handleSign = async (dataBase: string, match: RegExpExecArray) => { - const states = getBlockStates(currentBlockName) - if (!states) return - - const [, signMaterial = ''] = match - currentImage = await Jimp.read(`${dataBase}entity/${signMaterial ? `signs/${signMaterial}` : 'sign'}.png`) - // todo cache - const signTextures = { - // todo correct mapping - // todo alg to fit to the side - signboard_side: justCrop(0, 2, 2, 12), - face: justCrop(2, 2, 24, 12), - up: justCrop(2, 0, 24, 2), - support: justCrop(0, 16, 2, 14) - } - const blockTextures = await getBlockTexturesFromJimp(signTextures, true) - - const isWall = currentBlockName.includes('wall_') - const isHanging = currentBlockName.includes('hanging_') - const rotationState = states.find(state => state.name === 'rotation') - const faceTexture = { texture: blockTextures.face.texture, uv: blockTextures.face.uv } - if (isWall || isHanging) { - // todo isHanging - if (!isHanging) { - const facingState = states.find(state => state.name === 'facing')! - const facingMap = { - south: 0, - west: 90, - north: 180, - east: 270 - } - - currentMcAssets.blocksStates[currentBlockName] = { - "variants": Object.fromEntries( - facingState.values!.map((_val, i) => { - const val = _val as string - return [`facing=${val}`, { - "model": currentBlockName, - y: facingMap[val], - }] - }) - ) - } - currentMcAssets.blocksModels[currentBlockName] = { - elements: [ - { - // signboard - "from": [0, 4.5, 0], - "to": [16, 11.5, 1.5], - faces: { - south: faceTexture, - east: blockTextures.signboard_side, - west: blockTextures.signboard_side, - up: blockTextures.up, - down: blockTextures.up, - }, - } - ], - } - } - } else if (rotationState) { - currentMcAssets.blocksStates[currentBlockName] = { - "variants": Object.fromEntries( - Array.from({ length: 16 }).map((_val, i) => { - return [`rotation=${i}`, { - "model": currentBlockName, - y: i * (45 / 2), - }] - }) - ) - } - - const supportTexture = blockTextures.support - // TODO fix models.ts, apply textures for signs correctly! - // const supportTexture = { texture: supportTextureImg, uv: [0, 0, 16, 16] } - currentMcAssets.blocksModels[currentBlockName] = { - elements: [ - { - // support post - "from": [7.5, 0, 7.5], - "to": [8.5, 9, 8.5], - faces: { - // todo 14 - north: supportTexture, - east: supportTexture, - south: supportTexture, - west: supportTexture, - } - }, - { - // signboard - "from": [0, 9, 7.25], - "to": [16, 16, 8.75], - faces: { - north: faceTexture, - south: faceTexture, - east: blockTextures.signboard_side, - west: blockTextures.signboard_side, - up: blockTextures.up, - down: blockTextures.up, - }, - } - ], - } - } - twoTileTextures.push(blockTextures.face.texture) - twoTileTextures.push(blockTextures.up.texture) -} - // TODO! should not be there! move to data with signs! const chestModels = { chest: { @@ -405,10 +297,10 @@ const handleChest = async (dataBase: string, match: RegExpExecArray) => { async function loadBlockModelTextures (dataBase: string, blockModel: any) { for (const key in blockModel.textures) { - const texture: string = blockModel.textures[key] - currentImage = await Jimp.read(dataBase + texture + '.png') + let texture: string = blockModel.textures[key] + const useAssetsPath = !!texture.match(/^[0-9.]+\//) blockModel.textures.particle = texture - generatedImageTextures[texture] = `data:image/png;base64,${fs.readFileSync(path.join(dataBase, texture + '.png'), 'base64')}` + generatedImageTextures[texture] = `data:image/png;base64,${fs.readFileSync(path.join(dataBase, useAssetsPath ? '..' : '', texture + '.png'), 'base64')}` origSizeTextures[texture] = true } } @@ -416,11 +308,6 @@ async function loadBlockModelTextures (dataBase: string, blockModel: any) { const handlers = [ [/(.+)_shulker_box$/, handleShulkerBox], [/^shulker_box$/, handleShulkerBox], - [/^sign$/, handleSign], - [/^standing_sign$/, handleSign], - [/^wall_sign$/, handleSign], - [/(.+)_wall_sign$/, handleSign], - [/(.+)_sign$/, handleSign], [/^(?:(ender|trapped)_)?chest$/, handleChest], // [/(^|(.+)_)bed$/, handleBed], // no-op just suppress warning @@ -439,25 +326,58 @@ export const tryHandleBlockEntity = async (dataBase, blockName) => { } } -const handleExternalData = async (dataBase: string, version: string) => { - const [major, minor] = version.split(".") - const dataVer = `${major}.${minor}` - const baseDir = path.join(__dirname, 'data', dataVer) - if (!fs.existsSync(baseDir)) return +async function readAllBlockStates (blockStatesDir: string) { + const files = fs.readdirSync(blockStatesDir) + for (const file of files) { + if (file.endsWith('.json')) { + const state = JSON.parse(fs.readFileSync(path.join(blockStatesDir, file), 'utf-8')) + const name = file.replace('.json', '') + currentMcAssets.blocksStates[name] = state + handledBlocks.push(name) + } else { + await readAllBlockStates(path.join(blockStatesDir, file)) + } + } +} - const blockModelsDir = path.join(baseDir, 'blockModels') - const allBlockModels = fs.readdirSync(blockModelsDir).map(x => x.replace('.json', '')) - for (const blockModel of allBlockModels) { - const model = JSON.parse(fs.readFileSync(path.join(blockModelsDir, blockModel + '.json'), 'utf-8')) - currentMcAssets.blocksModels[blockModel] = model - await loadBlockModelTextures(dataBase, model) +async function readAllBlockModels (dataBase: string, blockModelsDir: string, completePath: string) { + const actualPath = completePath.length ? completePath + "/" : "" + const files = fs.readdirSync(blockModelsDir) + for (const file of files) { + if (file.endsWith('.json')) { + const model = JSON.parse(fs.readFileSync(path.join(blockModelsDir, file), 'utf-8')) + const name = actualPath + file.replace('.json', '') + currentMcAssets.blocksModels[name] = model + await loadBlockModelTextures(dataBase, model) + } else { + await readAllBlockModels(dataBase, path.join(blockModelsDir, file), actualPath + file) + } + } +} + +const handleExternalData = async (assetsPathRoot: string, version: string) => { + const currentVersionNumber = versionToNumber(version) + const versions = fs.readdirSync(path.join(__dirname, 'data'), { withFileTypes: true }) + .filter(x => x.isDirectory()) + .map(x => x.name) + .sort((a, b) => versionToNumber(b) - versionToNumber(a)) + + const allAssetsVersions = fs.readdirSync(assetsPathRoot, { withFileTypes: true }) + .filter(x => x.isDirectory()) + .map(x => x.name) + .sort((a, b) => versionToNumber(b) - versionToNumber(a)) + + const getAssetsVersion = (version: string) => { + return allAssetsVersions[version] ?? allAssetsVersions.find(x => x.startsWith(version)) } - const blockStatesDir = path.join(baseDir, 'blockStates') - const allBlockStates = fs.readdirSync(blockStatesDir).map(x => x.replace('.json', '')) - for (const blockState of allBlockStates) { - const state = JSON.parse(fs.readFileSync(path.join(blockStatesDir, blockState + '.json'), 'utf-8')) - currentMcAssets.blocksStates[blockState] = state + for (const curVer of versions) { + const baseDir = path.join(__dirname, 'data', curVer) + if (versionToNumber(curVer) > currentVersionNumber) continue + + const assetsVersion = getAssetsVersion(curVer) + await readAllBlockStates(path.join(baseDir, 'blockStates')) + await readAllBlockModels(path.join(assetsPathRoot, assetsVersion), path.join(baseDir, 'blockModels'), "") } } @@ -466,7 +386,6 @@ export const prepareMoreGeneratedBlocks = async (mcAssets: McAssets) => { const allTheBlocks = mcData.blocksArray.map(x => x.name) currentMcAssets = mcAssets - const handledBlocks = ['water', 'lava', 'barrier'] // todo const ignoredBlocks = ['skull', 'structure_void', 'banner', 'bed', 'end_portal'] @@ -481,7 +400,7 @@ export const prepareMoreGeneratedBlocks = async (mcAssets: McAssets) => { } } - await handleExternalData(mcAssets.directory, mcAssets.version) + await handleExternalData(path.join(mcAssets.directory, '..'), mcAssets.version) const warnings: string[] = [] for (const [name, model] of Object.entries(mcAssets.blocksModels)) { @@ -498,5 +417,5 @@ export const prepareMoreGeneratedBlocks = async (mcAssets: McAssets) => { } export const getAdditionalTextures = () => { - return { generated: generatedImageTextures, twoTileTextures, origSizeTextures } + return { generated: generatedImageTextures, origSizeTextures } } From 2d4b89651cdd8ff4ad9268d51aeb1c90f01b8968 Mon Sep 17 00:00:00 2001 From: Vitaly Turovsky Date: Tue, 11 Jun 2024 21:17:07 +0300 Subject: [PATCH 05/18] format, remove useless comment --- .../viewer/lib/worldrendererThree.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/prismarine-viewer/viewer/lib/worldrendererThree.ts b/prismarine-viewer/viewer/lib/worldrendererThree.ts index 095e5a94..9a76474b 100644 --- a/prismarine-viewer/viewer/lib/worldrendererThree.ts +++ b/prismarine-viewer/viewer/lib/worldrendererThree.ts @@ -22,7 +22,7 @@ export class WorldRendererThree extends WorldRendererCommon { return Object.values(this.sectionObjects).reduce((acc, obj) => acc + (obj as any).tilesCount, 0) } - constructor(public scene: THREE.Scene, public renderer: THREE.WebGLRenderer, public config: WorldRendererConfig) { + constructor (public scene: THREE.Scene, public renderer: THREE.WebGLRenderer, public config: WorldRendererConfig) { super(config) this.starField = new StarField(scene) } @@ -181,13 +181,12 @@ export class WorldRendererThree extends WorldRendererCommon { const mesh = new THREE.Mesh(new THREE.PlaneGeometry(1, 1), new THREE.MeshBasicMaterial({ map: tex, transparent: true, })) mesh.renderOrder = 999 - // todo @sa2urami shouldnt all this be done in worker? - const lineHeight = 7 / 16; + const lineHeight = 7 / 16 const scaleFactor = isHanging ? 1.3 : 1 mesh.scale.set(1 * scaleFactor, lineHeight * scaleFactor, 1 * scaleFactor) const thickness = (isHanging ? 2 : 1.5) / 16 - const wallSpacing = 0.25 / 16; + const wallSpacing = 0.25 / 16 if (isWall && !isHanging) { mesh.position.set(0, 0, -0.5 + thickness + wallSpacing + 0.0001) } else { @@ -199,9 +198,9 @@ export class WorldRendererThree extends WorldRendererCommon { rotation * (isWall ? 90 : 45 / 2) ), 0) group.add(mesh) - const height = (isHanging ? 10 : 8)/16 + const height = (isHanging ? 10 : 8) / 16 const heightOffset = (isHanging ? 0 : isWall ? 4.333 : 9.333) / 16 - const textPosition = height/2 + heightOffset + const textPosition = height / 2 + heightOffset group.position.set(position.x + 0.5, position.y + textPosition, position.z + 0.5) return group } @@ -322,7 +321,7 @@ class StarField { } } - constructor(private scene: THREE.Scene) { + constructor (private scene: THREE.Scene) { } addToScene () { @@ -386,7 +385,7 @@ class StarField { const version = parseInt(THREE.REVISION.replace(/\D+/g, '')) class StarfieldMaterial extends THREE.ShaderMaterial { - constructor() { + constructor () { super({ uniforms: { time: { value: 0.0 }, fade: { value: 1.0 } }, vertexShader: /* glsl */ ` From 4f20e2481947d813317b3888e75e77b0b85f39dc Mon Sep 17 00:00:00 2001 From: Vitaly Turovsky Date: Wed, 12 Jun 2024 21:14:48 +0300 Subject: [PATCH 06/18] up flying squid --- package.json | 2 +- pnpm-lock.yaml | 79 ++++++++++++++++++++++++-------------------------- 2 files changed, 39 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index 7bbde636..f5f55c7f 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "esbuild-plugin-polyfill-node": "^0.3.0", "express": "^4.18.2", "filesize": "^10.0.12", - "flying-squid": "npm:@zardoy/flying-squid@^0.0.24", + "flying-squid": "npm:@zardoy/flying-squid@^0.0.26", "fs-extra": "^11.1.1", "google-drive-browserfs": "github:zardoy/browserfs#google-drive", "iconify-icon": "^1.0.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 38a9ebb6..3cbab433 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -104,8 +104,8 @@ importers: specifier: ^10.0.12 version: 10.0.12 flying-squid: - specifier: npm:@zardoy/flying-squid@^0.0.24 - version: '@zardoy/flying-squid@0.0.24(encoding@0.1.13)' + specifier: npm:@zardoy/flying-squid@^0.0.26 + version: '@zardoy/flying-squid@0.0.26(encoding@0.1.13)' fs-extra: specifier: ^11.1.1 version: 11.1.1 @@ -386,7 +386,7 @@ importers: version: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0 prismarine-chunk: specifier: github:zardoy/prismarine-chunk - version: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/f32234a724a5c2482ffbaf85edc5e91c7ab9b38f(minecraft-data@3.65.0) + version: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0) prismarine-schematic: specifier: ^1.2.0 version: 1.2.3 @@ -3054,8 +3054,8 @@ packages: resolution: {integrity: sha512-6xm38yGVIa6mKm/DUCF2zFFJhERh/QWp1ufm4cNUvxsONBmfPg8uZ9pZBdOmF6qFGr/HlT6ABBkCSx/dlEtvWg==} engines: {node: '>=12 <14 || 14.2 - 14.9 || >14.10.0'} - '@zardoy/flying-squid@0.0.24': - resolution: {integrity: sha512-C+VNHyh9yYB7aG9OL6r9NR5bF73fyRQ0rHhkvvz901hLBZI3+5nOPdcA6XwJm9XX9BYStXbLTHp6shmo20JRHQ==} + '@zardoy/flying-squid@0.0.26': + resolution: {integrity: sha512-JUGrr+9I4vgXrgjop5iRpulRhWUgRbPC1j+xPapgICtJPEGuekpXIOOBjAL+X7yu7I5IcrmtG4XCjvTKcC0lIQ==} engines: {node: '>=8'} hasBin: true @@ -6718,13 +6718,8 @@ packages: prismarine-chat@1.9.1: resolution: {integrity: sha512-x7WWa5MNhiLZSO6tw+YyKpzquFZ+DNISVgiV6K3SU0GsishMXe+nto02WhF/4AuFerKdugm9u1d/r4C4zSkJOg==} - prismarine-chunk@https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/eb39a905761a36f733a456110e6b49d655bf5c16: - resolution: {tarball: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/eb39a905761a36f733a456110e6b49d655bf5c16} - version: 1.35.0 - engines: {node: '>=14'} - - prismarine-chunk@https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/f32234a724a5c2482ffbaf85edc5e91c7ab9b38f: - resolution: {tarball: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/f32234a724a5c2482ffbaf85edc5e91c7ab9b38f} + prismarine-chunk@https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a: + resolution: {tarball: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a} version: 1.35.0 engines: {node: '>=14'} @@ -6747,6 +6742,10 @@ packages: resolution: {tarball: https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/02d81b0eba6ab1c362862970954f9a3c150c9a29} version: 2.7.0 + prismarine-provider-anvil@https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/422aed5db94f341c3807f1a918c7b83c9ebcfe20: + resolution: {tarball: https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/422aed5db94f341c3807f1a918c7b83c9ebcfe20} + version: 2.8.0 + prismarine-realms@1.3.2: resolution: {integrity: sha512-5apl9Ru8veTj5q2OozRc4GZOuSIcs3yY4UEtALiLKHstBe8bRw8vNlaz4Zla3jsQ8yP/ul1b1IJINTRbocuA6g==} @@ -6764,9 +6763,9 @@ packages: prismarine-windows@2.9.0: resolution: {integrity: sha512-fm4kOLjGFPov7TEJRmXHoiPabxIQrG36r2mDjlNxfkcLfMHFb3/1ML6mp4iRQa7wL0GK4DIAyiBqCWoeWDxARg==} - prismarine-world@https://codeload.github.com/zardoy/prismarine-world/tar.gz/6ae6f009d38460de284f8c226c665f04cbad9465: - resolution: {tarball: https://codeload.github.com/zardoy/prismarine-world/tar.gz/6ae6f009d38460de284f8c226c665f04cbad9465} - version: 3.6.2 + prismarine-world@https://codeload.github.com/zardoy/prismarine-world/tar.gz/187a87f6d71cba12881a7bbaa510ed9085bf6da7: + resolution: {tarball: https://codeload.github.com/zardoy/prismarine-world/tar.gz/187a87f6d71cba12881a7bbaa510ed9085bf6da7} + version: 3.6.3 engines: {node: '>=8.0.0'} process-nextick-args@2.0.1: @@ -11931,7 +11930,7 @@ snapshots: '@types/emscripten': 1.39.8 tslib: 1.14.1 - '@zardoy/flying-squid@0.0.24(encoding@0.1.13)': + '@zardoy/flying-squid@0.0.26(encoding@0.1.13)': dependencies: '@tootallnate/once': 2.0.0 change-case: 4.1.2 @@ -11946,13 +11945,13 @@ snapshots: mkdirp: 2.1.6 node-gzip: 1.1.2 node-rsa: 1.1.1 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/eb39a905761a36f733a456110e6b49d655bf5c16(minecraft-data@3.65.0) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0) prismarine-entity: 2.3.1 prismarine-item: 1.14.0 prismarine-nbt: 2.5.0 - prismarine-provider-anvil: https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/02d81b0eba6ab1c362862970954f9a3c150c9a29(minecraft-data@3.65.0) + prismarine-provider-anvil: https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/422aed5db94f341c3807f1a918c7b83c9ebcfe20(minecraft-data@3.65.0) prismarine-windows: 2.9.0 - prismarine-world: https://codeload.github.com/zardoy/prismarine-world/tar.gz/6ae6f009d38460de284f8c226c665f04cbad9465 + prismarine-world: https://codeload.github.com/zardoy/prismarine-world/tar.gz/187a87f6d71cba12881a7bbaa510ed9085bf6da7 rambda: 9.2.0 random-seed: 0.3.0 range: 0.0.3 @@ -13212,7 +13211,7 @@ snapshots: diamond-square@https://codeload.github.com/zardoy/diamond-square/tar.gz/915fce8e27fe8eb45464d89b9563956afa4f7687: dependencies: minecraft-data: 3.65.0 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/eb39a905761a36f733a456110e6b49d655bf5c16(minecraft-data@3.65.0) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0) random-seed: 0.3.0 vec3: 0.1.8 @@ -15779,7 +15778,7 @@ snapshots: prismarine-biome: 1.3.0(minecraft-data@3.65.0)(prismarine-registry@1.7.0) prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0 prismarine-chat: 1.10.1 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/eb39a905761a36f733a456110e6b49d655bf5c16(minecraft-data@3.65.0) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0) prismarine-entity: 2.3.1 prismarine-item: 1.14.0 prismarine-nbt: 2.5.0 @@ -15787,7 +15786,7 @@ snapshots: prismarine-recipe: 1.3.1(prismarine-registry@1.7.0) prismarine-registry: 1.7.0 prismarine-windows: 2.9.0 - prismarine-world: https://codeload.github.com/zardoy/prismarine-world/tar.gz/6ae6f009d38460de284f8c226c665f04cbad9465 + prismarine-world: https://codeload.github.com/zardoy/prismarine-world/tar.gz/187a87f6d71cba12881a7bbaa510ed9085bf6da7 protodef: 1.15.0 typed-emitter: 1.4.0 vec3: 0.1.8 @@ -15802,7 +15801,7 @@ snapshots: prismarine-biome: 1.3.0(minecraft-data@3.65.0)(prismarine-registry@1.7.0) prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0 prismarine-chat: 1.10.1 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/eb39a905761a36f733a456110e6b49d655bf5c16(minecraft-data@3.65.0) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0) prismarine-entity: 2.3.1 prismarine-item: 1.14.0 prismarine-nbt: 2.5.0 @@ -15810,7 +15809,7 @@ snapshots: prismarine-recipe: 1.3.1(prismarine-registry@1.7.0) prismarine-registry: 1.7.0 prismarine-windows: 2.9.0 - prismarine-world: https://codeload.github.com/zardoy/prismarine-world/tar.gz/6ae6f009d38460de284f8c226c665f04cbad9465 + prismarine-world: https://codeload.github.com/zardoy/prismarine-world/tar.gz/187a87f6d71cba12881a7bbaa510ed9085bf6da7 protodef: 1.15.0 typed-emitter: 1.4.0 vec3: 0.1.8 @@ -16526,20 +16525,7 @@ snapshots: prismarine-nbt: 2.5.0 prismarine-registry: 1.7.0 - prismarine-chunk@https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/eb39a905761a36f733a456110e6b49d655bf5c16(minecraft-data@3.65.0): - dependencies: - prismarine-biome: 1.3.0(minecraft-data@3.65.0)(prismarine-registry@1.7.0) - prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0 - prismarine-nbt: 2.5.0 - prismarine-registry: 1.7.0 - smart-buffer: 4.2.0 - uint4: 0.1.2 - vec3: 0.1.8 - xxhash-wasm: 0.4.2 - transitivePeerDependencies: - - minecraft-data - - prismarine-chunk@https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/f32234a724a5c2482ffbaf85edc5e91c7ab9b38f(minecraft-data@3.65.0): + prismarine-chunk@https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0): dependencies: prismarine-biome: 1.3.0(minecraft-data@3.65.0)(prismarine-registry@1.7.0) prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0 @@ -16580,13 +16566,24 @@ snapshots: prismarine-provider-anvil@https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/02d81b0eba6ab1c362862970954f9a3c150c9a29(minecraft-data@3.65.0): dependencies: - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/f32234a724a5c2482ffbaf85edc5e91c7ab9b38f(minecraft-data@3.65.0) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0) prismarine-nbt: 2.5.0 uint4: 0.1.2 vec3: 0.1.8 transitivePeerDependencies: - minecraft-data + prismarine-provider-anvil@https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/422aed5db94f341c3807f1a918c7b83c9ebcfe20(minecraft-data@3.65.0): + dependencies: + prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0 + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0) + prismarine-nbt: 2.5.0 + prismarine-world: https://codeload.github.com/zardoy/prismarine-world/tar.gz/187a87f6d71cba12881a7bbaa510ed9085bf6da7 + uint4: 0.1.2 + vec3: 0.1.8 + transitivePeerDependencies: + - minecraft-data + prismarine-realms@1.3.2(encoding@0.1.13): dependencies: debug: 4.3.4(supports-color@8.1.1) @@ -16609,7 +16606,7 @@ snapshots: minecraft-data: 3.65.0 prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0 prismarine-nbt: 2.2.1 - prismarine-world: https://codeload.github.com/zardoy/prismarine-world/tar.gz/6ae6f009d38460de284f8c226c665f04cbad9465 + prismarine-world: https://codeload.github.com/zardoy/prismarine-world/tar.gz/187a87f6d71cba12881a7bbaa510ed9085bf6da7 vec3: 0.1.8 prismarine-windows@2.9.0: @@ -16618,7 +16615,7 @@ snapshots: prismarine-registry: 1.7.0 typed-emitter: 2.1.0 - prismarine-world@https://codeload.github.com/zardoy/prismarine-world/tar.gz/6ae6f009d38460de284f8c226c665f04cbad9465: + prismarine-world@https://codeload.github.com/zardoy/prismarine-world/tar.gz/187a87f6d71cba12881a7bbaa510ed9085bf6da7: dependencies: vec3: 0.1.8 From 5be093a25f88dae99d216416b6f4cd64bc06ecd2 Mon Sep 17 00:00:00 2001 From: Vitaly Turovsky Date: Thu, 13 Jun 2024 03:46:59 +0300 Subject: [PATCH 07/18] feat: support world saves for all versions of Minecraft Java! --- package.json | 2 +- pnpm-lock.yaml | 100 +++++++----------- .../viewer/lib/worldDataEmitter.ts | 2 +- src/createLocalServer.ts | 2 +- src/getCollisionShapes.ts | 6 +- src/globals.d.ts | 4 +- src/loadSave.ts | 10 +- src/react/MainMenu.tsx | 2 +- src/soundSystem.ts | 10 +- src/water.ts | 2 +- 10 files changed, 61 insertions(+), 79 deletions(-) diff --git a/package.json b/package.json index f5f55c7f..37e24dbb 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "esbuild-plugin-polyfill-node": "^0.3.0", "express": "^4.18.2", "filesize": "^10.0.12", - "flying-squid": "npm:@zardoy/flying-squid@^0.0.26", + "flying-squid": "npm:@zardoy/flying-squid@^0.0.27", "fs-extra": "^11.1.1", "google-drive-browserfs": "github:zardoy/browserfs#google-drive", "iconify-icon": "^1.0.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3cbab433..052069c8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -104,8 +104,8 @@ importers: specifier: ^10.0.12 version: 10.0.12 flying-squid: - specifier: npm:@zardoy/flying-squid@^0.0.26 - version: '@zardoy/flying-squid@0.0.26(encoding@0.1.13)' + specifier: npm:@zardoy/flying-squid@^0.0.27 + version: '@zardoy/flying-squid@0.0.27(encoding@0.1.13)' fs-extra: specifier: ^11.1.1 version: 11.1.1 @@ -150,7 +150,7 @@ importers: version: 6.1.1 prismarine-provider-anvil: specifier: github:zardoy/prismarine-provider-anvil#everything - version: https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/02d81b0eba6ab1c362862970954f9a3c150c9a29(minecraft-data@3.65.0) + version: https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/2663cad29c8f231c299f63e31c5040b6c1872bcc(minecraft-data@3.65.0) prosemirror-example-setup: specifier: ^1.2.2 version: 1.2.2 @@ -302,7 +302,7 @@ importers: version: https://codeload.github.com/zardoy/minecraft-inventory-gui/tar.gz/200902aca941475e7feb610070e662b172a000b5(@types/react@18.2.20)(react@18.2.0) mineflayer: specifier: github:zardoy/mineflayer - version: https://codeload.github.com/zardoy/mineflayer/tar.gz/06061e07fe6b9716cb1801d4c1bf232581977192(encoding@0.1.13) + version: https://codeload.github.com/zardoy/mineflayer/tar.gz/f80ba0f8ebbcc15d6c44ade84007f8b4a0ee08ec(encoding@0.1.13) mineflayer-pathfinder: specifier: ^2.4.4 version: 2.4.4 @@ -383,10 +383,10 @@ importers: version: 1.3.6 prismarine-block: specifier: github:zardoy/prismarine-block#next-era - version: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0 + version: https://codeload.github.com/zardoy/prismarine-block/tar.gz/dd4954fff3b334f8ce063d18e39b2e9414ece5b8 prismarine-chunk: specifier: github:zardoy/prismarine-chunk - version: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0) + version: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/9662306deea57d8d0ba0a2a3f3f7adb95f0131e3(minecraft-data@3.65.0) prismarine-schematic: specifier: ^1.2.0 version: 1.2.3 @@ -3054,8 +3054,8 @@ packages: resolution: {integrity: sha512-6xm38yGVIa6mKm/DUCF2zFFJhERh/QWp1ufm4cNUvxsONBmfPg8uZ9pZBdOmF6qFGr/HlT6ABBkCSx/dlEtvWg==} engines: {node: '>=12 <14 || 14.2 - 14.9 || >14.10.0'} - '@zardoy/flying-squid@0.0.26': - resolution: {integrity: sha512-JUGrr+9I4vgXrgjop5iRpulRhWUgRbPC1j+xPapgICtJPEGuekpXIOOBjAL+X7yu7I5IcrmtG4XCjvTKcC0lIQ==} + '@zardoy/flying-squid@0.0.27': + resolution: {integrity: sha512-8QlPCyLqNQYxsGBMBNNGbfc1HdRPO/t3nBr5NzINEridj772DEbgGHxl252rjZWWELt/3t/k3m6e4k9qS7/ZdA==} engines: {node: '>=8'} hasBin: true @@ -4097,8 +4097,8 @@ packages: devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} - diamond-square@https://codeload.github.com/zardoy/diamond-square/tar.gz/915fce8e27fe8eb45464d89b9563956afa4f7687: - resolution: {tarball: https://codeload.github.com/zardoy/diamond-square/tar.gz/915fce8e27fe8eb45464d89b9563956afa4f7687} + diamond-square@https://codeload.github.com/zardoy/diamond-square/tar.gz/4bbe28dcad35403abaa925055e91f601a61b9015: + resolution: {tarball: https://codeload.github.com/zardoy/diamond-square/tar.gz/4bbe28dcad35403abaa925055e91f601a61b9015} version: 1.3.0 diff-sequences@29.6.3: @@ -6067,8 +6067,8 @@ packages: resolution: {integrity: sha512-QMMNPx4IyZE7ydAzjvGLQLCnQNUOfkk1qVZKxTTS9q3qPTAewz4GhsVUBtbQ8LSbHthe5RcQ1Sgxs4wlIma/Qw==} engines: {node: '>=18'} - mineflayer@https://codeload.github.com/zardoy/mineflayer/tar.gz/06061e07fe6b9716cb1801d4c1bf232581977192: - resolution: {tarball: https://codeload.github.com/zardoy/mineflayer/tar.gz/06061e07fe6b9716cb1801d4c1bf232581977192} + mineflayer@https://codeload.github.com/zardoy/mineflayer/tar.gz/f80ba0f8ebbcc15d6c44ade84007f8b4a0ee08ec: + resolution: {tarball: https://codeload.github.com/zardoy/mineflayer/tar.gz/f80ba0f8ebbcc15d6c44ade84007f8b4a0ee08ec} version: 4.20.1 engines: {node: '>=18'} @@ -6708,18 +6708,15 @@ packages: minecraft-data: 3.65.0 prismarine-registry: ^1.1.0 - prismarine-block@https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0: - resolution: {tarball: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0} + prismarine-block@https://codeload.github.com/zardoy/prismarine-block/tar.gz/dd4954fff3b334f8ce063d18e39b2e9414ece5b8: + resolution: {tarball: https://codeload.github.com/zardoy/prismarine-block/tar.gz/dd4954fff3b334f8ce063d18e39b2e9414ece5b8} version: 1.17.1 prismarine-chat@1.10.1: resolution: {integrity: sha512-XukYcuueuhDxzEXG7r8BZyt6jOObrPPB4JESCgb+/XenB9nExoSHF8eTQWWj8faKPLqm1dRQaYwFJlNBlJZJUw==} - prismarine-chat@1.9.1: - resolution: {integrity: sha512-x7WWa5MNhiLZSO6tw+YyKpzquFZ+DNISVgiV6K3SU0GsishMXe+nto02WhF/4AuFerKdugm9u1d/r4C4zSkJOg==} - - prismarine-chunk@https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a: - resolution: {tarball: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a} + prismarine-chunk@https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/9662306deea57d8d0ba0a2a3f3f7adb95f0131e3: + resolution: {tarball: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/9662306deea57d8d0ba0a2a3f3f7adb95f0131e3} version: 1.35.0 engines: {node: '>=14'} @@ -6738,12 +6735,8 @@ packages: prismarine-physics@1.8.0: resolution: {integrity: sha512-gbM+S+bmVtOKVv+Z0WGaHMeEeBHISIDsRDRlv8sr0dex3ZJRhuq8djA02CBreguXtI18ZKh6q3TSj2qDr45NHA==} - prismarine-provider-anvil@https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/02d81b0eba6ab1c362862970954f9a3c150c9a29: - resolution: {tarball: https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/02d81b0eba6ab1c362862970954f9a3c150c9a29} - version: 2.7.0 - - prismarine-provider-anvil@https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/422aed5db94f341c3807f1a918c7b83c9ebcfe20: - resolution: {tarball: https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/422aed5db94f341c3807f1a918c7b83c9ebcfe20} + prismarine-provider-anvil@https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/2663cad29c8f231c299f63e31c5040b6c1872bcc: + resolution: {tarball: https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/2663cad29c8f231c299f63e31c5040b6c1872bcc} version: 2.8.0 prismarine-realms@1.3.2: @@ -11930,12 +11923,12 @@ snapshots: '@types/emscripten': 1.39.8 tslib: 1.14.1 - '@zardoy/flying-squid@0.0.26(encoding@0.1.13)': + '@zardoy/flying-squid@0.0.27(encoding@0.1.13)': dependencies: '@tootallnate/once': 2.0.0 change-case: 4.1.2 colors: 1.4.0 - diamond-square: https://codeload.github.com/zardoy/diamond-square/tar.gz/915fce8e27fe8eb45464d89b9563956afa4f7687 + diamond-square: https://codeload.github.com/zardoy/diamond-square/tar.gz/4bbe28dcad35403abaa925055e91f601a61b9015 emit-then: 2.0.0 exit-hook: 2.2.1 flatmap: 0.0.3 @@ -11945,11 +11938,11 @@ snapshots: mkdirp: 2.1.6 node-gzip: 1.1.2 node-rsa: 1.1.1 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/9662306deea57d8d0ba0a2a3f3f7adb95f0131e3(minecraft-data@3.65.0) prismarine-entity: 2.3.1 prismarine-item: 1.14.0 prismarine-nbt: 2.5.0 - prismarine-provider-anvil: https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/422aed5db94f341c3807f1a918c7b83c9ebcfe20(minecraft-data@3.65.0) + prismarine-provider-anvil: https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/2663cad29c8f231c299f63e31c5040b6c1872bcc(minecraft-data@3.65.0) prismarine-windows: 2.9.0 prismarine-world: https://codeload.github.com/zardoy/prismarine-world/tar.gz/187a87f6d71cba12881a7bbaa510ed9085bf6da7 rambda: 9.2.0 @@ -13208,10 +13201,11 @@ snapshots: dependencies: dequal: 2.0.3 - diamond-square@https://codeload.github.com/zardoy/diamond-square/tar.gz/915fce8e27fe8eb45464d89b9563956afa4f7687: + diamond-square@https://codeload.github.com/zardoy/diamond-square/tar.gz/4bbe28dcad35403abaa925055e91f601a61b9015: dependencies: minecraft-data: 3.65.0 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/9662306deea57d8d0ba0a2a3f3f7adb95f0131e3(minecraft-data@3.65.0) + prismarine-registry: 1.7.0 random-seed: 0.3.0 vec3: 0.1.8 @@ -15764,7 +15758,7 @@ snapshots: mineflayer-pathfinder@2.4.4: dependencies: minecraft-data: 3.65.0 - prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0 + prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/dd4954fff3b334f8ce063d18e39b2e9414ece5b8 prismarine-entity: 2.3.1 prismarine-item: 1.14.0 prismarine-nbt: 2.2.1 @@ -15776,9 +15770,9 @@ snapshots: minecraft-data: 3.65.0 minecraft-protocol: https://codeload.github.com/PrismarineJS/node-minecraft-protocol/tar.gz/495eed56ab230b2615596590064671356d86a2dc(patch_hash=2uxevyasyasdavsxuehfavgkjq)(encoding@0.1.13) prismarine-biome: 1.3.0(minecraft-data@3.65.0)(prismarine-registry@1.7.0) - prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0 + prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/dd4954fff3b334f8ce063d18e39b2e9414ece5b8 prismarine-chat: 1.10.1 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/9662306deea57d8d0ba0a2a3f3f7adb95f0131e3(minecraft-data@3.65.0) prismarine-entity: 2.3.1 prismarine-item: 1.14.0 prismarine-nbt: 2.5.0 @@ -15794,14 +15788,14 @@ snapshots: - encoding - supports-color - mineflayer@https://codeload.github.com/zardoy/mineflayer/tar.gz/06061e07fe6b9716cb1801d4c1bf232581977192(encoding@0.1.13): + mineflayer@https://codeload.github.com/zardoy/mineflayer/tar.gz/f80ba0f8ebbcc15d6c44ade84007f8b4a0ee08ec(encoding@0.1.13): dependencies: minecraft-data: 3.65.0 minecraft-protocol: https://codeload.github.com/PrismarineJS/node-minecraft-protocol/tar.gz/495eed56ab230b2615596590064671356d86a2dc(patch_hash=2uxevyasyasdavsxuehfavgkjq)(encoding@0.1.13) prismarine-biome: 1.3.0(minecraft-data@3.65.0)(prismarine-registry@1.7.0) - prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0 + prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/dd4954fff3b334f8ce063d18e39b2e9414ece5b8 prismarine-chat: 1.10.1 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0) + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/9662306deea57d8d0ba0a2a3f3f7adb95f0131e3(minecraft-data@3.65.0) prismarine-entity: 2.3.1 prismarine-item: 1.14.0 prismarine-nbt: 2.5.0 @@ -16503,11 +16497,11 @@ snapshots: minecraft-data: 3.65.0 prismarine-registry: 1.7.0 - prismarine-block@https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0: + prismarine-block@https://codeload.github.com/zardoy/prismarine-block/tar.gz/dd4954fff3b334f8ce063d18e39b2e9414ece5b8: dependencies: minecraft-data: 3.65.0 prismarine-biome: 1.3.0(minecraft-data@3.65.0)(prismarine-registry@1.7.0) - prismarine-chat: 1.9.1 + prismarine-chat: 1.10.1 prismarine-item: 1.14.0 prismarine-nbt: 2.5.0 prismarine-registry: 1.7.0 @@ -16518,17 +16512,10 @@ snapshots: prismarine-nbt: 2.5.0 prismarine-registry: 1.7.0 - prismarine-chat@1.9.1: - dependencies: - mojangson: 2.0.4 - prismarine-item: 1.14.0 - prismarine-nbt: 2.5.0 - prismarine-registry: 1.7.0 - - prismarine-chunk@https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0): + prismarine-chunk@https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/9662306deea57d8d0ba0a2a3f3f7adb95f0131e3(minecraft-data@3.65.0): dependencies: prismarine-biome: 1.3.0(minecraft-data@3.65.0)(prismarine-registry@1.7.0) - prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0 + prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/dd4954fff3b334f8ce063d18e39b2e9414ece5b8 prismarine-nbt: 2.5.0 prismarine-registry: 1.7.0 smart-buffer: 4.2.0 @@ -16564,19 +16551,10 @@ snapshots: prismarine-nbt: 2.5.0 vec3: 0.1.8 - prismarine-provider-anvil@https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/02d81b0eba6ab1c362862970954f9a3c150c9a29(minecraft-data@3.65.0): + prismarine-provider-anvil@https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/2663cad29c8f231c299f63e31c5040b6c1872bcc(minecraft-data@3.65.0): dependencies: - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0) - prismarine-nbt: 2.5.0 - uint4: 0.1.2 - vec3: 0.1.8 - transitivePeerDependencies: - - minecraft-data - - prismarine-provider-anvil@https://codeload.github.com/zardoy/prismarine-provider-anvil/tar.gz/422aed5db94f341c3807f1a918c7b83c9ebcfe20(minecraft-data@3.65.0): - dependencies: - prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0 - prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/45f0da31a6ab7107204f2b0a5d56dccb6059025a(minecraft-data@3.65.0) + prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/dd4954fff3b334f8ce063d18e39b2e9414ece5b8 + prismarine-chunk: https://codeload.github.com/zardoy/prismarine-chunk/tar.gz/9662306deea57d8d0ba0a2a3f3f7adb95f0131e3(minecraft-data@3.65.0) prismarine-nbt: 2.5.0 prismarine-world: https://codeload.github.com/zardoy/prismarine-world/tar.gz/187a87f6d71cba12881a7bbaa510ed9085bf6da7 uint4: 0.1.2 @@ -16604,7 +16582,7 @@ snapshots: prismarine-schematic@1.2.3: dependencies: minecraft-data: 3.65.0 - prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/ada4ec3fdfbbc1cc20ab01d0e23f0718a77cc1a0 + prismarine-block: https://codeload.github.com/zardoy/prismarine-block/tar.gz/dd4954fff3b334f8ce063d18e39b2e9414ece5b8 prismarine-nbt: 2.2.1 prismarine-world: https://codeload.github.com/zardoy/prismarine-world/tar.gz/187a87f6d71cba12881a7bbaa510ed9085bf6da7 vec3: 0.1.8 diff --git a/prismarine-viewer/viewer/lib/worldDataEmitter.ts b/prismarine-viewer/viewer/lib/worldDataEmitter.ts index 3a8fbd40..ed578040 100644 --- a/prismarine-viewer/viewer/lib/worldDataEmitter.ts +++ b/prismarine-viewer/viewer/lib/worldDataEmitter.ts @@ -83,7 +83,7 @@ export class WorldDataEmitter extends EventEmitter { get (_target, posKey, receiver) { if (typeof posKey !== 'string') return const [x, y, z] = posKey.split(',').map(Number) - return bot.world.getBlock(new Vec3(x, y, z)).entity + return bot.world.getBlock(new Vec3(x, y, z))?.entity }, })) this.emitter.emit('renderDistance', this.viewDistance) diff --git a/src/createLocalServer.ts b/src/createLocalServer.ts index 44bc2187..d0beac9a 100644 --- a/src/createLocalServer.ts +++ b/src/createLocalServer.ts @@ -14,4 +14,4 @@ export const startLocalServer = (serverOptions) => { // features that flying-squid doesn't support at all // todo move & generate in flying-squid -export const unsupportedLocalServerFeatures = ['transactionPacketExists', 'teleportUsesOwnPacket', 'dimensionDataIsAvailable'] +export const unsupportedLocalServerFeatures = ['transactionPacketExists', 'teleportUsesOwnPacket'] diff --git a/src/getCollisionShapes.ts b/src/getCollisionShapes.ts index 0faf5b6a..4ee0e802 100644 --- a/src/getCollisionShapes.ts +++ b/src/getCollisionShapes.ts @@ -1,4 +1,4 @@ -import { adoptBlockOrItemNamesFromLatest } from 'flying-squid/dist/blockRenames' +import { getRenamedData } from 'flying-squid/dist/blockRenames' import collisionShapesInit from '../generated/latestBlockCollisionsShapes.json' import outputInteractionShapesJson from './interactionShapesGenerated.json' @@ -6,7 +6,7 @@ import outputInteractionShapesJson from './interactionShapesGenerated.json' window.globalGetCollisionShapes = (version) => { // todo use the same in resourcepack const versionFrom = collisionShapesInit.version - const renamedBlocks = adoptBlockOrItemNamesFromLatest('blocks', Object.keys(collisionShapesInit.blocks), versionFrom, version) + const renamedBlocks = getRenamedData('blocks', Object.keys(collisionShapesInit.blocks), versionFrom, version) const collisionShapes = { ...collisionShapesInit, blocks: Object.fromEntries(Object.entries(collisionShapesInit.blocks).map(([, shape], i) => [renamedBlocks[i], shape])) @@ -17,7 +17,7 @@ window.globalGetCollisionShapes = (version) => { export default () => { customEvents.on('gameLoaded', () => { // todo also remap block states (e.g. redstone)! - const renamedBlocksInteraction = adoptBlockOrItemNamesFromLatest('blocks', Object.keys(outputInteractionShapesJson), '1.20.2', bot.version) + const renamedBlocksInteraction = getRenamedData('blocks', Object.keys(outputInteractionShapesJson), '1.20.2', bot.version) const interactionShapes = { ...outputInteractionShapesJson, ...Object.fromEntries(Object.entries(outputInteractionShapesJson).map(([block, shape], i) => [renamedBlocksInteraction[i], shape])) diff --git a/src/globals.d.ts b/src/globals.d.ts index 6a38a21d..05b29a14 100644 --- a/src/globals.d.ts +++ b/src/globals.d.ts @@ -3,7 +3,9 @@ declare const THREE: typeof import('three') // todo make optional declare const bot: Omit & { - world: import('prismarine-world').world.WorldSync + world: Omit & { + getBlock: (pos: import('vec3').Vec3) => import('prismarine-block').Block | null + } _client: Omit & { write: typeof import('./generatedClientPackets').clientWrite on: typeof import('./generatedServerPackets').clientOn diff --git a/src/loadSave.ts b/src/loadSave.ts index af9d078c..7ca454ff 100644 --- a/src/loadSave.ts +++ b/src/loadSave.ts @@ -1,15 +1,16 @@ import fs from 'fs' import path from 'path' -import { supportedVersions } from 'flying-squid/dist/lib/version' import * as nbt from 'prismarine-nbt' import { proxy } from 'valtio' import { gzip } from 'node-gzip' +import { versionToNumber } from 'prismarine-viewer/viewer/prepare/utils' import { options } from './optionsStorage' import { nameToMcOfflineUUID, disconnect } from './flyingSquidUtils' import { existsViaStats, forceCachedDataPaths, forceRedirectPaths, mkdirRecursive } from './browserfs' import { isMajorVersionGreater } from './utils' import { activeModalStacks, insertActiveModalStack, miscUiState } from './globalState' +import supportedVersions from './supportedVersions.mjs' // todo include name of opened handle (zip)! // additional fs metadata @@ -91,13 +92,12 @@ export const loadSave = async (root = '/world') => { const newVersion = '1.8.8' version = newVersion } - // const lastSupportedVersion = supportedVersions.at(-1)! - const lastTestedVersion = '1.18.2' + const lastSupportedVersion = supportedVersions.at(-1)! const firstSupportedVersion = supportedVersions[0] const lowerBound = isMajorVersionGreater(firstSupportedVersion, version) - const upperBound = isMajorVersionGreater(version, lastTestedVersion) + const upperBound = versionToNumber(version) > versionToNumber(lastSupportedVersion) if (lowerBound || upperBound) { - version = prompt(`Version ${version} is not supported, supported versions are ${supportedVersions.join(', ')}, what try to use instead?`, lowerBound ? firstSupportedVersion : lastTestedVersion) + version = prompt(`Version ${version} is not supported, supported versions are ${supportedVersions.join(', ')}, what try to use instead?`, lowerBound ? firstSupportedVersion : lastSupportedVersion) if (!version) return } if (levelDat.WorldGenSettings) { diff --git a/src/react/MainMenu.tsx b/src/react/MainMenu.tsx index 3e3170f4..43908645 100644 --- a/src/react/MainMenu.tsx +++ b/src/react/MainMenu.tsx @@ -103,7 +103,7 @@ export default ({ connectToServerAction, mapsProvider, singleplayerAction, optio icon='pixelarticons:folder' onClick={openFileAction} initialTooltip={{ - content: 'Load any 1.8-1.16 Java world' + (haveDirectoryPicker() ? '' : ' (zip)'), + content: 'Load any Java world save' + (haveDirectoryPicker() ? '' : ' (zip)!'), placement: 'bottom-start', }} /> diff --git a/src/soundSystem.ts b/src/soundSystem.ts index a2cc1f70..e7fdaee7 100644 --- a/src/soundSystem.ts +++ b/src/soundSystem.ts @@ -144,10 +144,12 @@ subscribeKey(miscUiState, 'gameLoaded', async () => { // movement happening if (Date.now() - lastStepSound > 300) { const blockUnder = bot.world.getBlock(bot.entity.position.offset(0, -1, 0)) - const stepSound = getStepSound(blockUnder) - if (stepSound) { - await playHardcodedSound(stepSound, undefined, 0.6)// todo not sure why 0.6 - lastStepSound = Date.now() + if (blockUnder) { + const stepSound = getStepSound(blockUnder) + if (stepSound) { + await playHardcodedSound(stepSound, undefined, 0.6)// todo not sure why 0.6 + lastStepSound = Date.now() + } } } } diff --git a/src/water.ts b/src/water.ts index 9f8ec557..d8b4b41c 100644 --- a/src/water.ts +++ b/src/water.ts @@ -19,7 +19,7 @@ customEvents.on('gameLoaded', () => { } bot.on('physicsTick', () => { // todo - const _inWater = bot.world.getBlock(bot.entity.position.offset(0, 1, 0)).name === 'water' + const _inWater = bot.world.getBlock(bot.entity.position.offset(0, 1, 0))?.name === 'water' if (_inWater !== inWater) { inWater = _inWater updateInWater() From 216b1712c2dd418636d9fcc9c6e632137555e2d9 Mon Sep 17 00:00:00 2001 From: Vitaly Turovsky Date: Thu, 13 Jun 2024 19:47:48 +0300 Subject: [PATCH 08/18] more basic tests. test joining to a local java vanilla server, movement! --- .eslintrc.json | 17 +++++++++ .gitignore | 1 + cypress/e2e/index.spec.ts | 57 ++++++++++++++++++++++++++++- cypress/e2e/shared.ts | 3 ++ cypress/plugins/index.js | 9 ++++- cypress/plugins/server.properties | 61 +++++++++++++++++++++++++++++++ cypress/plugins/startServer.ts | 45 +++++++++++++++++++++++ index.html | 2 +- src/index.ts | 7 +++- src/react/Chat.tsx | 3 +- src/worldInteractions.ts | 3 +- 11 files changed, 200 insertions(+), 8 deletions(-) create mode 100644 cypress/plugins/server.properties create mode 100644 cypress/plugins/startServer.ts diff --git a/.eslintrc.json b/.eslintrc.json index 98388260..a91015d2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -96,5 +96,22 @@ "unicorn/filename-case": "off", "max-depth": "off" }, + "overrides": [ + { + "files": [ + "*.js" + ], + "rules": { + "space-before-function-paren": [ + "error", + { + "anonymous": "always", + "named": "never", + "asyncArrow": "always" + } + ] + } + } + ], "root": true } diff --git a/.gitignore b/.gitignore index 240b751a..3a188862 100644 --- a/.gitignore +++ b/.gitignore @@ -17,5 +17,6 @@ out .vercel generated storybook-static +server-jar src/react/npmReactComponents.ts diff --git a/cypress/e2e/index.spec.ts b/cypress/e2e/index.spec.ts index 05b50211..ec7d84e7 100644 --- a/cypress/e2e/index.spec.ts +++ b/cypress/e2e/index.spec.ts @@ -1,4 +1,6 @@ +/* eslint-disable max-nested-callbacks */ /// +import supportedVersions from '../../src/supportedVersions.mjs' import { setOptions, cleanVisit, visit } from './shared' // todo use ssl @@ -12,7 +14,7 @@ const compareRenderedFlatWorld = () => { } const testWorldLoad = () => { - cy.document().then({ timeout: 20_000 }, doc => { + return cy.document().then({ timeout: 20_000 }, doc => { return new Cypress.Promise(resolve => { doc.addEventListener('cypress-world-ready', resolve) }) @@ -36,7 +38,7 @@ it('Loads & renders singleplayer', () => { testWorldLoad() }) -it('Joins to server', () => { +it('Joins to local flying-squid server', () => { visit('/?ip=localhost&version=1.16.1') window.localStorage.version = '' // todo replace with data-test @@ -47,9 +49,60 @@ it('Joins to server', () => { testWorldLoad() }) +it('Joins to local latest Java vanilla server', () => { + const version = supportedVersions.at(-1)! + cy.task('startServer', [version, 25_590]).then(() => { + visit('/?ip=localhost:25590&username=bot') + cy.get('[data-test-id="connect-qs"]').click() + testWorldLoad().then(() => { + let x = 0 + let z = 0 + cy.window().then((win) => { + x = win.bot.entity.position.x + z = win.bot.entity.position.z + }) + cy.document().trigger('keydown', { code: 'KeyW' }) + cy.wait(1500).then(() => { + cy.document().trigger('keyup', { code: 'KeyW' }) + cy.window().then(async (win) => { + // eslint-disable-next-line prefer-destructuring + const bot: typeof __type_bot = win.bot + // todo use f3 stats instead + if (bot.entity.position.x === x && bot.entity.position.z === z) { + throw new Error('Player not moved') + } + + bot.chat('Hello') // todo assert + bot.chat('/gamemode creative') + // bot.on('message', () => { + void bot.creative.setInventorySlot(bot.inventory.hotbarStart, new win.PrismarineItem(1, 1, 0)) + // }) + await bot.lookAt(bot.entity.position.offset(1, 0, 1)) + }).then(() => { + cy.document().trigger('mousedown', { button: 2, isTrusted: true, force: true }) // right click + cy.document().trigger('mouseup', { button: 2, isTrusted: true, force: true }) + cy.wait(1000) + }) + }) + }) + }) +}) + it('Loads & renders zip world', () => { cleanVisit() cy.get('[data-test-id="select-file-folder"]').click({ shiftKey: true }) cy.get('input[type="file"]').selectFile('cypress/superflat.zip', { force: true }) testWorldLoad() }) + + +it.skip('Loads & renders world from folder', () => { + cleanVisit() + // dragndrop folder + cy.get('[data-test-id="select-file-folder"]').click() + cy.get('input[type="file"]').selectFile('server-jar/world', { + force: true, + // action: 'drag-drop', + }) + testWorldLoad() +}) diff --git a/cypress/e2e/shared.ts b/cypress/e2e/shared.ts index 9292a8d5..47518f1b 100644 --- a/cypress/e2e/shared.ts +++ b/cypress/e2e/shared.ts @@ -3,6 +3,9 @@ import { AppOptions } from '../../src/optionsStorage' export const cleanVisit = (url?) => { cy.clearLocalStorage() visit(url) + window.localStorage.options = { + chatOpacity: 0 + } } export const visit = (url = '/') => { window.localStorage.cypress = 'true' diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index 35dc2989..e55f5d26 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -2,11 +2,13 @@ const { cypressEsbuildPreprocessor } = require('cypress-esbuild-preprocessor') const { initPlugin } = require('cypress-plugin-snapshots/plugin') const polyfill = require('esbuild-plugin-polyfill-node') +const { startMinecraftServer } = require('./startServer') module.exports = (on, config) => { initPlugin(on, config) on('file:preprocessor', cypressEsbuildPreprocessor({ esbuildOptions: { + sourcemap: true, plugins: [ polyfill.polyfillNode({ polyfills: { @@ -17,10 +19,15 @@ module.exports = (on, config) => { }, })) on('task', { - log (message) { + log(message) { console.log(message) return null }, }) + on('task', { + async startServer([version, port]) { + return startMinecraftServer(version, port) + } + }) return config } diff --git a/cypress/plugins/server.properties b/cypress/plugins/server.properties new file mode 100644 index 00000000..5873a1aa --- /dev/null +++ b/cypress/plugins/server.properties @@ -0,0 +1,61 @@ +#Minecraft server properties +allow-flight=false +allow-nether=true +broadcast-console-to-ops=true +broadcast-rcon-to-ops=true +difficulty=peaceful +enable-command-block=false +enable-jmx-monitoring=false +enable-query=false +enable-rcon=false +enable-status=true +enforce-secure-profile=true +enforce-whitelist=false +entity-broadcast-range-percentage=100 +force-gamemode=false +function-permission-level=2 +gamemode=survival +generate-structures=true +generator-settings={} +hardcore=false +hide-online-players=false +initial-disabled-packs= +initial-enabled-packs=vanilla +level-name=world +level-seed= +level-type=flat +log-ips=true +max-build-height=256 +max-chained-neighbor-updates=1000000 +max-players=20 +max-tick-time=60000 +max-world-size=29999984 +motd=A Minecraft Server +network-compression-threshold=256 +online-mode=false +op-permission-level=4 +player-idle-timeout=0 +prevent-proxy-connections=false +pvp=true +query.port=25565 +rate-limit=0 +rcon.password= +rcon.port=25575 +require-resource-pack=false +resource-pack= +resource-pack-id= +resource-pack-prompt= +resource-pack-sha1= +server-ip= +server-port=25565 +simulation-distance=10 +snooper-enabled=true +spawn-animals=true +spawn-monsters=true +spawn-npcs=true +spawn-protection=16 +sync-chunk-writes=true +text-filtering-config= +use-native-transport=true +view-distance=10 +white-list=false diff --git a/cypress/plugins/startServer.ts b/cypress/plugins/startServer.ts new file mode 100644 index 00000000..ecf0d210 --- /dev/null +++ b/cypress/plugins/startServer.ts @@ -0,0 +1,45 @@ +import { ChildProcess, spawn } from 'child_process' +import * as fs from 'fs' +import * as path from 'path' +import { promisify } from 'util' +import { downloadServer } from 'minecraft-wrap' +import * as waitOn from 'wait-on' + +let prevProcess: ChildProcess | null = null +export const startMinecraftServer = async (version: string, port: number) => { + if (prevProcess) return null + const jar = `./server-jar/${version}.jar` + + const start = () => { + // if (prevProcess) { + // prevProcess.kill() + // } + + prevProcess = spawn('java', ['-jar', path.basename(jar), 'nogui', '--port', `${port}`], { + stdio: 'inherit', + cwd: path.dirname(jar), + }) + } + + let coldStart = false + if (fs.existsSync(jar)) { + start() + } else { + coldStart = true + promisify(downloadServer)(version, jar).then(() => { + // add eula.txt + fs.writeFileSync(path.join(path.dirname(jar), 'eula.txt'), 'eula=true') + // copy cypress/plugins/server.properties + fs.copyFileSync(path.join(__dirname, 'server.properties'), path.join(path.dirname(jar), 'server.properties')) + // copy ops.json + fs.copyFileSync(path.join(__dirname, 'ops.json'), path.join(path.dirname(jar), 'ops.json')) + start() + }) + } + + return new Promise((res) => { + waitOn({ resources: [`tcp:localhost:${port}`] }, () => { + setTimeout(() => res(null), coldStart ? 6500 : 2000) // todo retry instead of timeout + }) + }) +} diff --git a/index.html b/index.html index 6d3b326b..62e109cd 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@
Loading...
-
A true Minecraft client in your browser!
+
A true Minecraft client in your browser!
` diff --git a/src/index.ts b/src/index.ts index fe584b4d..72f270d4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,6 +17,7 @@ import './scaleInterface' import itemsPng from 'prismarine-viewer/public/textures/items.png' import { initWithRenderer } from './topRightStats' import PrismarineBlock from 'prismarine-block' +import PrismarineItem from 'prismarine-item' import { options, watchValue } from './optionsStorage' import './reactUi.jsx' @@ -580,6 +581,7 @@ async function connect (connectOptions: ConnectOptions) { errorAbortController.abort() const mcData = MinecraftData(bot.version) window.PrismarineBlock = PrismarineBlock(mcData.version.minecraftVersion!) + window.PrismarineItem = PrismarineItem(mcData.version.minecraftVersion!) window.loadedData = mcData window.Vec3 = Vec3 window.pathfinder = pathfinder @@ -825,9 +827,12 @@ listenGlobalEvents() watchValue(miscUiState, async s => { if (s.appLoaded) { // fs ready const qs = new URLSearchParams(window.location.search) + const moreServerOptions = {} as Record + if (qs.has('version')) moreServerOptions.version = qs.get('version') if (qs.get('singleplayer') === '1') { loadSingleplayer({}, { - worldFolder: undefined + worldFolder: undefined, + ...moreServerOptions }) } if (qs.get('loadSave')) { diff --git a/src/react/Chat.tsx b/src/react/Chat.tsx index b05f9930..981878c8 100644 --- a/src/react/Chat.tsx +++ b/src/react/Chat.tsx @@ -1,6 +1,5 @@ import { proxy, subscribe } from 'valtio' import { useEffect, useMemo, useRef, useState } from 'react' -import { isCypress } from '../standaloneUtils' import { MessageFormatPart } from '../botUtils' import { MessagePart } from './MessageFormatted' import './Chat.css' @@ -200,7 +199,7 @@ export default ({ messages, opacity = 1, fetchCompletionItems, opened, sendMessa return ( <> -