From f5f9ae6a85dc9b3e075ee4dcc4606751c24cc9b6 Mon Sep 17 00:00:00 2001 From: Pierre Maurice Schwang Date: Thu, 29 Aug 2024 07:18:11 +0200 Subject: [PATCH] Fix: Copy-Paste-Brush with falsy mask (#2899) * fix: don't attempt to load all possible world chunks when copy pasta brush empty clipboard * chore: move check into ResizableClipboardBuilder --- .../core/extent/clipboard/ResizableClipboardBuilder.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/ResizableClipboardBuilder.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/ResizableClipboardBuilder.java index 05089a111..4efa4f456 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/ResizableClipboardBuilder.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/ResizableClipboardBuilder.java @@ -58,6 +58,9 @@ public class ResizableClipboardBuilder extends MemoryOptimizedHistory { } public Clipboard build() { + if (longSize() == 0) { + return EmptyClipboard.getInstance(); + } BlockVector3 pos1 = BlockVector3.at(minX, minY, minZ); BlockVector3 pos2 = BlockVector3.at(maxX, maxY, maxZ); CuboidRegion region = new CuboidRegion(pos1, pos2);