SBPrime / AsyncWorldEdit-Premium

Async WorldEdit - Edit millions of blocks without lag! (Premium version)
Other
19 stars 4 forks source link

Lag while loading schematic per plugin #212

Closed FREE2WIN2 closed 4 years ago

FREE2WIN2 commented 4 years ago
Clipboard clipboard = createClipboard(auswahl);
IAweEditSession editSession = (IAweEditSession)WorldEdit
                                               .getInstance()
                                               .getEditSessionFactory()
                                               .getEditSession(BukkitAdapter.adapt(p.getWorld()), -1);
//editSession.enableStandardMode();
editSession.enableQueue();
editSession.setFastMode(false);
Operation operation = new ClipboardHolder(clipboard)
                                    .createPaste(editSession)
                                    .to(BlockVector3.at(x, y, z))
                    .ignoreAirBlocks(true)
                                    .build();
Operations.complete(operation);
editSession.flushSession();

with this code the server laggs a little bit while loading an schematic(no matter what size)

Can you help me? I have nothing changed in the config.

SBPrime commented 4 years ago

Do you intend to run it in async mode or not? You should also consider seting awe to debug mode and see what it shows on the console.

Besides this is not schematic loading this is pasting.

FREE2WIN2 commented 4 years ago

sorry, I forgot the code for loading:)

Main main = Main.getPlugin();
String path = main.getCustomConfig().getString("Config.path");
File pathFile = new File(path);
path = pathFile.getParentFile().getAbsolutePath();
File dir = new File(path+"/schematics/TestBlockSklave");
File schem = new File(dir.getAbsolutePath() + "/" + filename + ".schem");
ClipboardFormat format = ClipboardFormats.findByFile(schem);
try {
Clipboard clipboard = reader.read();
return clipboard;
} catch (FileNotFoundException e) {

e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;

I intend to run everything in async mode.

FREE2WIN2 commented 4 years ago

And something more: pasting per plugin ist relative fast, but as player it is very slow...

Do you have any idea why?

SBPrime commented 4 years ago

To test this you should enable debug mode in AWE and check what do you get in the log. Is this the full code? Do you use the BlocksPlacer perform as async job?

FREE2WIN2 commented 4 years ago

Yes this is the full code.. And I dont use the BlockPlacer

SBPrime commented 4 years ago

You still did not provide the log.

SBPrime commented 4 years ago

No response, closing.