Maybe fix race condition with messages not sending

This commit is contained in:
Luck 2016-09-10 14:31:42 +01:00
parent e79b7c7023
commit 31884ea59d
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
3 changed files with 6 additions and 6 deletions

View File

@ -34,8 +34,8 @@ import java.util.UUID;
@NoArgsConstructor(access = AccessLevel.PRIVATE) @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class BukkitSenderFactory extends SenderFactory<CommandSender> { public class BukkitSenderFactory extends SenderFactory<CommandSender> {
private static BukkitSenderFactory instance = null; private static BukkitSenderFactory instance = null;
public static BukkitSenderFactory get() { public static synchronized BukkitSenderFactory get() {
if (instance == null){ if (instance == null) {
instance = new BukkitSenderFactory(); instance = new BukkitSenderFactory();
} }
return instance; return instance;

View File

@ -35,8 +35,8 @@ import java.util.UUID;
@NoArgsConstructor(access = AccessLevel.PRIVATE) @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class BungeeSenderFactory extends SenderFactory<CommandSender> { public class BungeeSenderFactory extends SenderFactory<CommandSender> {
private static BungeeSenderFactory instance = null; private static BungeeSenderFactory instance = null;
public static BungeeSenderFactory get() { public static synchronized BungeeSenderFactory get() {
if (instance == null){ if (instance == null) {
instance = new BungeeSenderFactory(); instance = new BungeeSenderFactory();
} }
return instance; return instance;

View File

@ -35,8 +35,8 @@ import java.util.UUID;
@NoArgsConstructor(access = AccessLevel.PRIVATE) @NoArgsConstructor(access = AccessLevel.PRIVATE)
public class SpongeSenderFactory extends SenderFactory<CommandSource> { public class SpongeSenderFactory extends SenderFactory<CommandSource> {
private static SpongeSenderFactory instance = null; private static SpongeSenderFactory instance = null;
public static SpongeSenderFactory get() { public static synchronized SpongeSenderFactory get() {
if (instance == null){ if (instance == null) {
instance = new SpongeSenderFactory(); instance = new SpongeSenderFactory();
} }
return instance; return instance;