Skip to content

Commit

Permalink
Merge pull request #345 from HiveGamesOSS/develop
Browse files Browse the repository at this point in the history
1.4.5
  • Loading branch information
clankstar authored Jan 27, 2025
2 parents 40ddcf6 + 0e9d2bb commit 9b61a6d
Show file tree
Hide file tree
Showing 38 changed files with 677,872 additions and 408 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
run: ./gradlew build -x test

- name: Sign exe with Trusted Signing
uses: azure/trusted-signing-action@v0.5.0
uses: azure/trusted-signing-action@v0.5.1
if: github.repository == 'HiveGamesOSS/Chunker'
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
Expand All @@ -93,7 +93,7 @@ jobs:
timestamp-digest: SHA256

- name: Sign unpacked with Trusted Signing
uses: azure/trusted-signing-action@v0.5.0
uses: azure/trusted-signing-action@v0.5.1
if: github.repository == 'HiveGamesOSS/Chunker'
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
run: ./gradlew build -x test

- name: Sign exe with Trusted Signing
uses: azure/trusted-signing-action@v0.5.0
uses: azure/trusted-signing-action@v0.5.1
if: github.repository == 'HiveGamesOSS/Chunker'
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
Expand All @@ -92,7 +92,7 @@ jobs:
timestamp-digest: SHA256

- name: Sign unpacked with Trusted Signing
uses: azure/trusted-signing-action@v0.5.0
uses: azure/trusted-signing-action@v0.5.1
if: github.repository == 'HiveGamesOSS/Chunker'
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Supported Formats:
- 1.18.0 - 1.18.30
- 1.19.0 - 1.19.80
- 1.20.0 - 1.20.80
- 1.21.0 - 1.21.50
- 1.21.0 - 1.21.60
- Java
- 1.8.8
- 1.9.0 - 1.9.3
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies {
}

node {
version.set("23.3.0")
npmVersion.set("10.9.2")
version.set("23.6.1")
npmVersion.set("11.0.0")
download.set(true)
}

Expand Down
6 changes: 3 additions & 3 deletions app/electron/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chunker-electron",
"private": true,
"version": "1.4.4",
"version": "1.4.5",
"description": "Convert worlds between Java and Bedrock.",
"main": "src/index.js",
"type": "module",
Expand All @@ -15,7 +15,7 @@
"homepage": "https://github.com/HiveGamesOSS/Chunker",
"license": "MIT",
"devDependencies": {
"electron": "33.2.1",
"electron": "34.0.0",
"electron-builder": "25.0.5",
"git-last-commit": "^1.0.1"
},
Expand Down Expand Up @@ -59,7 +59,7 @@
"archiver": "^7.0.1",
"electron-dl": "^4.0.0",
"electron-log": "^5.2.4",
"fs-extra": "^11.2.0",
"fs-extra": "^11.3.0",
"jszip": "^3.10.1"
},
"optionalDependencies": {
Expand Down
36 changes: 34 additions & 2 deletions app/electron/src/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,34 @@ export class Session {
await fs.mkdir(worldOutputPath);

if (copyNbt) {
await fs.copy(worldInputPath, worldOutputPath);
// Copy all the files but exclude level.dat, region, entities, data/map_.dat/idcounts.dat
await fs.copy(worldInputPath, worldOutputPath, {
filter: (src) => {
let relativePath = path.relative(worldInputPath, src);
let parts = relativePath.split(path.sep);

// Don't include any block data / entities (these are passed through Chunker)
if (parts.includes("region") || parts.includes("entities")) {
return false;
}

// Don't include in-game map data
if (parts.includes("data") && parts.length === 2) {
let fileName = parts[1];
if (fileName === "idcounts.dat" || fileName.startsWith("map_") && fileName.endsWith(".dat")) {
return false;
}
}

// Don't include level.dat / session.lock
if (parts.length === 1 && (parts[0] === "level.dat" || parts[0] === "session.lock")) {
return false;
}

// Otherwise include the file
return true;
}
});
}

// Process request
Expand Down Expand Up @@ -705,7 +732,12 @@ export class Session {
try {
// Use the user provided file name
let outputFileName = (this._finalName ?? "output").replaceAll(/[^A-Za-z0-9_\-@]/g, "_");
if (outputFileName.length === 0) {

// Ensure that there are not too many underscores from replacement
outputFileName = outputFileName.replace(/_{2,}/g, '_');

// If the filename is empty or over 128 characters use "output"
if (outputFileName.length === 0 || outputFileName.length >= 128) {
outputFileName = "output";
}
outputFileName = outputFileName + (outputType.startsWith("BEDROCK") ? ".mcworld" : ".zip");
Expand Down
Loading

0 comments on commit 9b61a6d

Please sign in to comment.