From 59c7efccb230acdc4dcdd40ec67c35951203ac7e Mon Sep 17 00:00:00 2001 From: Luck Date: Sun, 13 Nov 2016 09:44:34 +0000 Subject: [PATCH] Fix Sponge plugin guice load failure. Thanks @gravityfox --- .../me/lucko/luckperms/sponge/LPSpongePlugin.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java b/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java index da2692ba..89c55879 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/LPSpongePlugin.java @@ -67,7 +67,10 @@ import org.spongepowered.api.event.game.state.GamePreInitializationEvent; import org.spongepowered.api.event.game.state.GameStoppingServerEvent; import org.spongepowered.api.plugin.Dependency; import org.spongepowered.api.plugin.Plugin; +import org.spongepowered.api.scheduler.AsynchronousExecutor; import org.spongepowered.api.scheduler.Scheduler; +import org.spongepowered.api.scheduler.SpongeExecutorService; +import org.spongepowered.api.scheduler.SynchronousExecutor; import org.spongepowered.api.service.permission.PermissionDescription; import org.spongepowered.api.service.permission.PermissionService; import org.spongepowered.api.service.permission.Subject; @@ -77,7 +80,6 @@ import java.io.File; import java.nio.file.Path; import java.util.*; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @@ -106,8 +108,15 @@ public class LPSpongePlugin implements LuckPermsPlugin { private Path configDir; private Scheduler scheduler = Sponge.getScheduler(); - private Executor syncExecutor = Sponge.getScheduler().createSyncExecutor(this); - private Executor asyncExecutor = Sponge.getScheduler().createAsyncExecutor(this); + + @Inject + @SynchronousExecutor + private SpongeExecutorService syncExecutor; + + @Inject + @AsynchronousExecutor + private SpongeExecutorService asyncExecutor; + private LPTimings timings; private final Set ignoringLogs = ConcurrentHashMap.newKeySet();