From 1c759b24766d88eeff1c2da62382686f5af32e6c Mon Sep 17 00:00:00 2001 From: HaHaWTH Date: Mon, 25 Mar 2024 16:31:03 +0800 Subject: [PATCH] Fix async potion effect --- .../java/fr/xephi/authme/process/join/AsynchronousJoin.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java b/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java index a8113c18..911a1d20 100644 --- a/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java +++ b/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java @@ -189,7 +189,9 @@ public class AsynchronousJoin implements AsynchronousProcess { if (service.getProperty(RegistrationSettings.APPLY_BLIND_EFFECT)) { // Allow infinite blindness effect int blindTimeOut = (registrationTimeout <= 0) ? 99999 : registrationTimeout; - player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, blindTimeOut, 2)); + bukkitService.runTask(() -> { + player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, blindTimeOut, 2)); + }); } commandManager.runCommandsOnJoin(player); });