diff --git a/Plan/src/main/java/com/djrapitops/plan/system/listeners/bukkit/PlayerOnlineListener.java b/Plan/src/main/java/com/djrapitops/plan/system/listeners/bukkit/PlayerOnlineListener.java index 23d34756a..7a3db9509 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/listeners/bukkit/PlayerOnlineListener.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/listeners/bukkit/PlayerOnlineListener.java @@ -8,6 +8,7 @@ import com.djrapitops.plan.system.processing.processors.info.PlayerPageUpdatePro import com.djrapitops.plan.system.processing.processors.player.*; import com.djrapitops.plugin.api.systems.NotificationCenter; import com.djrapitops.plugin.api.utility.log.Log; +import com.djrapitops.plugin.task.RunnableFactory; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -96,7 +97,7 @@ public class PlayerOnlineListener implements Listener { SessionCache.getInstance().cacheSession(uuid, new Session(uuid, time, world, gm)); - Processing.submit( + RunnableFactory.createNew("Player Register: " + uuid, new RegisterProcessor(uuid, player::getFirstPlayed, playerName, new IPUpdateProcessor(uuid, address, time), new NameProcessor(uuid, playerName, displayName), diff --git a/Plan/src/main/java/com/djrapitops/plan/system/listeners/sponge/SpongePlayerListener.java b/Plan/src/main/java/com/djrapitops/plan/system/listeners/sponge/SpongePlayerListener.java index a302f2bd2..3742c8ff8 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/listeners/sponge/SpongePlayerListener.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/listeners/sponge/SpongePlayerListener.java @@ -8,6 +8,7 @@ import com.djrapitops.plan.system.processing.processors.info.PlayerPageUpdatePro import com.djrapitops.plan.system.processing.processors.player.*; import com.djrapitops.plugin.api.systems.NotificationCenter; import com.djrapitops.plugin.api.utility.log.Log; +import com.djrapitops.plugin.task.RunnableFactory; import org.spongepowered.api.Sponge; import org.spongepowered.api.data.key.Keys; import org.spongepowered.api.entity.living.player.Player; @@ -99,7 +100,7 @@ public class SpongePlayerListener { SessionCache.getInstance().cacheSession(uuid, new Session(uuid, time, world, gm)); - Processing.submit( + RunnableFactory.createNew("Player Register: " + uuid, new RegisterProcessor(uuid, () -> time, playerName, new IPUpdateProcessor(uuid, address, time), new NameProcessor(uuid, playerName, displayName), diff --git a/Plan/src/main/java/com/djrapitops/plan/system/processing/processors/player/RegisterProcessor.java b/Plan/src/main/java/com/djrapitops/plan/system/processing/processors/player/RegisterProcessor.java index 2cc024848..c0487ebee 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/processing/processors/player/RegisterProcessor.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/processing/processors/player/RegisterProcessor.java @@ -5,8 +5,8 @@ package com.djrapitops.plan.system.processing.processors.player; import com.djrapitops.plan.system.database.databases.Database; -import com.djrapitops.plan.system.processing.CriticalRunnable; import com.djrapitops.plan.system.processing.Processing; +import com.djrapitops.plugin.task.AbsRunnable; import com.djrapitops.plugin.utilities.Verify; import java.util.UUID; @@ -17,7 +17,7 @@ import java.util.function.Supplier; * * @author Rsl1122 */ -public class RegisterProcessor implements CriticalRunnable { +public class RegisterProcessor extends AbsRunnable { private final UUID uuid; private final Supplier registered; @@ -25,6 +25,7 @@ public class RegisterProcessor implements CriticalRunnable { private final Runnable[] afterProcess; public RegisterProcessor(UUID uuid, Supplier registered, String name, Runnable... afterProcess) { + super(RegisterProcessor.class.getSimpleName()); this.uuid = uuid; this.registered = registered; this.name = name; @@ -46,6 +47,7 @@ public class RegisterProcessor implements CriticalRunnable { for (Runnable runnable : afterProcess) { Processing.submit(runnable); } + cancel(); } } }