    @Override
    public void onEnable() {
        log("===================================================================================");
        log("=     ___                         _       __           __    ________    ___ __   =");
        log("=    /   |  _______  ______  ____| |     / /___  _____/ /___/ / ____/___/ (_) /_  =");
        log("=   / /| | / ___/ / / / __ \\/ ___/ | /| / / __ \\/ ___/ / __  / __/ / __  / / __/  =");
        log("=  / ___ |(__  ) /_/ / / / / /__ | |/ |/ / /_/ / /  / / /_/ / /___/ /_/ / / /_    =");
        log("= /_/  |_/____/\\__, /_/ /_/\\___/ |__/|__/\\____/_/  /_/\\__,_/_____/\\__,_/_/\\__/    =");
        log("=             /____/                                                              =");
        log("= Author: SBPrime                                                                 =");
        log("=                                                                                =");
        log("===================================================================================");

        m_isInitialized = false;
        m_platform.onEnable();

        if (!ConfigProvider.load(this)) {
            log("Error loading config");
            return;
        }

        initialiseStrings();

        m_progressDisplay = new ProgressDisplayManager();

        m_dispatcher = new TaskDispatcher(this);
        m_blockPlacer = new BlockPlacer(this);
        m_cron = new Cron(this);

        m_changesetSerializer = new SerializerManager(this);

        m_nativeAdapter = AdapterProvider.get(m_platform);
        if (m_nativeAdapter != null) {

            if (m_nativeAdapter instanceof IInitializableAdapter) {
                ((IInitializableAdapter) m_nativeAdapter).initialize(m_dispatcher, m_blocksHubBridge);
            }
        }
        m_directChunkCommands = null;

        setPlotMeFix(new NullFix());

        if (m_aweInjector == null) {
            log("Unable to get instance of AsyncWorldEdit Injector. AsyncWorldEdit disabled.");
            return;
        }

        if (ConfigProvider.getCheckUpdate()) {
            new Thread(() -> {
                log(VersionChecker.checkVersion(m_platform.getVersion()).getMessage());
            }).start();
        }

        if (!ConfigProvider.isConfigUpdated()) {
            log("Please update your config file!");
        }

        m_platform.getChunkWatcher().setTaskDispat(m_dispatcher);

        IInnerDirectChunkAPI dcApi = getInnerDirectChunkAPI();
        IBlockRelighter bRelighter = dcApi != null ? dcApi.getBlockRelighter() : null;
        if (bRelighter != null) {
            bRelighter.initialize(m_platform);
        }

        m_isInitialized = true;

        initializeConfig();

        m_platform.getPlayerProvider().initialize(m_playerManager);
    }

    @Override
    public void onEnable() {
        log("===================================================================================");
        log("=     ___                         _       __           __    ________    ___ __   =");
        log("=    /   |  _______  ______  ____| |     / /___  _____/ /___/ / ____/___/ (_) /_  =");
        log("=   / /| | / ___/ / / / __ \\/ ___/ | /| / / __ \\/ ___/ / __  / __/ / __  / / __/  =");
        log("=  / ___ |(__  ) /_/ / / / / /__ | |/ |/ / /_/ / /  / / /_/ / /___/ /_/ / / /_    =");
        log("= /_/  |_/____/\\__, /_/ /_/\\___/ |__/|__/\\____/_/  /_/\\__,_/_____/\\__,_/_/\\__/    =");
        log("=             /____/                                                              =");
        log("= Author: SBPrime                                                                 =");
        log("=                                                                                =");
        log("===================================================================================");

        m_isInitialized = false;
        m_platform.onEnable();

        if (!ConfigProvider.load(this)) {
            log("Error loading config");
            return;
        }

        initialiseStrings();

        m_progressDisplay = new ProgressDisplayManager();

        m_dispatcher = new TaskDispatcher(this);
        m_blockPlacer = new BlockPlacer(this);
        m_cron = new Cron(this);

        m_changesetSerializer = new SerializerManager(this);

        m_nativeAdapter = AdapterProvider.get(m_platform);
        if (m_nativeAdapter != null) {

            if (m_nativeAdapter instanceof IInitializableAdapter) {
                ((IInitializableAdapter) m_nativeAdapter).initialize(m_dispatcher, m_blocksHubBridge);
            }
        }
        m_directChunkCommands = null;

        setPlotMeFix(new NullFix());

        if (m_aweInjector == null) {
            log("Unable to get instance of AsyncWorldEdit Injector. AsyncWorldEdit disabled.");
            return;
        }

        if (ConfigProvider.getCheckUpdate()) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    log(VersionChecker.checkVersion(m_platform.getVersion()).getMessage());

                }
            }).start();
        }

        if (!ConfigProvider.isConfigUpdated()) {
            log("Please update your config file!");
        }

        m_platform.getChunkWatcher().setTaskDispat(m_dispatcher);

        IInnerDirectChunkAPI dcApi = getInnerDirectChunkAPI();
        IBlockRelighter bRelighter = dcApi != null ? dcApi.getBlockRelighter() : null;
        if (bRelighter != null) {
            bRelighter.initialize(m_platform);
        }

        m_isInitialized = true;

        initializeConfig();

        m_platform.getPlayerProvider().initialize(m_playerManager);
    }

Replace Anonymous With Lambda org.primesoft.asyncworldedit.core.AsyncWorldEditCore.onEnable.start.new Thread.new Runnable with () -> {log(VersionChecker.checkVersion(m_platform.getVersion()).getMessage()); in method public onEnable() : void from class org.primesoft.asyncworldedit.core.AsyncWorldEditCore


    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        synchronized (m_mtaMutex) {
            if (!isInitialized) {
                return;
            }
        }

        final Player player = event.getPlayer();
        if (player == null) {
            return;
        }

        final IPlayerEntry entry = m_playerManager.addPlayer(new BukkitPlayerEntry(player));

        if (!entry.isAllowed(Permission.ANNOUNCE_VERSION)) {
            return;
        }

        new Thread(() -> {
            if (ConfigProvider.getCheckUpdate()) {
                PluginDescriptionFile desc = m_plugin.getDescription();
                VersionCheckResult result = VersionChecker.checkVersion(desc.getVersion());

                if (!result.getType().equals(VersionCheckResult.Type.Latest)) {
                    entry.say(MessageType.CHECK_VERSION_FORMAT.format(LoggerProvider.PREFIX, result.getMessage()));
                }
            }
        }).start();
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        synchronized (m_mtaMutex) {
            if (!isInitialized) {
                return;
            }
        }

        final Player player = event.getPlayer();
        if (player == null) {
            return;
        }

        final IPlayerEntry entry = m_playerManager.addPlayer(new BukkitPlayerEntry(player));

        if (!entry.isAllowed(Permission.ANNOUNCE_VERSION)) {
            return;
        }

        new Thread(new Runnable() {
            @Override
            public void run() {
                if (ConfigProvider.getCheckUpdate()) {
                    PluginDescriptionFile desc = m_plugin.getDescription();
                    VersionCheckResult result = VersionChecker.checkVersion(desc.getVersion());

                    if (!result.getType().equals(VersionCheckResult.Type.Latest)) {
                        entry.say(MessageType.CHECK_VERSION_FORMAT.format(LoggerProvider.PREFIX, result.getMessage()));
                    }
                }
            }
        }).start();
    }

Replace Anonymous With Lambda org.primesoft.asyncworldedit.platform.bukkit.BukkitPlayerProvider.onPlayerJoin.start.new Thread.new Runnable with () -> {if(ConfigProvider.getCheckUpdate()){PluginDescriptionFile desc=m_plugin.getDescription(); in method public onPlayerJoin(event PlayerJoinEvent) : void from class org.primesoft.asyncworldedit.platform.bukkit.BukkitPlayerProvider


    /**
     * Queue secure get operation
     *
     * @param <T>
     * @param action
     * @return
     */
    @Override
    public <T> T queueFastOperation(IFunc<T> action) {
        if (action == null) {
            return null;
        }

        FuncEntry<T> getBlock = new FuncEntry<>(action);
        if (isMainTask()) {
            return action.execute();
        }

        final Object mutex = getBlock.getMutex();

        addFastTask(getBlock);
        synchronized (mutex) {
            while (getBlock.getResult() == null) {
                try {
                    mutex.wait();
                } catch (InterruptedException ex) {
                }
            }
        }
        return getBlock.getResult();
    }

    /**
     * Queue secure get operation
     *
     * @param <T>
     * @param action
     * @return
     */
    @Override
    public <T> T queueFastOperation(IFunc<T> action) {
        if (action == null) {
            return null;
        }

        FuncEntry<T> getBlock = new FuncEntry<T>(action);
        if (isMainTask()) {
            return action.execute();
        }

        final Object mutex = getBlock.getMutex();

        addFastTask(getBlock);
        synchronized (mutex) {
            while (getBlock.getResult() == null) {
                try {
                    mutex.wait();
                } catch (InterruptedException ex) {
                }
            }
        }
        return getBlock.getResult();
    }

Replace Generic With Diamond FuncEntry<T> with FuncEntry<> in method public queueFastOperation(action IFunc<T>) : T from class org.primesoft.asyncworldedit.taskdispatcher.TaskDispatcher


    /**
     * Run task asynchronously one after another
     *
     * @param scheduler the scheduler
     * @param task the task to be run
     * @param sequenceKey
     * @throws IllegalArgumentException if plugin is null
     * @throws IllegalArgumentException if task is null
     * @throws IllegalArgumentException if scheduler is null
     */
    public static void runTaskAsynchronouslyInSequence(IScheduler scheduler,
            final BukkitRunnable task, final Object sequenceKey) {
        if (sequenceKey == null) {
            runTaskAsynchronously(scheduler, task);
            return;
        }

        if (scheduler == null) {
            throw new IllegalArgumentException("scheduler");
        }
        if (task == null) {
            throw new IllegalArgumentException("task");
        }

        synchronized (s_taskQueue) {
            if (s_taskQueue.containsKey(sequenceKey)) {
                final Queue<BukkitRunnable> queue = s_taskQueue.get(sequenceKey);
                synchronized(queue) {
                    queue.add(task);
                }
            } else {
                final Queue<BukkitRunnable> queue = new LinkedList<>();
                queue.add(task);

                s_taskQueue.put(sequenceKey, queue);

                final BukkitRunnable runnable = new BukkitRunnable() {
                    @Override
                    public void run() {
                        SchedulerUtils.processTaskQueue(sequenceKey);
                        super.run();
                    }
                };

                runTaskAsynchronously(scheduler, runnable);
            }
        }
    }

    /**
     * Run task asynchronously one after another
     *
     * @param scheduler the scheduler
     * @param task the task to be run
     * @param sequenceKey
     * @throws IllegalArgumentException if plugin is null
     * @throws IllegalArgumentException if task is null
     * @throws IllegalArgumentException if scheduler is null
     */
    public static void runTaskAsynchronouslyInSequence(IScheduler scheduler,
            final BukkitRunnable task, final Object sequenceKey) {
        if (sequenceKey == null) {
            runTaskAsynchronously(scheduler, task);
            return;
        }

        if (scheduler == null) {
            throw new IllegalArgumentException("scheduler");
        }
        if (task == null) {
            throw new IllegalArgumentException("task");
        }

        synchronized (s_taskQueue) {
            if (s_taskQueue.containsKey(sequenceKey)) {
                final Queue<BukkitRunnable> queue = s_taskQueue.get(sequenceKey);
                synchronized(queue) {
                    queue.add(task);
                }
            } else {
                final Queue<BukkitRunnable> queue = new LinkedList<BukkitRunnable>();
                queue.add(task);

                s_taskQueue.put(sequenceKey, queue);

                final BukkitRunnable runnable = new BukkitRunnable() {
                    @Override
                    public void run() {
                        SchedulerUtils.processTaskQueue(sequenceKey);
                        super.run();
                    }
                };

                runTaskAsynchronously(scheduler, runnable);
            }
        }
    }

Replace Generic With Diamond LinkedList<BukkitRunnable> with LinkedList<> in method public runTaskAsynchronouslyInSequence(scheduler IScheduler, task BukkitRunnable, sequenceKey Object) : void from class org.primesoft.asyncworldedit.utils.SchedulerUtils


    @Override
    public void executeJob(Player player, EditSession es, final IEditSessionJob job) {
        if (job == null) {
            return;
        }

        final IPlayerEntry playerEntry = getPlayerEntry(player);
        final String name = job.getName();
        boolean async = checkAsync(playerEntry, name);

        if (!async) {
            try {
                job.execute(es);
            } catch (Exception ex) {
                ErrorHandler.handleError(playerEntry, name, null, ex);
            }
            return;
        }

        IThreadSafeEditSession itses = es instanceof IThreadSafeEditSession ? (IThreadSafeEditSession) es : null;
        if (itses == null) {
            ExceptionHelper.printException(new Exception("Expected " + IThreadSafeEditSession.class.getName()), "Unable to process async job");
            return;
        }

        //m_blockPlacer.performAsAsyncJob(null, playerEntry, name, null);
        m_blockPlacer.performAsAsyncJob(itses, playerEntry, name, (ICancelabeEditSession param) -> {
            if (!(param instanceof EditSession)) {
                ExceptionHelper.printException(new Exception("Expected " + EditSession.class.getName()), "Unable to process async job");
                return 0;
            }

            try {
                job.execute((EditSession) param);
            } catch (Exception ex) {
                ErrorHandler.handleError(playerEntry, name, null, ex);
            }
            return 0;
        });
    }

    @Override
    public void executeJob(Player player, EditSession es, final IEditSessionJob job) {
        if (job == null) {
            return;
        }

        final IPlayerEntry playerEntry = m_playerManager.getPlayer(player.getUniqueId());
        final String name = job.getName();
        boolean async = checkAsync(playerEntry, name);

        if (!async) {
            try {
                job.execute(es);
            } catch (Exception ex) {
                ErrorHandler.handleError(playerEntry, name, null, ex);
            }
            return;
        }

        IThreadSafeEditSession itses = es instanceof IThreadSafeEditSession ? (IThreadSafeEditSession) es : null;
        if (itses == null) {
            ExceptionHelper.printException(new Exception("Expected " + IThreadSafeEditSession.class.getName()), "Unable to process async job");
            return;
        }

        //m_blockPlacer.performAsAsyncJob(null, playerEntry, name, null);
        m_blockPlacer.performAsAsyncJob(itses, playerEntry, name, new IFuncParamEx<Integer, ICancelabeEditSession, MaxChangedBlocksException>() {
            @Override
            public Integer execute(ICancelabeEditSession param) throws MaxChangedBlocksException {
                if (!(param instanceof EditSession)) {
                    ExceptionHelper.printException(new Exception("Expected " + EditSession.class.getName()), "Unable to process async job");
                    return 0;
                }

                try {
                    job.execute((EditSession) param);
                } catch (Exception ex) {
                    ErrorHandler.handleError(playerEntry, name, null, ex);
                }
                return 0;
            }

        });
    }

Replace Anonymous With Lambda org.primesoft.asyncworldedit.asyncinjector.async.AsyncJobProcessor.executeJob.performAsAsyncJob.new IFuncParamEx<Integer,ICancelabeEditSession,MaxChangedBlocksException> with (param) -> {if(!(param instanceof EditSession)){ExceptionHelper.printException(new Exception("Expected " + EditSession.class.getName()),"Unable to process async job"); in method public executeJob(player Player, es EditSession, job IEditSessionJob) : void from class org.primesoft.asyncworldedit.asyncinjector.async.AsyncJobProcessor


    /**
     * Create new instance of the class
     *
     * @param player player uuid
     * @param jobId job id
     * @param name operation name
     */
    public JobEntry(IPlayerEntry player, int jobId, String name) {
        super(jobId, false);
        m_player = player;
        m_name = name;
        m_status = JobStatus.Initializing;
        m_cEditSession = null;
        m_jobStateChanged = new ConcurrentHashMap<>();

        m_eventBus = AwePlatform.getInstance().getCore().getEventBus();
    }

    /**
     * Create new instance of the class
     *
     * @param player player uuid
     * @param jobId job id
     * @param name operation name
     */
    public JobEntry(IPlayerEntry player, int jobId, String name) {
        super(jobId, false);
        m_player = player;
        m_name = name;
        m_status = JobStatus.Initializing;
        m_cEditSession = null;
        m_jobStateChanged = new ArrayList<IJobEntryListener>();

        m_eventBus = AwePlatform.getInstance().getCore().getEventBus();
    }

Replace Generic With Diamond ArrayList<IJobEntryListener> with ConcurrentHashMap<> in method public JobEntry(player IPlayerEntry, jobId int, name String) from class org.primesoft.asyncworldedit.blockPlacer.entries.JobEntry


    /**
     * Create new instance of the class
     *
     * @param player player uuid
     * @param jobId job id
     * @param name operation name
     * @param cEditSession the cancelable edit session
     */
    public JobEntry(IPlayerEntry player,
            ICancelabeEditSession cEditSession,
            int jobId, String name) {
        super(jobId, false);

        m_player = player;
        m_name = name;
        m_status = JobStatus.Initializing;
        m_cEditSession = cEditSession;
        m_jobStateChanged = new ConcurrentHashMap<>();

        m_eventBus = AwePlatform.getInstance().getCore().getEventBus();
    }

    /**
     * Create new instance of the class
     *
     * @param player player uuid
     * @param jobId job id
     * @param name operation name
     * @param cEditSession the cancelable edit session
     */
    public JobEntry(IPlayerEntry player,
            ICancelabeEditSession cEditSession,
            int jobId, String name) {
        super(jobId, false);

        m_player = player;
        m_name = name;
        m_status = JobStatus.Initializing;
        m_cEditSession = cEditSession;
        m_jobStateChanged = new ArrayList<IJobEntryListener>();

        m_eventBus = AwePlatform.getInstance().getCore().getEventBus();
    }

Replace Generic With Diamond ArrayList<IJobEntryListener> with ConcurrentHashMap<> in method public JobEntry(player IPlayerEntry, cEditSession ICancelabeEditSession, jobId int, name String) from class org.primesoft.asyncworldedit.blockPlacer.entries.JobEntry


    @Override
    public boolean addAll(Collection<? extends EditSession> c) {
        List<EditSession> tmp = c == null ? new ArrayList<>() : new ArrayList<>(c);

        for (EditSession session : tmp) {
            assignSession(session);
        }

        return super.addAll(tmp);
    }

    @Override
    public boolean addAll(Collection<? extends EditSession> c) {
        List<EditSession> tmp = c == null ? new ArrayList<EditSession>() : new ArrayList<EditSession>(c);

        for (EditSession session : tmp) {
            assignSession(session);
        }

        return super.addAll(tmp);
    }

Replace Generic With Diamond ArrayList<EditSession> with ArrayList<> in method public addAll(c Collection<? extends EditSession>) : boolean from class org.primesoft.asyncworldedit.changesetSerializer.SerializableSessionList


    @Override
    public boolean addAll(int index, Collection<? extends EditSession> c) {
        List<EditSession> tmp = c == null ? new ArrayList<>() : new ArrayList<>(c);

        for (EditSession session : tmp) {
            assignSession(session);
        }

        return super.addAll(index, tmp);
    }

    @Override
    public boolean addAll(int index, Collection<? extends EditSession> c) {
        List<EditSession> tmp = c == null ? new ArrayList<EditSession>() : new ArrayList<EditSession>(c);

        for (EditSession session : tmp) {
            assignSession(session);
        }

        return super.addAll(index, tmp);
    }

Replace Generic With Diamond ArrayList<EditSession> with ArrayList<> in method public addAll(index int, c Collection<? extends EditSession>) : boolean from class org.primesoft.asyncworldedit.changesetSerializer.SerializableSessionList


    @Override
    public void loadChunk(final int cx, final int cz, final String worldName) {
        add(cx, cz, worldName);
        try {
            if (isChunkLoaded(cx, cz, worldName) || m_dispatcher == null) {
                return;
            }

            m_dispatcher.queueFastOperation(() -> doLoadChunk(cx, cz, worldName));
        } finally {
            remove(cx, cz, worldName);
        }
    }

    @Override
    public void loadChunk(final int cx, final int cz, final String worldName) {
        add(cx, cz, worldName);
        try {
            if (isChunkLoaded(cx, cz, worldName) || m_dispatcher == null) {
                return;
            }

            m_dispatcher.queueFastOperation(new IAction() {

                @Override
                public void execute() {
                    doLoadChunk(cx, cz, worldName);
                }
            });
        } finally {
            remove(cx, cz, worldName);
        }
    }

Replace Anonymous With Lambda org.primesoft.asyncworldedit.core.ChunkWatch.loadChunk.queueFastOperation.new IAction with () -> doLoadChunk(cx,cz,worldName) in method public loadChunk(cx int, cz int, worldName String) : void from class org.primesoft.asyncworldedit.core.ChunkWatch


    /**
     * Checks if the provided iterator is thread safe.
     * If not it caches all items and provides a thread safe iterator
     * @param iterator
     * @return
     */
    private Iterator<Change> wrapIterator(Iterator<Change> iterator) {
        if (iterator == null) {
            return null;
        }

        if (iterator instanceof IThreadSafeIterator) {
            return iterator;
        }

        List<Change> list = new ArrayList<>();
        while (iterator.hasNext()) {
            list.add((Change) iterator.next());
        }

        return list.iterator();
    }

    /**
     * Checks if the provided iterator is thread safe.
     * If not it caches all items and provides a thread safe iterator
     * @param iterator
     * @return
     */
    private Iterator<Change> wrapIterator(Iterator<Change> iterator) {
        if (iterator == null) {
            return null;
        }

        if (iterator instanceof IThreadSafeIterator) {
            return iterator;
        }

        List<Change> list = new ArrayList<Change>();
        while (iterator.hasNext()) {
            list.add((Change) iterator.next());
        }

        return list.iterator();
    }

Replace Generic With Diamond ArrayList<Change> with ArrayList<> in method private wrapIterator(iterator Iterator<Change>) : Iterator<Change> from class org.primesoft.asyncworldedit.worldedit.history.changeset.ThreadSafeChangeSet


    public static List<Extent> getExtentList(EditSession session) {
        List<Extent> extentList = new ArrayList<>();
        Extent current = Reflection.get(EditSession.class, Extent.class, session, "bypassNone", "Unable to get extent");
        while (current != null) {
            extentList.add(current);

            if (current instanceof AbstractDelegateExtent) {
                current = ((AbstractDelegateExtent) current).getExtent();
            } else {
                current = null;
            }
        }

        return extentList;
    }

    public static List<Extent> getExtentList(EditSession session) {
        List<Extent> extentList = new ArrayList<Extent>();
        Extent current = Reflection.get(EditSession.class, Extent.class, session, "bypassNone", "Unable to get extent");
        while (current != null) {
            extentList.add(current);

            if (current instanceof AbstractDelegateExtent) {
                current = ((AbstractDelegateExtent) current).getExtent();
            } else {
                current = null;
            }
        }

        return extentList;
    }

Replace Generic With Diamond ArrayList<Extent> with ArrayList<> in method public getExtentList(session EditSession) : List<Extent> from class org.primesoft.asyncworldedit.utils.ExtentUtils


    /**
     * Get all fields from a class
     *
     * @param oClass
     * @param o
     * @return
     */
    private Iterable<ScannerQueueEntry> unpack(Class<?> oClass, Object o) {
        HashSet<ScannerQueueEntry> result = new HashSet<>();

        if (isPrimitive(oClass) || isBlackList(oClass)) {
            return result;
        }

        if (oClass.isArray()) {
            Class<?> componenClass = oClass;
            while (componenClass.isArray()) {
                componenClass = componenClass.getComponentType();
            }
            if (!isPrimitive(componenClass) && !isBlackList(componenClass)) {
                for (Object t : (Object[]) o) {
                    if (t != null) {
                        result.add(new ScannerQueueEntry(t, o, null));
                    }
                }
            }
        }

        if (Iterable.class.isAssignableFrom(oClass)) {
            for (Object t : (Iterable<Object>) o) {
                if (t != null) {
                    result.add(new ScannerQueueEntry(t, o, null));
                }
            }
        }

        for (Field f : getAllFields(oClass)) {
            boolean restore = !f.isAccessible();
            if (restore) {
                f.setAccessible(true);
            }
            try {
                Object t = f.get(o);
                if (t != null) {
                    result.add(new ScannerQueueEntry(t, o, f));
                }
            } catch (IllegalArgumentException ex) {
            } catch (IllegalAccessException ex) {
            }

            if (restore) {
                f.setAccessible(false);
            }
        }
        return result;
    }

    /**
     * Get all fields from a class
     *
     * @param oClass
     * @param o
     * @return
     */
    private Iterable<ScannerQueueEntry> unpack(Class<?> oClass, Object o) {
        HashSet<ScannerQueueEntry> result = new HashSet<ScannerQueueEntry>();

        if (isPrimitive(oClass) || isBlackList(oClass)) {
            return result;
        }

        if (oClass.isArray()) {
            Class<?> componenClass = oClass;
            while (componenClass.isArray()) {
                componenClass = componenClass.getComponentType();
            }
            if (!isPrimitive(componenClass) && !isBlackList(componenClass)) {
                for (Object t : (Object[]) o) {
                    if (t != null) {
                        result.add(new ScannerQueueEntry(t, o, null));
                    }
                }
            }
        }

        if (Iterable.class.isAssignableFrom(oClass)) {
            for (Object t : (Iterable<Object>) o) {
                if (t != null) {
                    result.add(new ScannerQueueEntry(t, o, null));
                }
            }
        }

        for (Field f : getAllFields(oClass)) {
            boolean restore = !f.isAccessible();
            if (restore) {
                f.setAccessible(true);
            }
            try {
                Object t = f.get(o);
                if (t != null) {
                    result.add(new ScannerQueueEntry(t, o, f));
                }
            } catch (IllegalArgumentException ex) {
            } catch (IllegalAccessException ex) {
            }

            if (restore) {
                f.setAccessible(false);
            }
        }
        return result;
    }

Replace Generic With Diamond HashSet<ScannerQueueEntry> with HashSet<> in method private unpack(oClass Class<?>, o Object) : Iterable<ScannerQueueEntry> from class org.primesoft.asyncworldedit.asyncinjector.scanner.ClassScanner


    /**
     * Get the chunk entities
     *
     * @return
     */
    @Override
    public ISerializedEntity[] getEntity() {
        final HashMap<UUID, ISerializedEntity> result = new LinkedHashMap<>();
        synchronized (m_mutex) {
            if (m_fullChunkData == null) {
                m_fullChunkData = fullChunkData();
            }

            for (ISerializedEntity e : m_addedEntity.values()) {
                result.put(e.getUuid(), e);
            }
            for (ISerializedEntity e : m_fullChunkData.getEntity()) {
                UUID uuid = e.getUuid();

                if (!m_removedEntity.containsKey(uuid) && !result.containsKey(uuid)) {
                    result.put(uuid, e);
                }
            }
        }

        return result.values().toArray(new ISerializedEntity[0]);
    }

    /**
     * Get the chunk entities
     *
     * @return
     */
    @Override
    public ISerializedEntity[] getEntity() {
        final HashMap<UUID, ISerializedEntity> result = new LinkedHashMap<UUID, ISerializedEntity>();
        synchronized (m_mutex) {
            if (m_fullChunkData == null) {
                m_fullChunkData = fullChunkData();
            }

            for (ISerializedEntity e : m_addedEntity.values()) {
                result.put(e.getUuid(), e);
            }
            for (ISerializedEntity e : m_fullChunkData.getEntity()) {
                UUID uuid = e.getUuid();

                if (!m_removedEntity.containsKey(uuid) && !result.containsKey(uuid)) {
                    result.put(uuid, e);
                }
            }
        }

        return result.values().toArray(new ISerializedEntity[0]);
    }

Replace Generic With Diamond LinkedHashMap<UUID,ISerializedEntity> with LinkedHashMap<> in method public getEntity() : ISerializedEntity[] from class org.primesoft.asyncworldedit.directChunk.base.BaseChangesetChunkData


    /**
     * Set the biome data
     *
     * @param data
     * @param dataBiomes
     * @param oldBiomes
     */
    private void setBiome(IChunkData cData, IBiomeEntry[] dataBiomes, InOutParam<IBiomeEntry[]> oldBiomes) {
        List<IBiomeEntry> tOldBiome = new ArrayList<>();

        IDirectChunkAPI dcApi = AwePlatform.getInstance().getCore().getDirectChunkAPI();
        BlockVector3 chunkZero = PositionHelper.chunkToPosition(BlockVector2.at(m_cx, m_cz), 0);

        for (IBiomeEntry entry : dataBiomes) {
            int x = entry.getX();
            int z = entry.getZ();

            BlockVector3 pos = chunkZero.add(x, 0, z);
            int id = entry.getId();

            int old = cData.getBiome(x, z);
            tOldBiome.add(new BiomeEntry(old, x, z));

            cData.setBiome(x, z, id);
        }

        if (oldBiomes != null) {
            oldBiomes.setValue(tOldBiome.toArray(new IBiomeEntry[0]));
        }

    }

    /**
     * Set the biome data
     *
     * @param data
     * @param dataBiomes
     * @param oldBiomes
     */
    private void setBiome(IChunkData cData, IBiomeEntry[] dataBiomes, InOutParam<IBiomeEntry[]> oldBiomes) {
        List<IBiomeEntry> tOldBiome = new ArrayList<IBiomeEntry>();

        IDirectChunkAPI dcApi = AwePlatform.getInstance().getCore().getDirectChunkAPI();
        BlockVector3 chunkZero = PositionHelper.chunkToPosition(BlockVector2.at(m_cx, m_cz), 0);

        for (IBiomeEntry entry : dataBiomes) {
            int x = entry.getX();
            int z = entry.getZ();

            BlockVector3 pos = chunkZero.add(x, 0, z);
            int id = entry.getId();

            int old = cData.getBiome(x, z);
            tOldBiome.add(new BiomeEntry(old, x, z));

            cData.setBiome(x, z, id);
        }

        if (oldBiomes != null) {
            oldBiomes.setValue(tOldBiome.toArray(new IBiomeEntry[0]));
        }

    }

Replace Generic With Diamond ArrayList<IBiomeEntry> with ArrayList<> in method private setBiome(cData IChunkData, dataBiomes IBiomeEntry[], oldBiomes InOutParam<IBiomeEntry[]>) : void from class org.primesoft.asyncworldedit.directChunk.base.BaseWrappedChunk


    @Override
    public void initialize(IPlatform platform) {
        IScheduler scheduler = platform.getScheduler();

        m_chunkWatcher = platform.getChunkWatcher();

        m_task = scheduler.runTaskAsynchronously(this::relightLoop);
    }

    @Override
    public void initialize(IPlatform platform) {
        IScheduler scheduler = platform.getScheduler();

        m_chunkWatcher = platform.getChunkWatcher();

        m_task = scheduler.runTaskAsynchronously(new Runnable() {

            @Override
            public void run() {
                relightLoop();
            }
        });
    }

Replace Anonymous With Lambda org.primesoft.asyncworldedit.directChunk.relighter.BlockReligher.initialize.runTaskAsynchronously.new Runnable with this::relightLoop in method public initialize(platform IPlatform) : void from class org.primesoft.asyncworldedit.directChunk.relighter.BlockReligher


    /**
     * Queue block to block queue
     *
     * @param emission
     * @param data
     * @param blockQueue
     */
    private static void queueBlock(Byte emission, Integer data,
            HashMap<Byte, Queue<Integer>> blockQueue, Set<Integer> blockQueueFlat) {
        Queue<Integer> entry = blockQueue.get(emission);
        if (entry == null) {
            entry = new LinkedList<>();
            blockQueue.put(emission, entry);
        }

        entry.add(data);
        blockQueueFlat.add(data);
    }

    /**
     * Queue block to block queue
     *
     * @param emission
     * @param data
     * @param blockQueue
     */
    private static void queueBlock(Byte emission, Integer data,
            HashMap<Byte, Queue<Integer>> blockQueue, Set<Integer> blockQueueFlat) {
        Queue<Integer> entry = blockQueue.get(emission);
        if (entry == null) {
            entry = new LinkedList<Integer>();
            blockQueue.put(emission, entry);
        }

        entry.add(data);
        blockQueueFlat.add(data);
    }

Replace Generic With Diamond LinkedList<Integer> with LinkedList<> in method private queueBlock(emission Byte, data Integer, blockQueue HashMap<Byte,Queue<Integer>>, blockQueueFlat Set<Integer>) : void from class org.primesoft.asyncworldedit.directChunk.relighter.BlockReligher


    private HashMap<BlockVector2, LazyData<IChunkData>> cacheChunks(int cMinX, int cMaxX, int cMinZ, int cMaxZ,
            final IWorld world, IAweEditSession editSesstion) throws WorldEditException {
        HashMap<BlockVector2, LazyData<IChunkData>> dataCatch
                = new HashMap<>();
        for (int cx = cMinX; cx <= cMaxX; cx++) {
            for (int cz = cMinZ; cz <= cMaxZ; cz++) {
                final BlockVector2 cPos = BlockVector2.at(cx, cz);

                final IWrappedChunk chunk = DcUtils.wrapChunk(m_taskDispatcher, m_chunkApi,
                        m_world, world, getPlayer(), cPos);

                final LazyData<IChunkData> data = new LazyData<>();
                editSesstion.doCustomAction(new GetChunkData(chunk, data), false);

                dataCatch.put(cPos, data);
            }
        }

        return dataCatch;
    }

    private HashMap<BlockVector2, LazyData<IChunkData>> cacheChunks(int cMinX, int cMaxX, int cMinZ, int cMaxZ,
            final IWorld world, IAweEditSession editSesstion) throws WorldEditException {
        HashMap<BlockVector2, LazyData<IChunkData>> dataCatch
                = new HashMap<>();
        for (int cx = cMinX; cx <= cMaxX; cx++) {
            for (int cz = cMinZ; cz <= cMaxZ; cz++) {
                final BlockVector2 cPos = BlockVector2.at(cx, cz);

                final IWrappedChunk chunk = DcUtils.wrapChunk(m_taskDispatcher, m_chunkApi,
                        m_world, world, getPlayer(), cPos);

                final LazyData<IChunkData> data = new LazyData<IChunkData>();
                editSesstion.doCustomAction(new GetChunkData(chunk, data), false);

                dataCatch.put(cPos, data);
            }
        }

        return dataCatch;
    }

Replace Generic With Diamond LazyData<IChunkData> with LazyData<> in method private cacheChunks(cMinX int, cMaxX int, cMinZ int, cMaxZ int, world IWorld, editSesstion IAweEditSession) : HashMap<BlockVector2,LazyData<IChunkData>> from class org.primesoft.asyncworldedit.excommands.chunk.CopyChunkCommand


    @Override
    public Set<CommandMapping> getCommands() {
        if (m_commandsOverride.isEmpty()) {
            return m_parent.getCommands();
        }

        if (m_commandsUnion == null) {
            Collection<String> aliases = m_parent.getAliases();

            HashSet<CommandMapping> mappings = new HashSet<>(aliases.size());

            for (String a : aliases) {
                String lower = a.toLowerCase();

                CommandMapping m = m_commandsOverride.get(lower);
                if (m == null) {
                    m = m_parent.get(lower);
                }

                if (m != null) {
                    mappings.add(m);
                }
            }

            m_commandsUnion = mappings;
        }

        return Collections.unmodifiableSet(m_commandsUnion);
    }

    @Override
    public Set<CommandMapping> getCommands() {
        if (m_commandsOverride.isEmpty()) {
            return m_parent.getCommands();
        }

        if (m_commandsUnion == null) {
            Collection<String> aliases = m_parent.getAliases();

            HashSet<CommandMapping> mappings = new HashSet<CommandMapping>(aliases.size());

            for (String a : aliases) {
                String lower = a.toLowerCase();

                CommandMapping m = m_commandsOverride.get(lower);
                if (m == null) {
                    m = m_parent.get(lower);
                }

                if (m != null) {
                    mappings.add(m);
                }
            }

            m_commandsUnion = mappings;
        }

        return Collections.unmodifiableSet(m_commandsUnion);
    }

Replace Generic With Diamond HashSet<CommandMapping> with HashSet<> in method public getCommands() : Set<CommandMapping> from class org.primesoft.asyncworldedit.worldedit.util.command.DispatcherWrapper


    @Override
    public Set<String> getAliases() {
        if (m_commandsOverride.isEmpty()) {
            return (Set<String>)m_parent.getAliases();
        }

        if (m_aliasesUnion == null) {
            HashSet<String> tmp = new HashSet<>();

            for (CommandMapping mapping : getCommands()) {
                String[] aliases = mapping.getAllAliases();
                for (String a : aliases) {
                    if (!tmp.contains(a)) {
                        tmp.add(a);
                    }
                }
            }

            m_aliasesUnion = tmp;
        }

        return Collections.unmodifiableSet(m_aliasesUnion);
    }

    @Override
    public Set<String> getAliases() {
        if (m_commandsOverride.isEmpty()) {
            return (Set<String>)m_parent.getAliases();
        }

        if (m_aliasesUnion == null) {
            HashSet<String> tmp = new HashSet<String>();

            for (CommandMapping mapping : getCommands()) {
                String[] aliases = mapping.getAllAliases();
                for (String a : aliases) {
                    if (!tmp.contains(a)) {
                        tmp.add(a);
                    }
                }
            }

            m_aliasesUnion = tmp;
        }

        return Collections.unmodifiableSet(m_aliasesUnion);
    }

Replace Generic With Diamond HashSet<String> with HashSet<> in method public getAliases() : Set<String> from class org.primesoft.asyncworldedit.worldedit.util.command.DispatcherWrapper


    /**
     * Create new instanc of the class
     */
    public PhysicsWatch() {
        m_mutex = new Object();
        m_locked = new HashMap<>();
    }

    /**
     * Create new instanc of the class
     */
    public PhysicsWatch() {
        m_mutex = new Object();
        m_locked = new HashMap<String, HashMap<Integer, HashMap<Integer, HashMap<Integer, Integer>>>>();
    }

Replace Generic With Diamond HashMap<String,HashMap<Integer,HashMap<Integer,HashMap<Integer,Integer>>>> with HashMap<> in method public PhysicsWatch() from class org.primesoft.asyncworldedit.core.PhysicsWatch


    /**
     * Wrap the provided chunk using the task dispatcher
     *
     * @param taskDispatcher
     * @param chunkApi
     * @param mutex
     * @param weWorld
     * @param world
     * @param player
     * @param cx
     * @param cz
     * @return
     */
    private static IWrappedChunk wrapChunk(ITaskDispatcher taskDispatcher, final IDirectChunkAPI chunkApi,
            Object mutex, final IWorld world, final IPlayerEntry player,
            final int cx, final int cz) {
        IWrappedChunk wrappedChunk = taskDispatcher.performSafe(mutex, () -> {
            IChunk chunk = world.getChunkAt(cx, cz);

            if (player== null) {
                return chunkApi.wrapChunk(chunk);
            } else {
                return chunkApi.wrapChunk(chunk, player);
            }
        },
                world, PositionHelper.chunkToPosition(cx, 0, cz)
        );

        return wrappedChunk;
    }

    /**
     * Wrap the provided chunk using the task dispatcher
     *
     * @param taskDispatcher
     * @param chunkApi
     * @param mutex
     * @param weWorld
     * @param world
     * @param player
     * @param cx
     * @param cz
     * @return
     */
    private static IWrappedChunk wrapChunk(ITaskDispatcher taskDispatcher, final IDirectChunkAPI chunkApi,
            Object mutex, final IWorld world, final IPlayerEntry player,
            final int cx, final int cz) {
        IWrappedChunk wrappedChunk = taskDispatcher.performSafe(mutex,
                new IFunc<IWrappedChunk>() {
                    @Override
                    public IWrappedChunk execute() {
                        IChunk chunk = world.getChunkAt(cx, cz);

                        if (player== null) {
                            return chunkApi.wrapChunk(chunk);
                        } else {
                            return chunkApi.wrapChunk(chunk, player);
                        }
                    }
                },
                world, PositionHelper.chunkToPosition(cx, 0, cz)
        );

        return wrappedChunk;
    }

Replace Anonymous With Lambda org.primesoft.asyncworldedit.directChunk.DcUtils.wrapChunk.wrappedChunk.performSafe.new IFunc<IWrappedChunk> with () -> {IChunk chunk=world.getChunkAt(cx,cz); in method private wrapChunk(taskDispatcher ITaskDispatcher, chunkApi IDirectChunkAPI, mutex Object, world IWorld, player IPlayerEntry, cx int, cz int) : IWrappedChunk from class org.primesoft.asyncworldedit.directChunk.DcUtils


    /**
     * Get all fields for class (including supper)
     *
     * @param oClass
     * @param fields
     * @return
     */
    private static List<Field> getAllFields(Class<?> oClass) {
        List<Field> result = new ArrayList<>();

        while (oClass != null) {
            result.addAll(Arrays.asList(oClass.getDeclaredFields()));
            oClass = oClass.getSuperclass();
        }
        return result;
    }

    /**
     * Get all fields for class (including supper)
     *
     * @param oClass
     * @param fields
     * @return
     */
    private static List<Field> getAllFields(Class<?> oClass) {
        List<Field> result = new ArrayList<Field>();

        while (oClass != null) {
            result.addAll(Arrays.asList(oClass.getDeclaredFields()));
            oClass = oClass.getSuperclass();
        }
        return result;
    }

Replace Generic With Diamond ArrayList<Field> with ArrayList<> in method private getAllFields(oClass Class<?>) : List<Field> from class org.primesoft.asyncworldedit.asyncinjector.scanner.ClassScanner


    public ThreadSafeEditSession(IAsyncWorldEditCore core,
            IPlayerEntry player, EventBus eventBus, com.sk89q.worldedit.world.World world,
            int maxBlocks, @Nullable BlockBag blockBag, EditSessionEvent event) {

        super(eventBus, AsyncWorld.wrap(world, player), maxBlocks, ThreadSafeBlockBag.warap(blockBag), event);

        m_asyncTasks = new HashSet<>();

        m_aweCore = core;
        m_blockPlacer = core.getBlockPlacer();
        m_dispatcher = core.getTaskDispatcher();

        m_player = player;
        m_editSessionEvent = event;
        m_eventBus = eventBus;

        if (world != null) {
            m_bukkitWorld = m_aweCore.getWorld(world.getName());
        } else {
            m_bukkitWorld = null;
        }

        m_asyncForced = false;
        m_asyncForceDisabled = false;
        m_asyncDisabled = false;

        boolean isDebug = ConfigProvider.messages().isDebugOn();
        if (isDebug) {
            ExtentUtils.dumpExtents("Original extents:", this);
        }

        injectExtents(player, core);

        if (isDebug) {
            ExtentUtils.dumpExtents("Injected extents:", this);
        }

        m_jobId = -1;
    }

    public ThreadSafeEditSession(IAsyncWorldEditCore core,
            IPlayerEntry player, EventBus eventBus, com.sk89q.worldedit.world.World world,
            int maxBlocks, @Nullable BlockBag blockBag, EditSessionEvent event) {

        super(eventBus, AsyncWorld.wrap(world, player), maxBlocks, ThreadSafeBlockBag.warap(blockBag), event);

        m_asyncTasks = new HashSet<IJobEntry>();

        m_aweCore = core;
        m_blockPlacer = core.getBlockPlacer();
        m_dispatcher = core.getTaskDispatcher();

        m_player = player;
        m_editSessionEvent = event;
        m_eventBus = eventBus;

        if (world != null) {
            m_bukkitWorld = m_aweCore.getWorld(world.getName());
        } else {
            m_bukkitWorld = null;
        }

        m_asyncForced = false;
        m_asyncForceDisabled = false;
        m_asyncDisabled = false;

        boolean isDebug = ConfigProvider.messages().isDebugOn();
        if (isDebug) {
            ExtentUtils.dumpExtents("Original extents:", this);
        }

        injectExtents(player, core);

        if (isDebug) {
            ExtentUtils.dumpExtents("Injected extents:", this);
        }

        m_jobId = -1;
    }

Replace Generic With Diamond HashSet<IJobEntry> with HashSet<> in method public ThreadSafeEditSession(core IAsyncWorldEditCore, player IPlayerEntry, eventBus EventBus, world World, maxBlocks int, blockBag BlockBag, event EditSessionEvent) from class org.primesoft.asyncworldedit.worldedit.ThreadSafeEditSession


    /**
     * Perform a custom action
     *
     * @throws com.sk89q.worldedit.WorldEditException
     */
    @Override
    public void doCustomAction(final Change change, boolean isDemanding) throws WorldEditException {
        final boolean isAsync = isAsyncEnabled();
        final ChangeSet cs = getChangeSet();
        final IExtendedChangeSet ecs = (cs instanceof IExtendedChangeSet) ? (IExtendedChangeSet) cs : null;

        final UndoContext undoContext = new UndoContext();
        undoContext.setExtent(this);

        final IBlockPlacer blockPlacer = getBlockPlacer();
        final Change safeChange = new BlockPlacerChange(change, blockPlacer, isDemanding);

        final IActionEx<WorldEditException> action = () -> change.redo(undoContext);

        if (ecs != null) {
            ecs.addExtended(safeChange, null);
        } else {
            cs.add(safeChange);
        }

        if (!isAsync) {
            action.execute();

            return;
        }

        BlockPlacerEntry entry = new ActionEntryEx(m_jobId, action, isDemanding);

        m_blockPlacer.addTasks(m_player, entry);
    }

    /**
     * Perform a custom action
     *
     * @throws com.sk89q.worldedit.WorldEditException
     */
    @Override
    public void doCustomAction(final Change change, boolean isDemanding) throws WorldEditException {
        final boolean isAsync = isAsyncEnabled();
        final ChangeSet cs = getChangeSet();
        final IExtendedChangeSet ecs = (cs instanceof IExtendedChangeSet) ? (IExtendedChangeSet) cs : null;

        final UndoContext undoContext = new UndoContext();
        undoContext.setExtent(this);

        final IBlockPlacer blockPlacer = getBlockPlacer();
        final Change safeChange = new BlockPlacerChange(change, blockPlacer, isDemanding);

        final IActionEx<WorldEditException> action = new IActionEx<WorldEditException>() {
            @Override
            public void execute() throws WorldEditException {
                change.redo(undoContext);
            }
        };

        if (ecs != null) {
            ecs.addExtended(safeChange, null);
        } else {
            cs.add(safeChange);
        }

        if (!isAsync) {
            action.execute();

            return;
        }

        BlockPlacerEntry entry = new ActionEntryEx(m_jobId, action, isDemanding);

        m_blockPlacer.addTasks(m_player, entry);
    }

Replace Anonymous With Lambda org.primesoft.asyncworldedit.worldedit.ThreadSafeEditSession.doCustomAction.action.new IActionEx<WorldEditException> with () -> change.redo(undoContext) in method public doCustomAction(change Change, isDemanding boolean) : void from class org.primesoft.asyncworldedit.worldedit.ThreadSafeEditSession


    /**
     * Save the change set
     *
     * @return
     */
    boolean save() {
        List<Change> dataToSave = new ArrayList<>();

        synchronized (m_saveMutex) {
            m_savePending = true;
        }

        synchronized (m_queuedChanges) {
            while (!m_queuedChanges.isEmpty() && !m_isDisposed /*&& dataToSave.size() < MAX_SAVE*/) {
                dataToSave.add(m_queuedChanges.poll());
                m_size++;
            }
        }

        try {
            if (dataToSave.isEmpty()) {
                return false;
            }

            m_changesetSerializer.save(m_storageFile, dataToSave);
            return true;
        } finally {
            synchronized (m_saveMutex) {
                m_savePending = false;
                m_saveMutex.notifyAll();
            }
        }
    }

    /**
     * Save the change set
     *
     * @return
     */
    boolean save() {
        List<Change> dataToSave = new ArrayList<Change>();

        synchronized (m_saveMutex) {
            m_savePending = true;
        }

        synchronized (m_queuedChanges) {
            while (!m_queuedChanges.isEmpty() && !m_isDisposed /*&& dataToSave.size() < MAX_SAVE*/) {
                dataToSave.add(m_queuedChanges.poll());
                m_size++;
            }
        }

        try {
            if (dataToSave.isEmpty()) {
                return false;
            }

            m_changesetSerializer.save(m_storageFile, dataToSave);
            return true;
        } finally {
            synchronized (m_saveMutex) {
                m_savePending = false;
                m_saveMutex.notifyAll();
            }
        }
    }

Replace Generic With Diamond ArrayList<Change> with ArrayList<> in method package save() : boolean from class org.primesoft.asyncworldedit.worldedit.history.changeset.FileChangeSet


    /**
     * Start the file saver thread
     *
     * @param changeSet
     */
    static void start(FileChangeSet changeSet) {
        boolean isRunning;
        synchronized (s_fileSavers) {
            s_fileSavers.add(changeSet);

            isRunning = s_isRunning;
            s_isRunning = true;
        }

        if (isRunning) {
            synchronized (s_waitMutex) {
                s_waitMutex.notifyAll();
            }
            return;
        }

        new Thread(FileChangeSetManager::saveLoop).start();
    }

    /**
     * Start the file saver thread
     *
     * @param changeSet
     */
    static void start(FileChangeSet changeSet) {
        boolean isRunning;
        synchronized (s_fileSavers) {
            s_fileSavers.add(changeSet);

            isRunning = s_isRunning;
            s_isRunning = true;
        }

        if (isRunning) {
            synchronized (s_waitMutex) {
                s_waitMutex.notifyAll();
            }
            return;
        }

        new Thread(new Runnable() {

            @Override
            public void run() {
                saveLoop();
            }
        }).start();
    }

Replace Anonymous With Lambda org.primesoft.asyncworldedit.worldedit.history.changeset.FileChangeSetManager.start.start.new Thread.new Runnable with FileChangeSetManager::saveLoop in method package start(changeSet FileChangeSet) : void from class org.primesoft.asyncworldedit.worldedit.history.changeset.FileChangeSetManager


    @Override
    public List<? extends Entity> getEntities(Region region) {
        //TODO: Implement entity get
        return new LinkedList<>();
    }

    @Override
    public List<? extends Entity> getEntities(Region region) {
        //TODO: Implement entity get
        return new LinkedList<Entity>();
    }

Replace Generic With Diamond LinkedList<Entity> with LinkedList<> in method public getEntities(region Region) : List<? extends Entity> from class org.primesoft.asyncworldedit.directChunk.ChangesetChunkExtent


    @Override
    public List<? extends Entity> getEntities() {
        //TODO: Implement entity get
        return new LinkedList<>();
    }

    @Override
    public List<? extends Entity> getEntities() {
        //TODO: Implement entity get
        return new LinkedList<Entity>();
    }

Replace Generic With Diamond LinkedList<Entity> with LinkedList<> in method public getEntities() : List<? extends Entity> from class org.primesoft.asyncworldedit.directChunk.ChangesetChunkExtent


    private HashMap<BlockVector2D, IWrappedChunk> cacheChunks(int cMinX, int cMaxX, int cMinZ, int cMaxZ,
            final IWorld world, IAweEditSession editSesstion) throws WorldEditException {
        final HashMap<BlockVector2D, IWrappedChunk> dataCatch = new HashMap<>();
        for (int cx = cMinX; cx <= cMaxX; cx++) {
            for (int cz = cMinZ; cz <= cMaxZ; cz++) {
                final BlockVector2D cPos = new BlockVector2D(cx, cz);

                final IWrappedChunk chunk = DcUtils.wrapChunk(m_taskDispatcher, m_chunkApi,
                        m_locationWorld, world, getPlayer(), cPos);

                dataCatch.put(cPos, chunk);
            }
        }

        return dataCatch;
    }

    private HashMap<BlockVector2D, IWrappedChunk> cacheChunks(int cMinX, int cMaxX, int cMinZ, int cMaxZ,
            final IWorld world, IAweEditSession editSesstion) throws WorldEditException {
        final HashMap<BlockVector2D, IWrappedChunk> dataCatch = new HashMap<BlockVector2D, IWrappedChunk>();
        for (int cx = cMinX; cx <= cMaxX; cx++) {
            for (int cz = cMinZ; cz <= cMaxZ; cz++) {
                final BlockVector2D cPos = new BlockVector2D(cx, cz);

                final IWrappedChunk chunk = DcUtils.wrapChunk(m_taskDispatcher, m_chunkApi,
                        m_locationWorld, world, getPlayer(), cPos);

                dataCatch.put(cPos, chunk);
            }
        }

        return dataCatch;
    }

Replace Generic With Diamond HashMap<BlockVector2D,IWrappedChunk> with HashMap<> in method private cacheChunks(cMinX int, cMaxX int, cMinZ int, cMaxZ int, world IWorld, editSesstion IAweEditSession) : HashMap<BlockVector2D,IWrappedChunk> from class org.primesoft.asyncworldedit.excommands.chunk.PasteChunkCommand


            @Override
            public void execute() {
                try (Closer closer = Closer.create()) {
                    FileInputStream fis = closer.register(new FileInputStream(f));
                    BufferedInputStream bis = closer.register(new BufferedInputStream(fis));
                    ClipboardReader reader = closer.register(format.getReader(bis));

                    Clipboard clipboard = reader.read();
                    session.setClipboard(new ClipboardHolder(clipboard));

                    log.info(player.getName() + " loaded " + f.getCanonicalPath());
                    player.print(filename + " loaded. Paste it with //paste");
                } catch (IOException e) {
                    player.printError("Schematic could not read or it does not exist: " + e.getMessage());
                    log.log(Level.WARNING, "Failed to load a saved clipboard", e);
                }
            }

            @Override
            public void execute() {
                Closer closer = Closer.create();
                try {
                    FileInputStream fis = closer.register(new FileInputStream(f));
                    BufferedInputStream bis = closer.register(new BufferedInputStream(fis));
                    ClipboardReader reader = format.getReader(bis);

                    WorldData worldData = player.getWorld().getWorldData();
                    Clipboard clipboard = reader.read(player.getWorld().getWorldData());
                    session.setClipboard(new ClipboardHolder(clipboard, worldData));

                    log.info(player.getName() + " loaded " + f.getCanonicalPath());
                    player.print(filename + " loaded. Paste it with //paste");
                } catch (IOException e) {
                    player.printError("Schematic could not read or it does not exist: " + e.getMessage());
                    log.log(Level.WARNING, "Failed to load a saved clipboard", e);
                } finally {
                    try {
                        closer.close();
                    } catch (IOException ignored) {
                    }
                }
            }

Try With Resources try(Closer closer=Closer.create()) in method public execute() : void from class org.primesoft.asyncworldedit.excommands.commands.SchematicCommands.load.executeJob.new IJob


    @Override
    public World getWorld() {
        World world = m_parent.getWorld();

        synchronized (m_mutex) {
            if (m_world == null || m_world.getX1() != world) {
                AsyncWorld aWorld = AsyncWorld.wrap(world, getEntry());
                if (aWorld != null) {
                    m_world = new Pair<>(world, aWorld);
                    world = aWorld;
                } else if (m_world != null) {
                    m_world = null;
                }
            } else if (m_world != null) {
                world = m_world.getX2();
            }
        }

        return world;
    }

    @Override
    public World getWorld() {
        World world = m_parent.getWorld();

        synchronized (m_mutex) {
            if (m_world == null || m_world.getX1() != world) {
                AsyncWorld aWorld = AsyncWorld.wrap(world, getEntry());
                if (aWorld != null) {
                    m_world = new Pair<World, AsyncWorld>(world, aWorld);
                    world = aWorld;
                } else if (m_world != null) {
                    m_world = null;
                }
            } else if (m_world != null) {
                world = m_world.getX2();
            }
        }

        return world;
    }

Replace Generic With Diamond Pair<World,AsyncWorld> with Pair<> in method public getWorld() : World from class org.primesoft.asyncworldedit.worldedit.entity.PlayerWrapper


    @Override
    public List<? extends Entity> getEntities(Region region) {
        final List<? extends Entity> result;
        synchronized (m_mutex) {
            result = super.getEntities(region);

            if (result == null) {
                return null;
            }

            return new LinkedList<>(result);
        }
    }

    @Override
    public List<? extends Entity> getEntities(Region region) {
        final List<? extends Entity> result;
        synchronized (m_mutex) {
            result = super.getEntities(region);

            if (result == null) {
                return null;
            }

            return new LinkedList<Entity>(result);
        }
    }

Replace Generic With Diamond LinkedList<Entity> with LinkedList<> in method public getEntities(region Region) : List<? extends Entity> from class org.primesoft.asyncworldedit.worldedit.extent.clipboard.ThreadSafeBlockArrayClipboard


    @Override
    public List<? extends Entity> getEntities() {
        final List<? extends Entity> result;
        synchronized (m_mutex) {
            result = super.getEntities();

            if (result == null) {
                return null;
            }

            return new LinkedList<>(result);
        }
    }

    @Override
    public List<? extends Entity> getEntities() {
        final List<? extends Entity> result;
        synchronized (m_mutex) {
            result = super.getEntities();

            if (result == null) {
                return null;
            }

            return new LinkedList<Entity>(result);
        }
    }

Replace Generic With Diamond LinkedList<Entity> with LinkedList<> in method public getEntities() : List<? extends Entity> from class org.primesoft.asyncworldedit.worldedit.extent.clipboard.ThreadSafeBlockArrayClipboard


    @Override
    public void simulateBlockMine(Vector position) {
        final DataAsyncParams<Vector> param = DataAsyncParams.extract(position);
        final Vector v = param.getData();
        final IPlayerEntry player = getPlayer(param);

        final BlockStateHolder air = BlockTypes.AIR.getDefaultState();
        IAction func = () -> {
            BlockState oldBlock = m_parent.getBlock(v);
            if (!canPlace(player, m_bukkitWorld, v, oldBlock, air) || isSame(oldBlock, air)) {
                return;
            }
            m_parent.simulateBlockMine(v);
        };

        if (param.isAsync() || !m_dispatcher.isMainTask()) {
            if (!canPlace(player, m_bukkitWorld, v, getBlock(v), air)) {
                return;
            }

            m_blockPlacer.addTasks(player,
                    new WorldActionEntry(this.getName(), param.getJobId(), v, func));
            return;
        }

        func.execute();
    }

    @Override
    public void simulateBlockMine(Vector vector) {
        final DataAsyncParams<Vector> param = DataAsyncParams.extract(vector);
        final Vector v = param.getData();
        final IPlayerEntry player = getPlayer(param);

        IAction func = new IAction() {
            @Override
            public void execute() {
                BaseBlock air = new BaseBlock(0);
                BaseBlock oldBlock = m_parent.getBlock(v);
                if (!canPlace(player, m_bukkitWorld, v, oldBlock, air) || isSame(oldBlock, air)) {
                    return;
                }
                m_parent.simulateBlockMine(v);
            }
        };

        if (param.isAsync() || !m_dispatcher.isMainTask()) {
            if (!canPlace(player, m_bukkitWorld, v, getBlock(v), new BaseBlock(0))) {
                return;
            }

            m_blockPlacer.addTasks(player,
                    new WorldActionEntry(this.getName(), param.getJobId(), v, func));
            return;
        }

        func.execute();
    }

Replace Anonymous With Lambda org.primesoft.asyncworldedit.worldedit.world.AsyncWorld.simulateBlockMine.func.new IAction with () -> {BlockState oldBlock=m_parent.getBlock(v); in method public simulateBlockMine(position Vector) : void from class org.primesoft.asyncworldedit.worldedit.world.AsyncWorld


    /**
     * Perfrom the regen operation
     *
     * @param eSession
     * @param region
     * @param world
     */
    private void doRegen(EditSession eSession, Region region, int maxY, IWorld world, int jobId) {
        final BlockState[] history = new BlockState[16 * 16 * (maxY + 1)];
        final Object wait = new Object();
        final IAction finalizeAction = () -> {
            synchronized(wait) {
                wait.notifyAll();
            }
        };

        for (Vector2D chunk : region.getChunks()) {
            Vector min = PositionHelper.chunkToPosition(chunk, 0);

            m_chunkWatcher.add(chunk.getBlockX(), chunk.getBlockZ(), getName());
            // First save all the blocks inside
            int index = 0;
            for (int x = 0; x < 16; ++x) {
                for (int y = 0; y < (maxY + 1); ++y) {
                    for (int z = 0; z < 16; ++z) {
                        Vector pt = min.add(x, y, z);
                        history[index] = eSession.getBlock(pt);
                        index++;
                    }
                }
            }
            m_chunkWatcher.remove(chunk.getBlockX(), chunk.getBlockZ(), getName());

            m_blockPlacer.addTasks(m_player, new RegenerateEntry(jobId, world, chunk,
                    finalizeAction, m_chunkWatcher));

            synchronized (wait) {
                try {
                    wait.wait();
                } catch (InterruptedException ex) {
                }
            }

            m_chunkWatcher.add(chunk.getBlockX(), chunk.getBlockZ(), getName());
            // Then restore
            index = 0;
            for (int x = 0; x < 16; ++x) {
                for (int y = 0; y < (maxY + 1); ++y) {
                    for (int z = 0; z < 16; ++z) {
                        Vector pt = min.add(x, y, z);
                        // We have to restore the block if it was outside
                        if (!region.contains(pt)) {
                            eSession.smartSetBlock(pt, history[index]);
                        } else { // Otherwise fool with history
                            eSession.getChangeSet().add(
                                    new BlockChange(pt.toBlockVector(), history[index], eSession.getFullBlock(pt)));
                        }
                        index++;
                    }
                }
            }
            m_chunkWatcher.remove(chunk.getBlockX(), chunk.getBlockZ(), getName());
        }
    }

    /**
     * Perfrom the regen operation
     *
     * @param eSession
     * @param region
     * @param world
     */
    private void doRegen(EditSession eSession, Region region, int maxY, IWorld world, int jobId) {
        final BaseBlock[] history = new BaseBlock[16 * 16 * (maxY + 1)];
        final Object wait = new Object();
        final IAction finalizeAction = new IAction() {
            @Override
            public void execute() {
                synchronized(wait) {
                    wait.notifyAll();
                }
            }
        };

        for (Vector2D chunk : region.getChunks()) {
            Vector min = PositionHelper.chunkToPosition(chunk, 0);

            m_chunkWatcher.add(chunk.getBlockX(), chunk.getBlockZ(), getName());
            // First save all the blocks inside
            int index = 0;
            for (int x = 0; x < 16; ++x) {
                for (int y = 0; y < (maxY + 1); ++y) {
                    for (int z = 0; z < 16; ++z) {
                        Vector pt = min.add(x, y, z);
                        history[index] = eSession.getBlock(pt);
                        index++;
                    }
                }
            }
            m_chunkWatcher.remove(chunk.getBlockX(), chunk.getBlockZ(), getName());

            m_blockPlacer.addTasks(m_player, new RegenerateEntry(jobId, world, chunk,
                    finalizeAction, m_chunkWatcher));

            synchronized (wait) {
                try {
                    wait.wait();
                } catch (InterruptedException ex) {
                }
            }

            m_chunkWatcher.add(chunk.getBlockX(), chunk.getBlockZ(), getName());
            // Then restore
            index = 0;
            for (int x = 0; x < 16; ++x) {
                for (int y = 0; y < (maxY + 1); ++y) {
                    for (int z = 0; z < 16; ++z) {
                        Vector pt = min.add(x, y, z);
                        // We have to restore the block if it was outside
                        if (!region.contains(pt)) {
                            eSession.smartSetBlock(pt, history[index]);
                        } else { // Otherwise fool with history
                            eSession.rememberChange(pt, history[index],
                                    eSession.rawGetBlock(pt));
                        }
                        index++;
                    }
                }
            }
            m_chunkWatcher.remove(chunk.getBlockX(), chunk.getBlockZ(), getName());
        }
    }

Replace Anonymous With Lambda org.primesoft.asyncworldedit.worldedit.world.AsyncWorld.doRegen.finalizeAction.new IAction with () -> {synchronized(wait){wait.notifyAll(); in method private doRegen(eSession EditSession, region Region, maxY int, world IWorld, jobId int) : void from class org.primesoft.asyncworldedit.worldedit.world.AsyncWorld


    @Override
    public boolean setBlock(Vector position, BlockStateHolder block, boolean notifyAndLight) throws WorldEditException {
        final DataAsyncParams<BlockStateHolder> paramBlock = DataAsyncParams.extract(block);
        final DataAsyncParams<Vector> paramVector = DataAsyncParams.extract(position);

        final BlockStateHolder newBlock = paramBlock.getData();
        final Vector v = paramVector.getData();
        final IPlayerEntry player = getPlayer(paramBlock, paramVector);

        IFuncEx<Boolean, WorldEditException> func = () -> {
            final BlockStateHolder oldBlock = m_parent.getBlock(v);
            if (!canPlace(player, m_bukkitWorld, v, oldBlock, newBlock)
                    || isSame(oldBlock, newBlock)) {
                return false;
            }

            final boolean result = m_parent.setBlock(v, newBlock, notifyAndLight);
            if (result) {
                logBlock(v, player, oldBlock, newBlock);
            }

            return result;
        };

        if (paramBlock.isAsync() || paramVector.isAsync() || !m_dispatcher.isMainTask()) {
            if (!canPlace(player, m_bukkitWorld, position, getBlock(v), newBlock)) {
                return false;
            }

            return m_blockPlacer.addTasks(player,
                    new WorldFuncEntryEx(this.getName(), paramBlock.getJobId(), v, func));
        }

        return func.execute();
    }

    @Override
    public boolean setBlock(Vector vector, BaseBlock bb, final boolean bln) throws WorldEditException {
        final DataAsyncParams<BaseBlock> paramBlock = DataAsyncParams.extract(bb);
        final DataAsyncParams<Vector> paramVector = DataAsyncParams.extract(vector);

        final BaseBlock newBlock = paramBlock.getData();
        final Vector v = paramVector.getData();
        final IPlayerEntry player = getPlayer(paramBlock, paramVector);

        IFuncEx<Boolean, WorldEditException> func = new IFuncEx<Boolean, WorldEditException>() {
            @Override
            public Boolean execute() throws WorldEditException {
                final BaseBlock oldBlock = m_parent.getBlock(v);
                if (!canPlace(player, m_bukkitWorld, v, oldBlock, newBlock)
                        || isSame(oldBlock, newBlock)) {
                    return false;
                }

                final boolean result = m_parent.setBlock(v, newBlock, bln);
                if (result) {
                    logBlock(v, player, oldBlock, newBlock);
                }

                return result;
            }
        };

        if (paramBlock.isAsync() || paramVector.isAsync() || !m_dispatcher.isMainTask()) {
            if (!canPlace(player, m_bukkitWorld, vector, getBlock(v), newBlock)) {
                return false;
            }

            return m_blockPlacer.addTasks(player,
                    new WorldFuncEntryEx(this.getName(), paramBlock.getJobId(), v, func));
        }

        return func.execute();
    }

Replace Anonymous With Lambda org.primesoft.asyncworldedit.worldedit.world.AsyncWorld.setBlock.func.new IFuncEx<Boolean,WorldEditException> with () -> {final BlockStateHolder oldBlock=m_parent.getBlock(v); in method public setBlock(position Vector, block BlockStateHolder, notifyAndLight boolean) : boolean from class org.primesoft.asyncworldedit.worldedit.world.AsyncWorld


    @Override
    public boolean queueBlockBreakEffect(final Platform server, Vector position, final BlockType blockType, final double priority) {
        final DataAsyncParams<Vector> param = DataAsyncParams.extract(position);
        final Vector v = param.getData();
        final IPlayerEntry player = getPlayer(param);

        final BlockStateHolder air = BlockTypes.AIR.getDefaultState();
        IFunc<Boolean> func = () -> {
            BlockStateHolder oldBlock = m_parent.getBlock(v);
            if (!canPlace(player, m_bukkitWorld, v, oldBlock, air) || isSame(oldBlock, air)) {
                return false;
            }

            return m_parent.queueBlockBreakEffect(server, v, blockType, priority);
        };

        if (param.isAsync() || !m_dispatcher.isMainTask()) {
            if (!canPlace(player, m_bukkitWorld, v, getBlock(v), air)) {
                return false;
            }

            return m_blockPlacer.addTasks(player,
                    new WorldFuncEntry(this.getName(), param.getJobId(), v, func));
        }

        return func.execute();
    }

    @Override
    public boolean queueBlockBreakEffect(final Platform pltform, Vector vector, final int i, final double d) {
        final DataAsyncParams<Vector> param = DataAsyncParams.extract(vector);
        final Vector v = param.getData();
        final IPlayerEntry player = getPlayer(param);

        IFunc<Boolean> func = new IFunc<Boolean>() {
            @Override
            public Boolean execute() {
                BaseBlock air = new BaseBlock(0);
                BaseBlock oldBlock = m_parent.getBlock(v);
                if (!canPlace(player, m_bukkitWorld, v, oldBlock, air) || isSame(oldBlock, air)) {
                    return false;
                }

                return m_parent.queueBlockBreakEffect(pltform, v, i, d);
            }
        };

        if (param.isAsync() || !m_dispatcher.isMainTask()) {
            if (!canPlace(player, m_bukkitWorld, vector, getBlock(v), new BaseBlock(0))) {
                return false;
            }

            return m_blockPlacer.addTasks(player,
                    new WorldFuncEntry(this.getName(), param.getJobId(), v, func));
        }

        return func.execute();
    }

Replace Anonymous With Lambda org.primesoft.asyncworldedit.worldedit.world.AsyncWorld.queueBlockBreakEffect.func.new IFunc<Boolean> with () -> {BlockStateHolder oldBlock=m_parent.getBlock(v); in method public queueBlockBreakEffect(server Platform, position Vector, blockType BlockType, priority double) : boolean from class org.primesoft.asyncworldedit.worldedit.world.AsyncWorld


    @Override
    public boolean setBlock(final Vector position, final BlockStateHolder block) throws WorldEditException {
        final DataAsyncParams<BlockStateHolder> paramBlock = DataAsyncParams.extract(block);
        final DataAsyncParams<Vector> paramVector = DataAsyncParams.extract(position);

        final BlockStateHolder newBlock = paramBlock.getData();
        final Vector v = paramVector.getData();
        final IPlayerEntry player = getPlayer(paramBlock, paramVector);

        IFuncEx<Boolean, WorldEditException> func = () -> {
            final BlockState oldBlock = m_parent.getBlock(v);
            if (!canPlace(player, m_bukkitWorld, v, oldBlock, newBlock)
                    || isSame(oldBlock, newBlock)) {
                return false;
            }

            final boolean result = m_parent.setBlock(position, newBlock);
            if (result) {
                logBlock(position, player, oldBlock, newBlock);
            }

            return result;
        };

        if (paramBlock.isAsync() || paramVector.isAsync() || !m_dispatcher.isMainTask()) {
            if (!canPlace(player, m_bukkitWorld, position, getBlock(v), newBlock)) {
                return false;
            }

            return m_blockPlacer.addTasks(player,
                    new WorldFuncEntryEx(this.getName(), paramBlock.getJobId(), v, func));
        }

        return func.execute();
    }

    @Override
    public boolean setBlock(final Vector vector, final BaseBlock bb) throws WorldEditException {
        final DataAsyncParams<BaseBlock> paramBlock = DataAsyncParams.extract(bb);
        final DataAsyncParams<Vector> paramVector = DataAsyncParams.extract(vector);

        final BaseBlock newBlock = paramBlock.getData();
        final Vector v = paramVector.getData();
        final IPlayerEntry player = getPlayer(paramBlock, paramVector);

        IFuncEx<Boolean, WorldEditException> func = new IFuncEx<Boolean, WorldEditException>() {

            @Override
            public Boolean execute() throws WorldEditException {
                final BaseBlock oldBlock = m_parent.getBlock(v);
                if (!canPlace(player, m_bukkitWorld, v, oldBlock, newBlock)
                        || isSame(oldBlock, newBlock)) {
                    return false;
                }

                final boolean result = m_parent.setBlock(vector, newBlock);
                if (result) {
                    logBlock(vector, player, oldBlock, newBlock);
                }

                return result;
            }
        };

        if (paramBlock.isAsync() || paramVector.isAsync() || !m_dispatcher.isMainTask()) {
            if (!canPlace(player, m_bukkitWorld, vector, getBlock(v), newBlock)) {
                return false;
            }

            return m_blockPlacer.addTasks(player,
                    new WorldFuncEntryEx(this.getName(), paramBlock.getJobId(), v, func));
        }

        return func.execute();
    }

Replace Anonymous With Lambda org.primesoft.asyncworldedit.worldedit.world.AsyncWorld.setBlock.func.new IFuncEx<Boolean,WorldEditException> with () -> {final BlockState oldBlock=m_parent.getBlock(v); in method public setBlock(position Vector, block BlockStateHolder) : boolean from class org.primesoft.asyncworldedit.worldedit.world.AsyncWorld


    @Override
    public List<? extends Entity> getEntities(Region region) {
        List<Entity> filtered = new ArrayList<>();
        for (Entity entity : entities) {
            if (region.contains(entity.getLocation().toVector())) {
                filtered.add(entity);
            }
        }
        return Collections.unmodifiableList(filtered);
    }

    @Override
    public List<? extends Entity> getEntities(Region region) {
        List<Entity> filtered = new ArrayList<Entity>();
        for (Entity entity : entities) {
            if (region.contains(entity.getLocation().toVector())) {
                filtered.add(entity);
            }
        }
        return Collections.unmodifiableList(filtered);
    }

Replace Generic With Diamond ArrayList<Entity> with ArrayList<> in method public getEntities(region Region) : List<? extends Entity> from class org.primesoft.asyncworldedit.injector.classfactory.base.clipboard.BlockArrayClipboard


    /**
     * Draws a line (out of blocks) between two vectors.
     *
     * @param pattern The block pattern used to draw the line.
     * @param pos1 One of the points that define the line.
     * @param pos2 The other point that defines the line.
     * @param radius The radius (thickness) of the line.
     * @param filled If false, only a shell will be generated.
     *
     * @return number of blocks affected
     * @throws MaxChangedBlocksException thrown if too many blocks are changed
     */
    public int drawLine(Pattern pattern, Vector pos1, Vector pos2, double radius, boolean filled)
            throws MaxChangedBlocksException {

        Set<Vector> vset = new HashSet<>();
        boolean notdrawn = true;

        int x1 = pos1.getBlockX(), y1 = pos1.getBlockY(), z1 = pos1.getBlockZ();
        int x2 = pos2.getBlockX(), y2 = pos2.getBlockY(), z2 = pos2.getBlockZ();
        int tipx = x1, tipy = y1, tipz = z1;
        int dx = Math.abs(x2 - x1), dy = Math.abs(y2 - y1), dz = Math.abs(z2 - z1);

        if (dx + dy + dz == 0) {
            vset.add(new Vector(tipx, tipy, tipz));
            notdrawn = false;
        }

        if (Math.max(Math.max(dx, dy), dz) == dx && notdrawn) {
            for (int domstep = 0; domstep <= dx; domstep++) {
                tipx = x1 + domstep * (x2 - x1 > 0 ? 1 : -1);
                tipy = (int) Math.round(y1 + domstep * ((double) dy) / ((double) dx) * (y2 - y1 > 0 ? 1 : -1));
                tipz = (int) Math.round(z1 + domstep * ((double) dz) / ((double) dx) * (z2 - z1 > 0 ? 1 : -1));

                vset.add(new Vector(tipx, tipy, tipz));
            }
            notdrawn = false;
        }

        if (Math.max(Math.max(dx, dy), dz) == dy && notdrawn) {
            for (int domstep = 0; domstep <= dy; domstep++) {
                tipy = y1 + domstep * (y2 - y1 > 0 ? 1 : -1);
                tipx = (int) Math.round(x1 + domstep * ((double) dx) / ((double) dy) * (x2 - x1 > 0 ? 1 : -1));
                tipz = (int) Math.round(z1 + domstep * ((double) dz) / ((double) dy) * (z2 - z1 > 0 ? 1 : -1));

                vset.add(new Vector(tipx, tipy, tipz));
            }
            notdrawn = false;
        }

        if (Math.max(Math.max(dx, dy), dz) == dz && notdrawn) {
            for (int domstep = 0; domstep <= dz; domstep++) {
                tipz = z1 + domstep * (z2 - z1 > 0 ? 1 : -1);
                tipy = (int) Math.round(y1 + domstep * ((double) dy) / ((double) dz) * (y2-y1>0 ? 1 : -1));
                tipx = (int) Math.round(x1 + domstep * ((double) dx) / ((double) dz) * (x2-x1>0 ? 1 : -1));

                vset.add(new Vector(tipx, tipy, tipz));
            }
            notdrawn = false;
        }

        vset = getBallooned(vset, radius);
        if (!filled) {
            vset = getHollowed(vset);
        }
        return setBlocks(vset, pattern);
    }

    /**
     * Draws a line (out of blocks) between two vectors.
     *
     * @param pattern The block pattern used to draw the line.
     * @param pos1 One of the points that define the line.
     * @param pos2 The other point that defines the line.
     * @param radius The radius (thickness) of the line.
     * @param filled If false, only a shell will be generated.
     *
     * @return number of blocks affected
     * @throws MaxChangedBlocksException thrown if too many blocks are changed
     */
    public int drawLine(Pattern pattern, Vector pos1, Vector pos2, double radius, boolean filled)
            throws MaxChangedBlocksException {

        Set<Vector> vset = new HashSet<Vector>();
        boolean notdrawn = true;

        int x1 = pos1.getBlockX(), y1 = pos1.getBlockY(), z1 = pos1.getBlockZ();
        int x2 = pos2.getBlockX(), y2 = pos2.getBlockY(), z2 = pos2.getBlockZ();
        int tipx = x1, tipy = y1, tipz = z1;
        int dx = Math.abs(x2 - x1), dy = Math.abs(y2 - y1), dz = Math.abs(z2 - z1);

        if (dx + dy + dz == 0) {
            vset.add(new Vector(tipx, tipy, tipz));
            notdrawn = false;
        }

        if (Math.max(Math.max(dx, dy), dz) == dx && notdrawn) {
            for (int domstep = 0; domstep <= dx; domstep++) {
                tipx = x1 + domstep * (x2 - x1 > 0 ? 1 : -1);
                tipy = (int) Math.round(y1 + domstep * ((double) dy) / ((double) dx) * (y2 - y1 > 0 ? 1 : -1));
                tipz = (int) Math.round(z1 + domstep * ((double) dz) / ((double) dx) * (z2 - z1 > 0 ? 1 : -1));

                vset.add(new Vector(tipx, tipy, tipz));
            }
            notdrawn = false;
        }

        if (Math.max(Math.max(dx, dy), dz) == dy && notdrawn) {
            for (int domstep = 0; domstep <= dy; domstep++) {
                tipy = y1 + domstep * (y2 - y1 > 0 ? 1 : -1);
                tipx = (int) Math.round(x1 + domstep * ((double) dx) / ((double) dy) * (x2 - x1 > 0 ? 1 : -1));
                tipz = (int) Math.round(z1 + domstep * ((double) dz) / ((double) dy) * (z2 - z1 > 0 ? 1 : -1));

                vset.add(new Vector(tipx, tipy, tipz));
            }
            notdrawn = false;
        }

        if (Math.max(Math.max(dx, dy), dz) == dz && notdrawn) {
            for (int domstep = 0; domstep <= dz; domstep++) {
                tipz = z1 + domstep * (z2 - z1 > 0 ? 1 : -1);
                tipy = (int) Math.round(y1 + domstep * ((double) dy) / ((double) dz) * (y2-y1>0 ? 1 : -1));
                tipx = (int) Math.round(x1 + domstep * ((double) dx) / ((double) dz) * (x2-x1>0 ? 1 : -1));

                vset.add(new Vector(tipx, tipy, tipz));
            }
            notdrawn = false;
        }

        vset = getBallooned(vset, radius);
        if (!filled) {
            vset = getHollowed(vset);
        }
        return setBlocks(vset, pattern);
    }

Replace Generic With Diamond HashSet<Vector> with HashSet<> in method public drawLine(pattern Pattern, pos1 Vector, pos2 Vector, radius double, filled boolean) : int from class com.sk89q.worldedit.EditSession


    private static Set<Vector> getBallooned(Set<Vector> vset, double radius) {
        Set<Vector> returnset = new HashSet<>();
        int ceilrad = (int) Math.ceil(radius);

        for (Vector v : vset) {
            int tipx = v.getBlockX(), tipy = v.getBlockY(), tipz = v.getBlockZ();

            for (int loopx = tipx - ceilrad; loopx <= tipx + ceilrad; loopx++) {
                for (int loopy = tipy - ceilrad; loopy <= tipy + ceilrad; loopy++) {
                    for (int loopz = tipz - ceilrad; loopz <= tipz + ceilrad; loopz++) {
                        if (hypot(loopx - tipx, loopy - tipy, loopz - tipz) <= radius) {
                            returnset.add(new Vector(loopx, loopy, loopz));
                        }
                    }
                }
            }
        }
        return returnset;
    }

    private static Set<Vector> getBallooned(Set<Vector> vset, double radius) {
        Set<Vector> returnset = new HashSet<Vector>();
        int ceilrad = (int) Math.ceil(radius);

        for (Vector v : vset) {
            int tipx = v.getBlockX(), tipy = v.getBlockY(), tipz = v.getBlockZ();

            for (int loopx = tipx - ceilrad; loopx <= tipx + ceilrad; loopx++) {
                for (int loopy = tipy - ceilrad; loopy <= tipy + ceilrad; loopy++) {
                    for (int loopz = tipz - ceilrad; loopz <= tipz + ceilrad; loopz++) {
                        if (hypot(loopx - tipx, loopy - tipy, loopz - tipz) <= radius) {
                            returnset.add(new Vector(loopx, loopy, loopz));
                        }
                    }
                }
            }
        }
        return returnset;
    }

Replace Generic With Diamond HashSet<Vector> with HashSet<> in method private getBallooned(vset Set<Vector>, radius double) : Set<Vector> from class com.sk89q.worldedit.EditSession


    private static Set<Vector> getHollowed(Set<Vector> vset) {
        Set<Vector> returnset = new HashSet<>();
        for (Vector v : vset) {
            double x = v.getX(), y = v.getY(), z = v.getZ();
            if (!(vset.contains(new Vector(x + 1, y, z)) &&
            vset.contains(new Vector(x - 1, y, z)) &&
            vset.contains(new Vector(x, y + 1, z)) &&
            vset.contains(new Vector(x, y - 1, z)) &&
            vset.contains(new Vector(x, y, z + 1)) &&
            vset.contains(new Vector(x, y, z - 1)))) {
                returnset.add(v);
            }
        }
        return returnset;
    }

    private static Set<Vector> getHollowed(Set<Vector> vset) {
        Set<Vector> returnset = new HashSet<Vector>();
        for (Vector v : vset) {
            double x = v.getX(), y = v.getY(), z = v.getZ();
            if (!(vset.contains(new Vector(x + 1, y, z)) &&
            vset.contains(new Vector(x - 1, y, z)) &&
            vset.contains(new Vector(x, y + 1, z)) &&
            vset.contains(new Vector(x, y - 1, z)) &&
            vset.contains(new Vector(x, y, z + 1)) &&
            vset.contains(new Vector(x, y, z - 1)))) {
                returnset.add(v);
            }
        }
        return returnset;
    }

Replace Generic With Diamond HashSet<Vector> with HashSet<> in method private getHollowed(vset Set<Vector>) : Set<Vector> from class com.sk89q.worldedit.EditSession


            @Override
            public void execute(EditSession es) {
                try {
                    Snapshot snapshot;

                    if (args.argsLength() > 0) {
                        try {
                            snapshot = config.snapshotRepo.getSnapshot(args.getString(0));
                        } catch (InvalidSnapshotException e) {
                            player.printError("That snapshot does not exist or is not available.");
                            return;
                        }
                    } else {
                        snapshot = session.getSnapshot();
                    }

                    // No snapshot set?
                    if (snapshot == null) {
                        try {
                            snapshot = config.snapshotRepo.getDefaultSnapshot(player.getWorld().getName());

                            if (snapshot == null) {
                                player.printError("No snapshots were found. See console for details.");

                                // Okay, let's toss some debugging information!
                                File dir = config.snapshotRepo.getDirectory();

                                try {
                                    logger.info("WorldEdit found no snapshots: looked in: "
                                            + dir.getCanonicalPath());
                                } catch (IOException e) {
                                    logger.info("WorldEdit found no snapshots: looked in "
                                            + "(NON-RESOLVABLE PATH - does it exist?): "
                                            + dir.getPath());
                                }

                                return;
                            }
                        } catch (MissingWorldException ex) {
                            player.printError("No snapshots were found for this world.");
                            return;
                        }
                    }

                    ChunkStore chunkStore = null;

                    // Load chunk store
                    try {
                        chunkStore = snapshot.getChunkStore();
                        player.print("Snapshot '" + snapshot.getName() + "' loaded; now restoring...");
                    } catch (DataException | IOException e) {
                        player.printError("Failed to load snapshot: " + e.getMessage());
                        return;
                    }

                    try {
                        // Restore snapshot
                        SnapshotRestore restore = new SnapshotRestore(chunkStore, editSession, region);
                        //player.print(restore.getChunksAffected() + " chunk(s) will be loaded.");

                        restore.restore();

                        if (restore.hadTotalFailure()) {
                            String error = restore.getLastErrorMessage();
                            if (error != null) {
                                player.printError("Errors prevented any blocks from being restored.");
                                player.printError("Last error: " + error);
                            } else {
                                player.printError("No chunks could be loaded. (Bad archive?)");
                            }
                        } else {
                            player.print(String.format("Restored; %d "
                                    + "missing chunks and %d other errors.",
                                    restore.getMissingChunks().size(),
                                    restore.getErrorChunks().size()));
                        }
                    } finally {
                        try {
                            chunkStore.close();
                        } catch (IOException ignored) {
                        }
                    }
                } catch (WorldEditException ex) {
                    player.printError("Error while executing Smooth.");
                }
            }

            @Override
            public void execute(EditSession es) {
                try {
                    Snapshot snapshot;

                    if (args.argsLength() > 0) {
                        try {
                            snapshot = config.snapshotRepo.getSnapshot(args.getString(0));
                        } catch (InvalidSnapshotException e) {
                            player.printError("That snapshot does not exist or is not available.");
                            return;
                        }
                    } else {
                        snapshot = session.getSnapshot();
                    }

                    // No snapshot set?
                    if (snapshot == null) {
                        try {
                            snapshot = config.snapshotRepo.getDefaultSnapshot(player.getWorld().getName());

                            if (snapshot == null) {
                                player.printError("No snapshots were found. See console for details.");

                                // Okay, let's toss some debugging information!
                                File dir = config.snapshotRepo.getDirectory();

                                try {
                                    logger.info("WorldEdit found no snapshots: looked in: "
                                            + dir.getCanonicalPath());
                                } catch (IOException e) {
                                    logger.info("WorldEdit found no snapshots: looked in "
                                            + "(NON-RESOLVABLE PATH - does it exist?): "
                                            + dir.getPath());
                                }

                                return;
                            }
                        } catch (MissingWorldException ex) {
                            player.printError("No snapshots were found for this world.");
                            return;
                        }
                    }

                    ChunkStore chunkStore = null;

                    // Load chunk store
                    try {
                        chunkStore = snapshot.getChunkStore();
                        player.print("Snapshot '" + snapshot.getName() + "' loaded; now restoring...");
                    } catch (DataException e) {
                        player.printError("Failed to load snapshot: " + e.getMessage());
                        return;
                    } catch (IOException e) {
                        player.printError("Failed to load snapshot: " + e.getMessage());
                        return;
                    }

                    try {
                        // Restore snapshot
                        SnapshotRestore restore = new SnapshotRestore(chunkStore, editSession, region);
                        //player.print(restore.getChunksAffected() + " chunk(s) will be loaded.");

                        restore.restore();

                        if (restore.hadTotalFailure()) {
                            String error = restore.getLastErrorMessage();
                            if (error != null) {
                                player.printError("Errors prevented any blocks from being restored.");
                                player.printError("Last error: " + error);
                            } else {
                                player.printError("No chunks could be loaded. (Bad archive?)");
                            }
                        } else {
                            player.print(String.format("Restored; %d "
                                    + "missing chunks and %d other errors.",
                                    restore.getMissingChunks().size(),
                                    restore.getErrorChunks().size()));
                        }
                    } finally {
                        try {
                            chunkStore.close();
                        } catch (IOException ignored) {
                        }
                    }
                } catch (WorldEditException ex) {
                    player.printError("Error while executing Smooth.");
                }
            }

Merge Catch [catch(DataException e), catch(IOException e)] to catch(DataException|IOException e) in method public execute(es EditSession) : void from class com.sk89q.worldedit.command.SnapshotUtilCommands.restore.executeJob.new IEditSessionJob


    /**
     * Initialize reference parame (in and out value)
     *
     * @param <T>
     * @param value
     * @return
     */
    public static <T> InOutParam<T> Ref(T value) {
        return new InOutParam<>(value);
    }

    /**
     * Initialize reference parame (in and out value)
     *
     * @param <T>
     * @param value
     * @return
     */
    public static <T> InOutParam<T> Ref(T value) {
        return new InOutParam<T>(value);
    }

Replace Generic With Diamond InOutParam<T> with InOutParam<> in method public Ref(value T) : InOutParam<T> from class org.primesoft.asyncworldedit.utils.InOutParam


    /**
     * Initialize output param (out only)
     *
     * @param <T>
     * @return
     */
    public static <T> InOutParam<T> Out() {
        return new InOutParam<>();
    }

    /**
     * Initialize output param (out only)
     *
     * @param <T>
     * @return
     */
    public static <T> InOutParam<T> Out() {
        return new InOutParam<T>();
    }

Replace Generic With Diamond InOutParam<T> with InOutParam<> in method public Out() : InOutParam<T> from class org.primesoft.asyncworldedit.utils.InOutParam