FastAsyncWorldEdit

FastAsyncWorldEdit

152k Downloads

Undo of schematics does not work

PapiCapi opened this issue ยท 7 comments

commented

Server Implementation

Paper

Server Version

1.18.2

Describe the bug

When i try to undo a schematic paste using the API, nothing happens.

To Reproduce

Here is the paste code :
https://paste.gg/p/anonymous/a3815b453aed4355aded97cb6993d85a

Here is the undo code :
https://paste.gg/p/anonymous/3ca034ceffc749c0b3f9f1cf9e1ad430

Expected behaviour

Undo the paste

Screenshots / Videos

No response

Error log (if applicable)

No response

Fawe Debugpaste

https://athion.net/ISPaster/paste/view/7413bf1985ad4324b884bbb958ecdc85

Fawe Version

FAWE 2.3.1-SNAPSHOT-225

Checklist

Anything else?

I think i don't use properly the methods but really can't find a way to make it work

commented

Are you attempting to undo multiple schematics that were pasted at the same location/overlapping?

commented

Well, no. Here is a record of what's happening. With the delete command, the method UndoMultipleSchematic is called for only 1.
image

https://youtu.be/U4UKz4I0DZM

commented

Ah, I missed that you've got the editsessions in EditSessions#undo the wrong way round. You'll also want to do each undo asynchronously, and could use a task that re-schedules itself whilst an iterator over the editsessions is not empty

commented

I'm sorry but i don't really understand how i am supposed to undo with my new EditSession.
I just set the BukkitRunnable to run async and it did not changed anything : my schematic is still here.
image

For the iterator, yeah, you're right, i'll take a look at it when my undo method will work !

commented

You have the editsessions the wrong way round. You're attempting to undo the new editsession using the old one. The javadoc notes for the method explain this.

commented

Oh okay ! I really didn't understood it like that.
If someone is confused as i was, i had to simply switch my editsessions and do :

try (EditSession editSession = WorldEdit.getInstance().newEditSession(current.getWorld())) {
    current.undo(editSession);
}
commented

Are you attempting to undo multiple schematics that were pasted at the same location/overlapping?

How to undo multiple schematics that were pasted at the same location/overlapping?