Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.concurrent.Executor;

/**
* Proxies small framework specific actions.
*/
Expand Down Expand Up @@ -37,19 +39,31 @@ public interface ProxyService {
@Nullable <L> Position toPosition(@Nullable L location);

/**
* Runs an async task.
*
* @param runnable Runnable.
* Deprecated. Use getAsyncExecutor().execute instead.
*/
@Deprecated
void runAsyncTask(@NotNull Runnable runnable);

/**
* Runs a sync task.
*
* @param runnable Runnable.
* Deprecated. Use getSyncExecutor().execute instead.
*/
@Deprecated
void runSyncTask(@NotNull Runnable runnable);

/**
* Gets an execute to schedule tasks on the synchronous bukkit thread.
*
* @return {@link Executor}.
*/
Executor getSyncExecutor();

/**
* Gets an execute to schedule tasks on the asynchronous bukkit threadPool.
*
* @return {@link Executor}.
*/
Executor getAsyncExecutor();

/**
* Gets the running minecraft version.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down Expand Up @@ -94,6 +95,26 @@ public void runSyncTask(@NotNull Runnable runnable) {
concurrentList.add(runnable);
}

/**
* Gets an execute to schedule tasks on the synchronous bukkit thread.
*
* @return {@link Executor}.
*/
@Override
public Executor getSyncExecutor() {
return c -> concurrentList.add(c);
}

/**
* Gets an execute to schedule tasks on the asynchronous bukkit threadPool.
*
* @return {@link Executor}.
*/
@Override
public Executor getAsyncExecutor() {
return executor;
}

/**
* Gets the running minecraft version.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down Expand Up @@ -94,6 +95,26 @@ public void runSyncTask(@NotNull Runnable runnable) {
concurrentList.add(runnable);
}

/**
* Gets an execute to schedule tasks on the synchronous bukkit thread.
*
* @return {@link Executor}.
*/
@Override
public Executor getSyncExecutor() {
return c -> concurrentList.add(c);
}

/**
* Gets an execute to schedule tasks on the asynchronous bukkit threadPool.
*
* @return {@link Executor}.
*/
@Override
public Executor getAsyncExecutor() {
return executor;
}

/**
* Gets the running minecraft version.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down Expand Up @@ -94,6 +95,26 @@ public void runSyncTask(@NotNull Runnable runnable) {
concurrentList.add(runnable);
}

/**
* Gets an execute to schedule tasks on the synchronous bukkit thread.
*
* @return {@link Executor}.
*/
@Override
public Executor getSyncExecutor() {
return c -> concurrentList.add(c);
}

/**
* Gets an execute to schedule tasks on the asynchronous bukkit threadPool.
*
* @return {@link Executor}.
*/
@Override
public Executor getAsyncExecutor() {
return executor;
}

/**
* Gets the running minecraft version.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down Expand Up @@ -94,6 +95,26 @@ public void runSyncTask(@NotNull Runnable runnable) {
concurrentList.add(runnable);
}

/**
* Gets an execute to schedule tasks on the synchronous bukkit thread.
*
* @return {@link Executor}.
*/
@Override
public Executor getSyncExecutor() {
return c -> concurrentList.add(c);
}

/**
* Gets an execute to schedule tasks on the asynchronous bukkit threadPool.
*
* @return {@link Executor}.
*/
@Override
public Executor getAsyncExecutor() {
return executor;
}

/**
* Gets the running minecraft version.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down Expand Up @@ -94,6 +95,26 @@ public void runSyncTask(@NotNull Runnable runnable) {
concurrentList.add(runnable);
}

/**
* Gets an execute to schedule tasks on the synchronous bukkit thread.
*
* @return {@link Executor}.
*/
@Override
public Executor getSyncExecutor() {
return c -> concurrentList.add(c);
}

/**
* Gets an execute to schedule tasks on the asynchronous bukkit threadPool.
*
* @return {@link Executor}.
*/
@Override
public Executor getAsyncExecutor() {
return executor;
}

/**
* Gets the running minecraft version.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down Expand Up @@ -94,6 +95,26 @@ public void runSyncTask(@NotNull Runnable runnable) {
concurrentList.add(runnable);
}

/**
* Gets an execute to schedule tasks on the synchronous bukkit thread.
*
* @return {@link Executor}.
*/
@Override
public Executor getSyncExecutor() {
return c -> concurrentList.add(c);
}

/**
* Gets an execute to schedule tasks on the asynchronous bukkit threadPool.
*
* @return {@link Executor}.
*/
@Override
public Executor getAsyncExecutor() {
return executor;
}

/**
* Gets the running minecraft version.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down Expand Up @@ -94,6 +95,26 @@ public void runSyncTask(@NotNull Runnable runnable) {
concurrentList.add(runnable);
}

/**
* Gets an execute to schedule tasks on the synchronous bukkit thread.
*
* @return {@link Executor}.
*/
@Override
public Executor getSyncExecutor() {
return c -> concurrentList.add(c);
}

/**
* Gets an execute to schedule tasks on the asynchronous bukkit threadPool.
*
* @return {@link Executor}.
*/
@Override
public Executor getAsyncExecutor() {
return executor;
}

/**
* Gets the running minecraft version.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down Expand Up @@ -94,6 +95,26 @@ public void runSyncTask(@NotNull Runnable runnable) {
concurrentList.add(runnable);
}

/**
* Gets an execute to schedule tasks on the synchronous bukkit thread.
*
* @return {@link Executor}.
*/
@Override
public Executor getSyncExecutor() {
return c -> concurrentList.add(c);
}

/**
* Gets an execute to schedule tasks on the asynchronous bukkit threadPool.
*
* @return {@link Executor}.
*/
@Override
public Executor getAsyncExecutor() {
return executor;
}

/**
* Gets the running minecraft version.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down Expand Up @@ -94,6 +95,26 @@ public void runSyncTask(@NotNull Runnable runnable) {
concurrentList.add(runnable);
}

/**
* Gets an execute to schedule tasks on the synchronous bukkit thread.
*
* @return {@link Executor}.
*/
@Override
public Executor getSyncExecutor() {
return c -> concurrentList.add(c);
}

/**
* Gets an execute to schedule tasks on the asynchronous bukkit threadPool.
*
* @return {@link Executor}.
*/
@Override
public Executor getAsyncExecutor() {
return executor;
}

/**
* Gets the running minecraft version.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down Expand Up @@ -74,6 +75,26 @@ public class MockedProxyService implements ProxyService {
return position;
}

/**
* Gets an execute to schedule tasks on the synchronous bukkit thread.
*
* @return {@link Executor}.
*/
@Override
public Executor getSyncExecutor() {
return c -> concurrentList.add(c);
}

/**
* Gets an execute to schedule tasks on the asynchronous bukkit threadPool.
*
* @return {@link Executor}.
*/
@Override
public Executor getAsyncExecutor() {
return executor;
}

/**
* Runs an async task.
*
Expand Down
Loading