FAWE potentially writing to ChunkSection PalettedContainer whilst data is read for packet sending
WyndevCodes opened this issue ยท 5 comments
Server Implementation
Paper
Server Version
1.20
Describe the bug
I run a dungeon server that generates dungeons and then teleports players into those dungeons. The players are teleported from the spawn world into the dungeon world after the schematics are loaded.
The issue is that I get an error almost every time a dungeon is generated (see the stack trace below). It doesn't seem to do anything normally, but it may result rarely in parts of the dungeon not being pasted properly.
Here is the code I use to paste the schematics (this runs about 16 times in 1-5 ticks on an async thread):
public boolean pasteSchematic(String schematicName, Location loc, Main main) {
World weWorld = FaweAPI.getWorld(loc.getWorld().getName());
File file = new File(main.getDataFolder() + File.separator + "schematics" + File.separator + schematicName + ".schem");
if (!file.exists()) {
Bukkit.getLogger().warning("The dungeon room file " + schematicName + ".schem does not exist in the DungeonDodge schematics folder!");
return false;
}
//Bukkit.getLogger().info("[Dungeon Generation] Dungeon room instance has schematic " + schematicName + ".schem");
BlockVector3 vec = BlockVector3.at(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
try {
ClipboardFormat clipboardFormat = ClipboardFormats.findByFile(file);
if (clipboardFormat != null) {
Clipboard clipboard = clipboardFormat.load(file);
EditSession editSession = clipboard.paste(weWorld, vec);
clipboard.close();
editSession.close();
}
} catch (IOException e) {
Bukkit.getLogger().severe("Schematic " + schematicName + ".schem was not pasted properly!");
e.printStackTrace();
}
return true;
}
To Reproduce
- Create a piece of code that pastes schematics in a sequential form inside of a minecraft world different from the one a player resides in (e.g. paste a hollow square 16 times, adding the square's length to the z-axis each time). This code should be run async and via a command.
- Teleport the player inside of the first square pasted.
- Check console for any errors.
Expected behaviour
There should be no error when sending pasted chunk packets to players.
Screenshots / Videos
No response
Error log (if applicable)
https://paste.gg/p/anonymous/9edac91f450e4000b82844d086674fa4
Fawe Debugpaste
https://athion.net/ISPaster/paste/view/00996f5b6b484f6484fd3ab4a9542fba
Fawe Version
FastAsyncWorldEdit-638
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 am not using the newest version but had this issue before the recent update. I looked through the patch notes on the recent update and saw no fix for this issue there.
Note that the server version is 1.20.2 and I cannot upgrade/downgrade due to plugin and world restrictions. In the case that it is found that this is a minecraft chunk loading issue, I will close this thread.
More information including the potential cause as identified by the paper team over at #2652
Looking into this a bit, I believe it could be caused by how we write biomes directly to the palette container, rather than making a copy and directly replacing it like with blocks
I'm not sure if the fix has been implemented yet but I recently got this crash again using build 850: https://pastebin.com/easELqEA