SBPrime / AsyncWorldEdit

Async WorldEdit - Edit millions of blocks without lag!
Other
195 stars 79 forks source link

ForwardExtensCopy with AWE doesnt work (DEADLOCK) #401

Open copyandexecute opened 3 years ago

copyandexecute commented 3 years ago

Hi this code works perfectly fine with WE and FAWE but not with AWE

(server freezes)

     Bukkit.getLogger().info("COPYING MAP");
        CuboidRegion region = new CuboidRegion(BukkitAdapter.adapt(this.world),
                BukkitAdapter.asBlockVector(new Location(this.world, this.size, 0, this.size)),
                BukkitAdapter.asBlockVector(new Location(this.world, -this.size, world.getMaxHeight(), -this.size)));

        BlockArrayClipboard blockArrayClipboard = new BlockArrayClipboard(region);
        blockArrayClipboard.setOrigin(BukkitAdapter.asBlockVector(this.center));

        IAsyncWorldEdit awe = (IAsyncWorldEdit) Bukkit.getPluginManager().getPlugin("AsyncWorldEdit");
        Bukkit.getLogger().info("AWE");
        if (awe != null) {
            try {
                IPlayerEntry player = awe.getPlayerManager().getConsolePlayer();
                IThreadSafeEditSession tsSession = ((IAsyncEditSessionFactory) WorldEdit.getInstance().getEditSessionFactory()).getThreadSafeEditSession(new BukkitWorld(world), -1, null, player);
                tsSession.setFastMode(true);
                tsSession.resetAsync();
                ForwardExtentCopy forwardExtentCopy = new ForwardExtentCopy(tsSession, region, blockArrayClipboard, region.getMinimumPoint());
                forwardExtentCopy.setCopyingEntities(true);
                Bukkit.getLogger().info("Trying to copy map");
                Operations.complete(forwardExtentCopy);
            } catch (WorldEditException e) {
                e.printStackTrace();
            }
            Bukkit.getLogger().info("Done copying map");

server: latest-tunity 1.16.5 awe: AsyncWorldEdit-3.9.1 worldedit: 7.2.5

copyandexecute commented 3 years ago

bump

SBPrime commented 3 years ago

Any logs? perhaps logs with debug mode?

copyandexecute commented 3 years ago

I can do but just use this code