Skip to content

Commit

Permalink
Start vanilla block mapping (#25)
Browse files Browse the repository at this point in the history
* Start Bedrock v1.21.50 and Java v1.21.4

* node gitignore

* ci

* Update test.yml

* add types/node

* MC v1.21.50 vanilla structures

* Add more block type converters

* Logging

* empty states convert

* heads

* leaves and pillars

* beds, leaves and pillars

* Wall

* more

* more

* a

* slabs and stairs

* double slabs mapping cuz well mojang makes the best minecraft version

* trapdoor

* rails and signs

* Fixing oak woodset

* a
  • Loading branch information
JaylyDev authored Jan 7, 2025
1 parent c9999c0 commit 2f2c001
Show file tree
Hide file tree
Showing 52 changed files with 346,695 additions and 52,505 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ jobs:
built_path=nbt-to-mcstructure_v${{ github.event.release.tag_name }}_${{ runner.os }}_${{ matrix.cfg.architecture }}.zip
echo "BUILT_PATH=$built_path" >> $GITHUB_ENV
cp ./structures ./dist -r
cp ./assets ./dist -r
rm ./dist/assets/demo_video.gif
rm ./dist/assets/vanilla_structures.zip
cp ./cli/data ./dist -r
cd dist
if [ "${{ runner.os }}" == "Windows" ]; then
7z a $built_path .
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,18 @@ jobs:
shell: bash
working-directory: './regolith-test-project'
run: regolith run default

test_vanilla_mapping:
runs-on: ubuntu-latest
name: Mapping Generator
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
working-directory: ./vanilla-mappings
- run: npm run build
working-directory: ./vanilla-mappings
- run: npm test
working-directory: ./vanilla-mappings
14 changes: 12 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,21 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Node.js: Launch Program",
"program": "${workspaceFolder}/vanilla-mappings/dist/index.js",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"preLaunchTask": "tsc: build - vanilla-mappings/tsconfig.json"
},
{
"name": "Python: Launch Program",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}\\__main__.py",
"program": "${workspaceFolder}/cli/__main__.py",
"console": "integratedTerminal",
"justMyCode": true
}
Expand Down
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"prettier.printWidth": 160,
"prettier.tabWidth": 4
}
}
14 changes: 14 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "vanilla-mappings/tsconfig.json",
"problemMatcher": [
"$tsc"
],
"group": "build",
"label": "tsc: build - vanilla-mappings/tsconfig.json"
}
]
}
Binary file modified assets/vanilla_structures.zip
Binary file not shown.
File renamed without changes.
48,642 changes: 22,406 additions & 26,236 deletions assets/blocksJ2B.json → cli/data/blocksJ2B.json

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions cli/java_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
)
from progress_bar import track

assets_dir = os.path.abspath('./assets/')
script_dir = os.path.dirname(os.path.abspath(__file__))

# Construct full paths to your files
blocksj2b_path = os.path.join(assets_dir, "blocksJ2B.json")
bedsj2b_path = os.path.join(assets_dir, "bedsJ2B.json")
skullj2b_path = os.path.join(assets_dir, "skullJ2B.json")
blockstates_path = os.path.join(assets_dir, "blockstates.json")
blocksj2b_path = os.path.join(script_dir, "data", "blocksJ2B.json")
bedsj2b_path = os.path.join(script_dir, "data", "bedsJ2B.json")
skullj2b_path = os.path.join(script_dir, "data", "skullJ2B.json")
blockstates_path = os.path.join(script_dir, "data", "blockstates.json")

# Load JSON files
with open(blocksj2b_path, "r") as f:
Expand Down
48,642 changes: 22,406 additions & 26,236 deletions nbt-to-mcstructure/blocksJ2B.json

Large diffs are not rendered by default.

23 changes: 0 additions & 23 deletions scripts/mojang-blocks.js

This file was deleted.

130 changes: 130 additions & 0 deletions vanilla-mappings/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
11 changes: 11 additions & 0 deletions vanilla-mappings/data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Vanilla Mappings Data Files

Source:

- `bedrock-blocks.json`: https://github.com/Mojang/bedrock-samples/
- `java-blocks.json`: https://github.com/HiveGamesOSS/Chunker/tree/main/cli/data/java/

Version:

- Bedrock: v1.21.50
- Java: v1.21.4
Loading

0 comments on commit 2f2c001

Please sign in to comment.