diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e361084fcf..da5831b87d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,10 +1,22 @@ +7.3.7 +- Fixed handling of some time-related commands in the snapshot system +- Fixed some situations where rotated pastes can behave oddly with the update side effect disabled +- Fixed an error that can occur when generating completions starting with a `"` +- Fixed Sponge v3 schematics lacking the `BlockEntities` not loading +- Fixed the `//curve` and `//line` commands not accepting decimal values for thickness +- Fixed WorldEdit not using typical error handling systems when an error is thrown during post-edit +- Fixed NBT parsing for certain legacy schematics with non-standard string formatting +- Improved performance of the side effect system, and fixed some API inconsistencies +- Re-enabled the buffering system, due to some systems depending on it in certain situations +- [Sponge] Added `-y` value support that was missing in some situations + 7.3.6 - [Bukkit] Allow 1.21 Paper adapter to load on 1.21.1 - Revert "Shutdown the executor service on disable, to prevent waiting on async tasks before shutting down" due to it causing issues in some situations 7.3.5 - [Bukkit] Utilise new Bukkit registry API, allowing WorldEdit to work with Commodore disabled (`paper.disableOldApiSupport` flag on Paper) -- Fix queryRel not behaving correctly in //deform and the deform brush +- Fixed queryRel not behaving correctly in //deform and the deform brush - Shutdown the executor service on disable, to prevent waiting on async tasks before shutting down - Remove legacy code for pre-1.16 //drawsel handling diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 69c0652ba3..ac66e70a42 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -49,7 +49,7 @@ fabric-mixin = "net.fabricmc:sponge-mixin:0.13.3+mixin.0.8.5" paperweight = "io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.7.2" -linBus-bom = "org.enginehub.lin-bus:lin-bus-bom:0.1.0" +linBus-bom = "org.enginehub.lin-bus:lin-bus-bom:0.2.0" linBus-common.module = "org.enginehub.lin-bus:lin-bus-common" linBus-stream.module = "org.enginehub.lin-bus:lin-bus-stream" linBus-tree.module = "org.enginehub.lin-bus:lin-bus-tree" diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java index 8a28f81fca..5ec4350d27 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java @@ -503,7 +503,33 @@ public void handleCommand(CommandEvent event) { // exceptions without writing a hook into every dispatcher, we need to unwrap these // exceptions and rethrow their converted form, if their is one. try { - commandManager.execute(context, ImmutableList.copyOf(split)); + try { + commandManager.execute(context, ImmutableList.copyOf(split)); + } finally { + Optional editSessionOpt = + context.snapshotMemory().injectedValue(Key.of(EditSession.class)); + + if (editSessionOpt.isPresent()) { + EditSession editSession = editSessionOpt.get(); + session.remember(editSession); + editSession.close(); + + if (config.profile) { + long time = System.currentTimeMillis() - start; + double timeS = (time / 1000.0); + int changed = editSession.getBlockChangeCount(); + double throughput = timeS == 0 ? changed : changed / timeS; + actor.printDebug(TranslatableComponent.of( + "worldedit.command.time-elapsed", + TextComponent.of(timeS), + TextComponent.of(changed), + TextComponent.of(Math.round(throughput)) + )); + } + + worldEdit.flushBlockBag(actor, editSession); + } + } } catch (Throwable t) { // Use the exception converter to convert the exception if any of its causes // can be converted, otherwise throw the original exception @@ -540,29 +566,6 @@ public void handleCommand(CommandEvent event) { } catch (Throwable t) { handleUnknownException(actor, t); } finally { - Optional editSessionOpt = - context.snapshotMemory().injectedValue(Key.of(EditSession.class)); - - if (editSessionOpt.isPresent()) { - EditSession editSession = editSessionOpt.get(); - session.remember(editSession); - editSession.close(); - - if (config.profile) { - long time = System.currentTimeMillis() - start; - double timeS = (time / 1000.0); - int changed = editSession.getBlockChangeCount(); - double throughput = timeS == 0 ? changed : changed / timeS; - actor.printDebug(TranslatableComponent.of( - "worldedit.command.time-elapsed", - TextComponent.of(timeS), - TextComponent.of(changed), - TextComponent.of(Math.round(throughput)) - )); - } - - worldEdit.flushBlockBag(actor, editSession); - } Request.reset(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java index 2c64915cae..c2c8173e62 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/BuiltInClipboardFormat.java @@ -26,6 +26,7 @@ import com.sk89q.worldedit.extent.clipboard.io.sponge.SpongeSchematicV3Reader; import com.sk89q.worldedit.extent.clipboard.io.sponge.SpongeSchematicV3Writer; import org.enginehub.linbus.stream.LinBinaryIO; +import org.enginehub.linbus.stream.LinReadOptions; import org.enginehub.linbus.tree.LinCompoundTag; import org.enginehub.linbus.tree.LinIntTag; import org.enginehub.linbus.tree.LinRootEntry; @@ -58,7 +59,8 @@ public String getPrimaryFileExtension() { @Override public ClipboardReader getReader(InputStream inputStream) throws IOException { return new MCEditSchematicReader(LinBinaryIO.read( - new DataInputStream(new GZIPInputStream(inputStream)) + new DataInputStream(new GZIPInputStream(inputStream)), + LEGACY_OPTIONS )); } @@ -72,7 +74,7 @@ public boolean isFormat(InputStream inputStream) { LinRootEntry rootEntry; try { DataInputStream stream = new DataInputStream(new GZIPInputStream(inputStream)); - rootEntry = LinBinaryIO.readUsing(stream, LinRootEntry::readFrom); + rootEntry = LinBinaryIO.readUsing(stream, LEGACY_OPTIONS, LinRootEntry::readFrom); } catch (Exception e) { return false; } @@ -92,7 +94,7 @@ public String getPrimaryFileExtension() { @Override public ClipboardReader getReader(InputStream inputStream) throws IOException { return new SpongeSchematicV1Reader(LinBinaryIO.read( - new DataInputStream(new GZIPInputStream(inputStream)) + new DataInputStream(new GZIPInputStream(inputStream)), LEGACY_OPTIONS )); } @@ -116,7 +118,7 @@ public String getPrimaryFileExtension() { @Override public ClipboardReader getReader(InputStream inputStream) throws IOException { return new SpongeSchematicV2Reader(LinBinaryIO.read( - new DataInputStream(new GZIPInputStream(inputStream)) + new DataInputStream(new GZIPInputStream(inputStream)), LEGACY_OPTIONS )); } @@ -175,7 +177,7 @@ private static boolean detectOldSpongeSchematic(InputStream inputStream, int ver LinRootEntry rootEntry; try { DataInputStream stream = new DataInputStream(new GZIPInputStream(inputStream)); - rootEntry = LinBinaryIO.readUsing(stream, LinRootEntry::readFrom); + rootEntry = LinBinaryIO.readUsing(stream, LEGACY_OPTIONS, LinRootEntry::readFrom); } catch (Exception e) { return false; } @@ -200,6 +202,8 @@ private static boolean detectOldSpongeSchematic(InputStream inputStream, int ver @Deprecated public static final BuiltInClipboardFormat SPONGE_SCHEMATIC = SPONGE_V2_SCHEMATIC; + private static final LinReadOptions LEGACY_OPTIONS = LinReadOptions.builder().allowNormalUtf8Encoding(true).build(); + private final ImmutableSet aliases; BuiltInClipboardFormat(String... aliases) { diff --git a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java index f305306db9..ed15b87888 100644 --- a/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java +++ b/worldedit-sponge/src/main/java/com/sk89q/worldedit/sponge/SpongeWorld.java @@ -414,6 +414,16 @@ public int hashCode() { return getWorld().hashCode(); } + @Override + public int getMaxY() { + return getWorld().max().y(); + } + + @Override + public int getMinY() { + return getWorld().min().y(); + } + @Override public boolean equals(Object o) { if (o == null) {