Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.1.2 #42

Merged
merged 13 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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("22.4.0")
npmVersion.set("10.8.1")
version.set("22.8.0")
npmVersion.set("10.8.3")
download.set(true)
}

Expand Down
2 changes: 1 addition & 1 deletion app/electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chunker-electron",
"version": "1.1.1",
"version": "1.1.2",
"description": "Convert worlds between Java and Bedrock.",
"private": true,
"main": "src/index.js",
Expand Down
2 changes: 1 addition & 1 deletion app/electron/src/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ export class Session {
await fs.mkdir(worldOutputPath);

if (copyNbt) {
await fs.cp(worldInputPath, worldOutputPath, {recursive: true});
await fs.copy(worldInputPath, worldOutputPath);
}

// Process request
Expand Down
92 changes: 32 additions & 60 deletions app/package-lock.json

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

4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"author": "Hive Games Limited",
"license": "MIT",
"devDependencies": {
"concurrently": "^8.2.2",
"concurrently": "^9.0.0",
"cross-env": "^7.0.3",
"wait-on": "^8.0.0"
"wait-on": "^8.0.1"
}
}
4 changes: 2 additions & 2 deletions app/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"base64-arraybuffer": "^1.0.2",
"chroma-js": "^3.0.0",
"chroma-js": "^3.1.1",
"file-saver": "^2.0.5",
"jszip": "^3.10.1",
"leaflet": "^1.9.4",
Expand All @@ -24,7 +24,7 @@
"leaflet-mouse-position": "^1.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.1",
"react-router-dom": "^6.26.2",
"react-scripts": "^5.0.1",
"react-select": "^5.8.0",
"react-syntax-highlighter": "^15.5.0",
Expand Down
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.1.1"
version = "1.1.2"
description = "chunker"
base.archivesName = "chunker-cli"
java.sourceCompatibility = JavaVersion.VERSION_17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,10 @@ public BannerBlockEntity updateBeforeProcess(@NotNull BedrockResolvers resolvers
// Get the new block type
ChunkerBlockType newType = BANNER_TO_WALL_DYE.inverse().getOrDefault(Pair.of(wall, blockEntity.getBase().get()), ChunkerVanillaBlockType.WHITE_BANNER);

// Set the new block type
column.setBlock(x, y, z, new ChunkerBlockIdentifier(newType, blockIdentifier.getPresentStates(), blockIdentifier.getPreservedIdentifier()));
// Set the new block type (if the banner is present)
if (!blockIdentifier.isAir()) {
column.setBlock(x, y, z, new ChunkerBlockIdentifier(newType, blockIdentifier.getPresentStates(), blockIdentifier.getPreservedIdentifier()));
}

// Remove the base since it's now in the block
blockEntity.setBase(Optional.empty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ public BedBlockEntity updateBeforeProcess(@NotNull BedrockResolvers resolvers, C
// Grab the bed type
ChunkerBlockType newType = BED_TO_DYE.inverse().getOrDefault(bedrockBedBlockEntity.getColor(), ChunkerVanillaBlockType.WHITE_BED);

// Set the new block type
column.setBlock(x, y, z, new ChunkerBlockIdentifier(newType, blockIdentifier.getPresentStates(), blockIdentifier.getPreservedIdentifier()));
// Set the new block type (if the bed is present)
if (!blockIdentifier.isAir()) {
column.setBlock(x, y, z, new ChunkerBlockIdentifier(newType, blockIdentifier.getPresentStates(), blockIdentifier.getPreservedIdentifier()));
}

// Return the chunker version
return bedrockBedBlockEntity.toChunker();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ public ChestBlockEntity updateBeforeProcess(@NotNull BedrockResolvers resolvers,
// Single chest
chestType = ChestType.SINGLE;
}
column.setBlock(x, y, z, blockIdentifier.copyWith(VanillaBlockStates.CHEST_TYPE, chestType));

// Only update if the block identifier isn't air
if (!blockIdentifier.isAir()) {
column.setBlock(x, y, z, blockIdentifier.copyWith(VanillaBlockStates.CHEST_TYPE, chestType));
}
}

// Handle trapped chest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.hivemc.chunker.conversion.encoding.bedrock.base.resolver.blockentity.type.BedrockItemFrameBlockEntity;
import com.hivemc.chunker.conversion.intermediate.column.ChunkerColumn;
import com.hivemc.chunker.conversion.intermediate.column.chunk.identifier.ChunkerBlockIdentifier;
import com.hivemc.chunker.conversion.intermediate.column.chunk.identifier.type.block.ChunkerVanillaBlockType;
import com.hivemc.chunker.nbt.tags.Tag;
import com.hivemc.chunker.nbt.tags.collection.CompoundTag;
import com.hivemc.chunker.nbt.tags.primitive.ByteTag;
Expand Down Expand Up @@ -57,10 +58,15 @@ public void write(@NotNull BedrockResolvers resolvers, @NotNull CompoundTag outp
@Override
public boolean shouldRemoveBeforeProcess(ChunkerColumn column, int x, int y, int z, BedrockItemFrameBlockEntity blockEntity) {
// Turn into an entity
column.getEntities().add(blockEntity.toChunker(column.getBlock(x, y, z)));
ChunkerBlockIdentifier block = column.getBlock(x, y, z);

// Replace the block with air
column.setBlock(x, y, z, ChunkerBlockIdentifier.AIR);
// Only add the item frame if there is a backing item frame block
if (block.getType() == ChunkerVanillaBlockType.ITEM_FRAME_BEDROCK) {
column.getEntities().add(blockEntity.toChunker(block));

// Replace the block with air
column.setBlock(x, y, z, ChunkerBlockIdentifier.AIR);
}

// Remove
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.hivemc.chunker.conversion.intermediate.column.ChunkerColumn;
import com.hivemc.chunker.conversion.intermediate.column.blockentity.JukeboxBlockEntity;
import com.hivemc.chunker.conversion.intermediate.column.chunk.identifier.ChunkerBlockIdentifier;
import com.hivemc.chunker.conversion.intermediate.column.chunk.identifier.type.block.ChunkerVanillaBlockType;
import com.hivemc.chunker.conversion.intermediate.column.chunk.identifier.type.block.states.vanilla.VanillaBlockStates;
import com.hivemc.chunker.conversion.intermediate.column.chunk.identifier.type.block.states.vanilla.types.Bool;
import com.hivemc.chunker.nbt.tags.collection.CompoundTag;
Expand Down Expand Up @@ -37,6 +38,11 @@ public void write(@NotNull BedrockResolvers resolvers, @NotNull CompoundTag outp
@Override
public JukeboxBlockEntity updateBeforeProcess(@NotNull BedrockResolvers resolvers, ChunkerColumn column, int x, int y, int z, JukeboxBlockEntity blockEntity) {
ChunkerBlockIdentifier identifier = column.getBlock(x, y, z);

// Don't update anything if the block isn't a jukebox
if (identifier.getType() != ChunkerVanillaBlockType.JUKEBOX) return blockEntity;

// Check for the record
boolean hasRecord = blockEntity.getRecord() != null && !blockEntity.getRecord().getIdentifier().isAir();
column.setBlock(x, y, z, identifier.copyWith(VanillaBlockStates.HAS_RECORD, hasRecord ? Bool.TRUE : Bool.FALSE));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.hivemc.chunker.conversion.intermediate.column.ChunkerColumn;
import com.hivemc.chunker.conversion.intermediate.column.blockentity.LecternBlockEntity;
import com.hivemc.chunker.conversion.intermediate.column.chunk.identifier.ChunkerBlockIdentifier;
import com.hivemc.chunker.conversion.intermediate.column.chunk.identifier.type.block.ChunkerVanillaBlockType;
import com.hivemc.chunker.conversion.intermediate.column.chunk.identifier.type.block.states.vanilla.VanillaBlockStates;
import com.hivemc.chunker.conversion.intermediate.column.chunk.identifier.type.block.states.vanilla.types.Bool;
import com.hivemc.chunker.nbt.tags.collection.CompoundTag;
Expand Down Expand Up @@ -49,6 +50,11 @@ public void write(@NotNull BedrockResolvers resolvers, @NotNull CompoundTag outp
@Override
public LecternBlockEntity updateBeforeProcess(@NotNull BedrockResolvers resolvers, ChunkerColumn column, int x, int y, int z, LecternBlockEntity blockEntity) {
ChunkerBlockIdentifier identifier = column.getBlock(x, y, z);

// Don't update anything if the block isn't a lectern
if (identifier.getType() != ChunkerVanillaBlockType.LECTERN) return blockEntity;

// Check for the book
boolean hasBook = blockEntity.getBook() != null && !blockEntity.getBook().getIdentifier().isAir();
column.setBlock(x, y, z, identifier.copyWith(VanillaBlockStates.HAS_BOOK, hasBook ? Bool.TRUE : Bool.FALSE));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.hivemc.chunker.conversion.intermediate.column.ChunkerColumn;
import com.hivemc.chunker.conversion.intermediate.column.blockentity.container.randomizable.ShulkerBoxBlockEntity;
import com.hivemc.chunker.conversion.intermediate.column.chunk.identifier.ChunkerBlockIdentifier;
import com.hivemc.chunker.conversion.intermediate.column.chunk.identifier.type.block.ChunkerVanillaBlockType;
import com.hivemc.chunker.conversion.intermediate.column.chunk.identifier.type.block.states.vanilla.VanillaBlockStates;
import com.hivemc.chunker.conversion.intermediate.column.chunk.identifier.type.block.states.vanilla.types.FacingDirection;
import com.hivemc.chunker.nbt.tags.collection.CompoundTag;
Expand Down Expand Up @@ -72,6 +73,9 @@ public ShulkerBoxBlockEntity updateBeforeProcess(@NotNull BedrockResolvers resol
if (blockEntity instanceof BedrockShulkerBlockEntity bedrockShulkerBlockEntity) {
ChunkerBlockIdentifier blockIdentifier = column.getBlock(x, y, z);

// Don't update anything if the block is air
if (blockIdentifier.isAir()) return blockEntity;

// Apply facing direction
blockIdentifier = blockIdentifier.copyWith(VanillaBlockStates.FACING_ALL, bedrockShulkerBlockEntity.getFacing());

Expand Down
Loading