Not working with FAWE
Malfrador opened this issue ยท 4 comments
When using FastAsyncWorldEdit, Cannons completely breaks when loading cannon designs. I don't think this is an important bug (as the plugin site explicitly states that WorldEdit is required, not FAWE), but it still would be nice to be able to use FAWE with Cannons.
It did work fine in 1.13, so it could work in 1.16 too.
Log error:
[01:58:11] [Server thread/INFO]: [Cannons] Loading cannon designs
[01:58:11] [Server thread/WARN]: java.lang.IndexOutOfBoundsException
[01:58:11] [Server thread/WARN]: at java.nio.Buffer.checkIndex(Buffer.java:546)
[01:58:11] [Server thread/WARN]: at java.nio.DirectByteBuffer.putChar(DirectByteBuffer.java:533)
[01:58:11] [Server thread/WARN]: at com.boydti.fawe.object.clipboard.DiskOptimizedClipboard.setBlock(DiskOptimizedClipboard.java:410)
[01:58:11] [Server thread/WARN]: at com.sk89q.worldedit.extent.OutputExtent.setBlock(OutputExtent.java:61)
[01:58:11] [Server thread/WARN]: at com.boydti.fawe.object.extent.BlockTranslateExtent.setBlock(BlockTranslateExtent.java:31)
[01:58:11] [Server thread/WARN]: at com.boydti.fawe.object.function.block.SimpleBlockCopy.apply(SimpleBlockCopy.java:20)
[01:58:11] [Server thread/WARN]: at com.sk89q.worldedit.function.visitor.RegionVisitor.resume(RegionVisitor.java:66)
[01:58:11] [Server thread/WARN]: at com.sk89q.worldedit.function.operation.Operations.completeBlindly(Operations.java:76)
[01:58:11] [Server thread/WARN]: at com.sk89q.worldedit.function.operation.ForwardExtentCopy.resume(ForwardExtentCopy.java:396)
[01:58:11] [Server thread/WARN]: at com.sk89q.worldedit.function.operation.Operations.complete(Operations.java:43)
[01:58:11] [Server thread/WARN]: at at.pavlov.cannons.cannon.DesignStorage.loadDesignSchematic(DesignStorage.java:396)
[01:58:11] [Server thread/WARN]: at at.pavlov.cannons.cannon.DesignStorage.loadCannonDesigns(DesignStorage.java:103)
[01:58:11] [Server thread/WARN]: at at.pavlov.cannons.config.Config.loadConfig(Config.java:183)
[01:58:11] [Server thread/WARN]: at at.pavlov.cannons.Cannons.onEnable(Cannons.java:155)
Continues like this for several thousand lines. Plugin enables succesfully though, but does not work. When pasting a cannon using /cannon create, the cannon is split and mirrored in the middle.
Newest Cannons & FAWE-Version,Paper 1.16.4 #288
Happens the same to me.
Fawe latest build #391
cannonsfawe.log
The error appears to be on the FAWE side since it is working fine with Worldedit.
Did somebody create a ticket at FAWE?
With FAWE 1.17-391 I get the same error as Conall:
[19:42:30 WARN]: java.lang.IndexOutOfBoundsException
[19:42:30 WARN]: at java.base/java.nio.Buffer.checkIndex(Buffer.java:748)
[19:42:30 WARN]: at java.base/java.nio.DirectByteBuffer.putChar(DirectByteBuffer.java:658)
[19:42:30 WARN]: at com.fastasyncworldedit.core.extent.clipboard.DiskOptimizedClipboard.setBlock(DiskOptimizedClipboard.java:449)
[19:42:30 WARN]: at com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard.setBlock(BlockArrayClipboard.java:220)
[19:42:30 WARN]: at com.fastasyncworldedit.core.extent.BlockTranslateExtent.setBlock(BlockTranslateExtent.java:32)
[19:42:30 WARN]: at com.sk89q.worldedit.extent.AbstractDelegateExtent.setBlock(AbstractDelegateExtent.java:340)
[19:42:30 WARN]: at com.fastasyncworldedit.core.extent.PositionTransformExtent.setBlock(PositionTransformExtent.java:90)
[19:42:30 WARN]: at com.fastasyncworldedit.core.function.block.SimpleBlockCopy.apply(SimpleBlockCopy.java:20)
[19:42:30 WARN]: at com.sk89q.worldedit.function.visitor.RegionVisitor.apply(RegionVisitor.java:172)
[19:42:30 WARN]: at com.sk89q.worldedit.function.visitor.RegionVisitor.resume(RegionVisitor.java:163)
[19:42:30 WARN]: at com.sk89q.worldedit.function.operation.Operations.completeBlindly(Operations.java:74)
[19:42:30 WARN]: at com.sk89q.worldedit.function.operation.ForwardExtentCopy.resume(ForwardExtentCopy.java:421)
[19:42:30 WARN]: at com.sk89q.worldedit.function.operation.Operations.complete(Operations.java:41)
[19:42:30 WARN]: at at.pavlov.cannons.cannon.DesignStorage.loadDesignSchematic(DesignStorage.java:399)
[19:42:30 WARN]: at at.pavlov.cannons.cannon.DesignStorage.loadCannonDesigns(DesignStorage.java:101)
[19:42:30 WARN]: at at.pavlov.cannons.config.Config.loadConfig(Config.java:204)
[19:42:30 WARN]: at at.pavlov.cannons.Cannons.onEnable(Cannons.java:155)
[19:42:30 WARN]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264)
[19:42:30 WARN]: at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342)
[19:42:30 WARN]: at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480)
[19:42:30 WARN]: at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:511)
[19:42:30 WARN]: at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:425)
[19:42:30 WARN]: at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:619)
[19:42:30 WARN]: at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:266)
[19:42:30 WARN]: at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1010)
[19:42:30 WARN]: at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:305)
[19:42:30 WARN]: at java.base/java.lang.Thread.run(Thread.java:831)
This is the corresponding position in the code:
https://github.com/IntellectualSites/FastAsyncWorldEdit/blob/4272f96aded08a1c0c5b784521aefc58ee5ab29d/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskOptimizedClipboard.java#L449
The IndexOutOfBoundsException indicates a problem with the buffer limit or negative number
IndexOutOfBoundsException - If index is negative or not smaller than the buffer's limit, minus one
https://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer.html