diff --git a/bukkit/src/main/java/me/lucko/luckperms/BukkitSenderFactory.java b/bukkit/src/main/java/me/lucko/luckperms/BukkitSenderFactory.java index 219f1ed46..a5c8a6785 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/BukkitSenderFactory.java +++ b/bukkit/src/main/java/me/lucko/luckperms/BukkitSenderFactory.java @@ -34,8 +34,8 @@ import java.util.UUID; @NoArgsConstructor(access = AccessLevel.PRIVATE) public class BukkitSenderFactory extends SenderFactory { private static BukkitSenderFactory instance = null; - public static BukkitSenderFactory get() { - if (instance == null){ + public static synchronized BukkitSenderFactory get() { + if (instance == null) { instance = new BukkitSenderFactory(); } return instance; diff --git a/bungee/src/main/java/me/lucko/luckperms/BungeeSenderFactory.java b/bungee/src/main/java/me/lucko/luckperms/BungeeSenderFactory.java index 8c04aba83..10a865607 100644 --- a/bungee/src/main/java/me/lucko/luckperms/BungeeSenderFactory.java +++ b/bungee/src/main/java/me/lucko/luckperms/BungeeSenderFactory.java @@ -35,8 +35,8 @@ import java.util.UUID; @NoArgsConstructor(access = AccessLevel.PRIVATE) public class BungeeSenderFactory extends SenderFactory { private static BungeeSenderFactory instance = null; - public static BungeeSenderFactory get() { - if (instance == null){ + public static synchronized BungeeSenderFactory get() { + if (instance == null) { instance = new BungeeSenderFactory(); } return instance; diff --git a/sponge/src/main/java/me/lucko/luckperms/SpongeSenderFactory.java b/sponge/src/main/java/me/lucko/luckperms/SpongeSenderFactory.java index 2bf7dccd2..d02ed84cf 100644 --- a/sponge/src/main/java/me/lucko/luckperms/SpongeSenderFactory.java +++ b/sponge/src/main/java/me/lucko/luckperms/SpongeSenderFactory.java @@ -35,8 +35,8 @@ import java.util.UUID; @NoArgsConstructor(access = AccessLevel.PRIVATE) public class SpongeSenderFactory extends SenderFactory { private static SpongeSenderFactory instance = null; - public static SpongeSenderFactory get() { - if (instance == null){ + public static synchronized SpongeSenderFactory get() { + if (instance == null) { instance = new SpongeSenderFactory(); } return instance;