Undo of schematics does not work
PapiCapi opened this issue ยท 7 comments
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
- I have included a Fawe debugpaste.
- I am using the newest build from https://ci.athion.net/job/FastAsyncWorldEdit/ and the issue still persists.
Anything else?
I think i don't use properly the methods but really can't find a way to make it work
Are you attempting to undo multiple schematics that were pasted at the same location/overlapping?
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
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.
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);
}