WorldEdit for Bukkit

WorldEdit for Bukkit

21M Downloads

Schematic creation results in NPE if MyPet entity exists in region

bloodmc opened this issue ยท 1 comments

commented

WorldEdit Version

7.2.5+57d5ac9

Platform Version

git-Paper-629 (MC: 1.16.5)

Bug Description

Creating a schematic that copies entities with result in NPE if using MyPet's plugin with MyPet entity in region.

[18:45:39 INFO]: Player issued server command: //copy -e
[18:45:45 INFO]: Player issued server command: //schematic save test
[18:45:45 ERROR]: Uncaught exception occurred in task: Saving schematic test
java.lang.NullPointerException: null
        at com.sk89q.worldedit.extent.clipboard.io.SpongeSchematicWriter.lambda$writeEntities$2(SpongeSchematicWriter.java:257) ~[?:?]
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[?:1.8.0_251]
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) ~[?:1.8.0_251]
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_251]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:1.8.0_251]
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source) ~[?:1.8.0_251]
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_251]
        at java.util.stream.ReferencePipeline.collect(Unknown Source) ~[?:1.8.0_251]
        at com.sk89q.worldedit.extent.clipboard.io.SpongeSchematicWriter.writeEntities(SpongeSchematicWriter.java:263) ~[?:?]
        at com.sk89q.worldedit.extent.clipboard.io.SpongeSchematicWriter.write2(SpongeSchematicWriter.java:195) ~[?:?]
        at com.sk89q.worldedit.extent.clipboard.io.SpongeSchematicWriter.write(SpongeSchematicWriter.java:79) ~[?:?]
        at com.sk89q.worldedit.command.SchematicCommands$SchematicSaveTask.call(SchematicCommands.java:364) ~[?:?]
        at com.sk89q.worldedit.command.SchematicCommands$SchematicSaveTask.call(SchematicCommands.java:329) ~[?:?]
        at com.sk89q.worldedit.command.util.AsyncCommandBuilder.runTask(AsyncCommandBuilder.java:158) ~[?:?]
        at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:111) ~[patched_1.16.5.jar:git-Paper-681]
        at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:58) ~[patched_1.16.5.jar:git-Paper-681]
        at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:75) ~[patched_1.16.5.jar:git-Paper-681]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:1.8.0_251]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:1.8.0_251]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]

Expected Behavior

WorldEdit should ignore custom entities it is not able to detect.

Reproduction Steps

  1. Install MyPet's plugin https://www.spigotmc.org/resources/mypet.12725/
  2. Execute command /mypetadmin create <playername> Cow
  3. Equip worldedit wand and select 2 points with MyPet cow inside region.
  4. Execute command //copy -e
  5. Execute command //schematic save test
    Error should occur.

Anything Else?

I haven't tested other plugins that have custom entities but the same problem may exist as well.

commented

This issue has been automatically marked as stale because it has not been fully confirmed. It will be closed if no further activity occurs. Thank you for your contributions.