Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-24 18:10:08 +01:00
Simplify further as using ConcurrentHashMap
Dieser Commit ist enthalten in:
Ursprung
197e08a937
Commit
88e64a0632
@ -19,26 +19,16 @@ public class BukkitPermissionAttachmentManager {
|
||||
if (p == null) {
|
||||
return null;
|
||||
}
|
||||
PermissionAttachment attachment = attachments.get(p);
|
||||
|
||||
if (attachment != null) {
|
||||
return attachment;
|
||||
}
|
||||
|
||||
synchronized (this) {
|
||||
return attachments.computeIfAbsent(p, k -> k.addAttachment(plugin));
|
||||
}
|
||||
}
|
||||
|
||||
public void removeAttachment(@Nullable final Player p) {
|
||||
if (p == null || attachments.get(p) == null) {
|
||||
if (p == null) {
|
||||
return;
|
||||
}
|
||||
synchronized (this) {
|
||||
PermissionAttachment attach = attachments.remove(p);
|
||||
if (attach != null) {
|
||||
p.removeAttachment(attach);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren