IntellectualSites / IntellectualSites/FastAsyncWorldEdit
FAWE potentially writing to ChunkSection PalettedContainer whilst data is read for packet sending
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 806
- Forks
- 394
- Avg merge
- 22h 19m
- Merged PRs (30d)
- 14
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files or tests are named. Start by reviewing the linked error log and FAWE debugpaste, then reproduce the async schematic pasting while a player receives chunk packets; done means the console error no longer occurs and pasted dungeon sections are complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100