Skip to content

Commit

Permalink
Merge pull request #440 from HiveGamesOSS/develop
Browse files Browse the repository at this point in the history
1.4.6
  • Loading branch information
clankstar authored Feb 20, 2025
2 parents 9b61a6d + 0358864 commit 0ea7488
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build_platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4

- name: Mark Gradle as Executable
run: chmod +x gradlew
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4

- name: Build with Gradle Wrapper
run: ./gradlew build -x test
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4

- name: Mark Gradle as Executable
run: chmod +x gradlew
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_test_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4

- name: Mark Gradle as Executable
run: chmod +x gradlew
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
distribution: 'temurin'

- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
uses: gradle/actions/dependency-submission@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4

- name: Mark Gradle as Executable
run: chmod +x gradlew
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4

- name: Build with Gradle Wrapper
run: ./gradlew build -x test
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4
uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4

- name: Mark Gradle as Executable
run: chmod +x gradlew
Expand Down
2 changes: 1 addition & 1 deletion 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.5",
"version": "1.4.6",
"description": "Convert worlds between Java and Bedrock.",
"main": "src/index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies {
}

group = "com.hivemc.chunker"
version = "1.4.5"
version = "1.4.6"
description = "chunker"
base.archivesName = "chunker-cli"
java.sourceCompatibility = JavaVersion.VERSION_17
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.hivemc.chunker.cli.messenger;

import com.google.common.util.concurrent.ExecutionError;
import com.google.gson.*;
import com.hivemc.chunker.cli.messenger.messaging.BasicMessage;
import com.hivemc.chunker.cli.messenger.messaging.BasicMessageTypeAdapter;
Expand Down Expand Up @@ -433,6 +434,11 @@ public static boolean startConversionRequest(UUID sessionID, UUID taskID, WorldC
throwable = throwable.getCause();
}

// Unwrap execution error
if (throwable instanceof ExecutionError) {
throwable = throwable.getCause();
}

// Check that it isn't a cancellation
if (throwable instanceof CancellationException) {
write(new ErrorResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,27 +135,28 @@ public BedrockBiomeIDResolver(Version bedrockVersion) {
@Override
public Optional<Integer> from(ChunkerBiome input) {
// Custom biomes aren't supported in this version since they are IDs
ChunkerBiome.ChunkerVanillaBiome ChunkerVanillaBiome;
ChunkerBiome.ChunkerVanillaBiome chunkerVanillaBiome;

// Resolve it to a vanilla biome
if (input instanceof ChunkerBiome.ChunkerVanillaBiome biome) {
ChunkerVanillaBiome = biome;
chunkerVanillaBiome = biome;
} else {
// Custom identifiers aren't supported, so use the fallback
ChunkerVanillaBiome = input.getFallback();
}

// First null check
if (ChunkerVanillaBiome == null) {
return Optional.empty(); // Unable to resolve a vanilla biome
// If they're not supported check for a fallback
ChunkerBiome.ChunkerVanillaBiome fallback = input.getFallback();
if (fallback != null) {
return from(fallback);
} else {
// No possible mapping
return Optional.empty();
}
}

// Try to map it
Integer mapped = mapping.forward().get(ChunkerVanillaBiome);
Integer mapped = mapping.forward().get(chunkerVanillaBiome);

// It wasn't found, so first we should use the built-in fallbacks
if (mapped == null) {
ChunkerBiome.ChunkerVanillaBiome fallback = ChunkerVanillaBiome.getFallback();
ChunkerBiome.ChunkerVanillaBiome fallback = chunkerVanillaBiome.getFallback();

// Use the fallback if it's present
if (fallback != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public JavaNamedBiomeResolver(Version javaVersion, boolean customIdentifierSuppo

@Override
public Optional<String> from(ChunkerBiome input) {
if (input instanceof ChunkerBiome.ChunkerVanillaBiome ChunkerVanillaBiome) {
return from(ChunkerVanillaBiome);
if (input instanceof ChunkerBiome.ChunkerVanillaBiome chunkerVanillaBiome) {
return from(chunkerVanillaBiome);
} else if (input instanceof ChunkerCustomBiome customIdentifierBiome) {
if (customIdentifierSupported) {
return Optional.ofNullable(customIdentifierBiome.getIdentifier());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ public List<Palette<ChunkerBiome>> asPalette() {

@Override
public Palette<ChunkerBiome> as4X4Palette(int chunkY) {
// If there are no chunks return an empty palette
if (chunks.isEmpty()) {
return EmptyPalette.instance(4);
}
return chunkY < 0 || chunkY >= chunks.size() ? chunks.get(chunks.size() - 1) : chunks.get(chunkY);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,13 @@ public List<Palette<ChunkerBiome>> asPalette() {

@Override
public Palette<ChunkerBiome> as4X4Palette(int chunkY) {
Palette<ChunkerBiome> oldPalette = chunkY < 0 || chunkY >= chunks.size() ? chunks.get(chunks.size() - 1) : chunks.get(chunkY);
// If there are no chunks return an empty palette
if (chunks.isEmpty()) {
return EmptyPalette.instance(4);
}

// Use the top palette if chunkY is outside the range of chunks
Palette<ChunkerBiome> oldPalette = chunkY < 0 || chunkY >= chunks.size() ? chunks.get(chunks.size() - 1) : chunks.get(chunkY);
if (oldPalette.isEmpty()) {
return EmptyPalette.instance(4);
} else if (oldPalette.getKeyCount() == 1) {
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[versions]
picocli = "4.7.6"
caffeine = "3.2.0"
gson = "2.11.0"
gson = "2.12.1"
guava = "33.4.0-jre"
leveldb = "1.0.1"
leveldb-api = "1.0.1"
Expand All @@ -18,7 +18,7 @@ junit = "5.11.4"
# Plugins
shadow = "8.1.1"
gitVersion = "3.1.0"
jpackage = "1.6.0"
jpackage = "1.6.1"
node = "7.1.0"

[libraries]
Expand Down

0 comments on commit 0ea7488

Please sign in to comment.