[API] UnsupportedOperationException when pasting with fast mode
Eredrim opened this issue ยท 0 comments
Versions
WorldEdit version: 7.2.0-Snapshot build 5017
Platform version: Paper MC 1.15.2 build 333
Describe the bug
When I paste a schematic with API using both FAST reorder mode and fast mode, pasting works but I get the following exception during session flush:
[21:06:44 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'pa' in plugin pvparena v1.15.0-SNAPSHOT
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.15.2.jar:git-Paper-333]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.15.2.jar:git-Paper-333]
at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchCommand(CraftServer.java:761) ~[patched_1.15.2.jar:git-Paper-333]
at net.minecraft.server.v1_15_R1.PlayerConnection.handleCommand(PlayerConnection.java:1860) ~[patched_1.15.2.jar:git-Paper-333]
at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:1668) ~[patched_1.15.2.jar:git-Paper-333]
at net.minecraft.server.v1_15_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[patched_1.15.2.jar:git-Paper-333]
at net.minecraft.server.v1_15_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.15.2.jar:git-Paper-333] at net.minecraft.server.v1_15_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23) ~[patched_1.15.2.jar:git-Paper-333]
at net.minecraft.server.v1_15_R1.TickTask.run(SourceFile:18) ~[patched_1.15.2.jar:git-Paper-333]
at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.15.2.jar:git-Paper-333]
at net.minecraft.server.v1_15_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.15.2.jar:git-Paper-333]
at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.15.2.jar:git-Paper-333]
at net.minecraft.server.v1_15_R1.MinecraftServer.ba(MinecraftServer.java:1097) ~[patched_1.15.2.jar:git-Paper-333]
at net.minecraft.server.v1_15_R1.MinecraftServer.executeNext(MinecraftServer.java:1090) ~[patched_1.15.2.jar:git-Paper-333]
at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.15.2.jar:git-Paper-333]
at net.minecraft.server.v1_15_R1.MinecraftServer.sleepForTick(MinecraftServer.java:1051) ~[patched_1.15.2.jar:git-Paper-333]
at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:966) ~[patched_1.15.2.jar:git-Paper-333]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
Caused by: java.lang.UnsupportedOperationException
at com.google.common.collect.UnmodifiableIterator.remove(UnmodifiableIterator.java:46) ~[patched_1.15.2.jar:git-Paper-333]
at com.sk89q.worldedit.extent.world.SideEffectExtent$1.resume(SideEffectExtent.java:113) ~[?:?]
at com.sk89q.worldedit.function.operation.OperationQueue.resume(OperationQueue.java:92) ~[?:?]
at com.sk89q.worldedit.function.operation.Operations.completeBlindly(Operations.java:74) ~[?:?]
at com.sk89q.worldedit.EditSession.flushSession(EditSession.java:831) ~[?:?]
at net.slipcor.pvparena.modules.worldedit.PAWE.load(PAWE.java:293) ~[?:?]
at net.slipcor.pvparena.modules.worldedit.PAWE.load(PAWE.java:254) ~[?:?]
at net.slipcor.pvparena.modules.worldedit.PAWE.commitCommand(PAWE.java:115) ~[?:?]
at net.slipcor.pvparena.classes.PACheck.handleCommand(PACheck.java:146) ~[?:?]
at net.slipcor.pvparena.PVPArena.onCommand(PVPArena.java:371) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.15.2.jar:git-Paper-333]
... 17 more
To Reproduce
Here is the code I used to paste the schematic. All works perfectly with WorldEdit 7.1.0
try (ClipboardReader reader = format.getReader(new FileInputStream(loadFile))) {
Clipboard clipboard = reader.read();
ClipboardHolder holder = new ClipboardHolder(clipboard);
BukkitWorld bukkitWorld = new BukkitWorld(ars.getWorld());
final EditSession editSession = worldEdit.getEditSessionFactory().getEditSession(bukkitWorld, size);
editSession.setReorderMode(EditSession.ReorderMode.FAST);
editSession.setFastMode(true);
BlockVector3 to = BlockVector3.at(loc.getX(), loc.getY(), loc.getZ());
Operation operation=holder.createPaste(editSession)
.to(to)
.ignoreAirBlocks(false)
.build();
Operations.completeLegacy(operation);
editSession.flushSession();
}
Expected behavior
Normal pasting
Screenshots
N/A
Additional context
N/A