IntellectualSites / FastAsyncWorldEdit

Blazingly fast world manipulation for artists, builders and everyone else: https://www.spigotmc.org/resources/13932/
Other
604 stars 214 forks source link

Server Crashes when Copying #1640

Closed Kihsomray closed 2 years ago

Kihsomray commented 2 years ago

Server Implementation

Paper

Server Version

1.18.1

Describe the bug

I'm working on a new feature in my plugin where regions (WG, GriefPrevention, Residence) are copied to a hashmap of clipboards before a world is reset. Once the world has been reset, all the regions are pasted back into their original spots.

When I run this operation, the console is spammed with a ton of bugs.

To Reproduce

  1. Install CWR Premium and WG/Residence/Grief Prevention.
  2. Enable the saving for regions in worlds.yml.
  3. Run /cwr regen

Expected behaviour

This operation works fine with the regular WorldEdit:

  1. Copy a bunch of regions
  2. Paste them after the world resets

Screenshots / Videos

No response

Error log (if applicable)

https://gist.github.com/Kihsomray/8d96916ff5c09668e641b4c24464012b

Fawe Debugpaste

https://athion.net/ISPaster/paste/view/328dd06b824145a8a47b78f46ee84f0f

Fawe Version

FastAsyncWorldEdit version 2.0.2-SNAPSHOT-111;a237856

Checklist

Anything else?

No response

dordsor21 commented 2 years ago

Without seeing the code I can only surmise that you are doing something; wrong most likely improperly defining the region of the clipboard and attempting to set blocks outside of the initial region. It also seems like you are not running the copying asynchronously, so are simply stalling the main thread with a large number of operations

Kihsomray commented 2 years ago

Without seeing the code I can only surmise that you are doing something; wrong most likely improperly defining the region of the clipboard and attempting to set blocks outside of the initial region. It also seems like you are not running the copying asynchronously, so are simply stalling the main thread with a large number of operations

Class it's being run from: https://paste.gg/p/anonymous/c825bdbece21424e945048d716516f33 For testing purposes, I have set the delay in the runnable to be 5 seconds which should be plenty of time to copy the regions I'm testing async before I unload the world.

WorldGuard Class: https://paste.gg/p/anonymous/c8a6b7e5c9dc4715819bd1b46cf10581 My FAWE Class: https://paste.gg/p/anonymous/ac51a33c7d63490ab7f58ad46db6347d World Edit Class: https://paste.gg/p/anonymous/b35ca31c15cf47f3be8d15b905891366

dordsor21 commented 2 years ago

Try using by instead of 0 in the creation of ForwardExtentCopy in WorldEdit.class ?

Kihsomray commented 2 years ago

Try using by instead of 0 in the creation of ForwardExtentCopy in WorldEdit.class ?

That worked! However, the reference point of the paste is so off. I used minimum point when copying and pasting. Why does it paste in the sky?

Updated WorldEdit Class: https://paste.gg/p/anonymous/4d096d2c9efd46959b170375bacc4786 floating_chunk PNG

dordsor21 commented 2 years ago

Are you pasting it at the bottom of the region and not at y=0? The origin of the clipboard defaults to the minimum point. If you want to paste normalised to zero, then set the clipboard's origin to bx, 0, bz