geforkt von Mirrors/FastAsyncWorldEdit
Allow nullable BukkitPlayers for whatever reason WorldGuard needs them for I guess? (#706)
Dieser Commit ist enthalten in:
Ursprung
b86e452b80
Commit
5508b415c9
@ -67,6 +67,7 @@ import java.util.Locale;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
public class BukkitPlayer extends AbstractPlayerActor {
|
public class BukkitPlayer extends AbstractPlayerActor {
|
||||||
@ -74,19 +75,29 @@ public class BukkitPlayer extends AbstractPlayerActor {
|
|||||||
private final Player player;
|
private final Player player;
|
||||||
private final WorldEditPlugin plugin;
|
private final WorldEditPlugin plugin;
|
||||||
private final PermissionAttachment permAttachment;
|
private final PermissionAttachment permAttachment;
|
||||||
|
/**
|
||||||
public BukkitPlayer(Player player) {
|
* This constructs a new {@link BukkitPlayer} for the given {@link Player}.
|
||||||
super(getExistingMap(WorldEditPlugin.getInstance(), player));
|
*
|
||||||
|
* @param player The corresponding {@link Player} or null if you need a null WorldEdit player for some reason.
|
||||||
|
*/
|
||||||
|
public BukkitPlayer(@Nullable Player player) {
|
||||||
|
super(player != null ? getExistingMap(WorldEditPlugin.getInstance(), player) : new ConcurrentHashMap<>());
|
||||||
this.plugin = WorldEditPlugin.getInstance();
|
this.plugin = WorldEditPlugin.getInstance();
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.permAttachment = plugin.getPermissionAttachmentManager().getOrAddAttachment(player);
|
this.permAttachment = plugin.getPermissionAttachmentManager().getOrAddAttachment(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BukkitPlayer(WorldEditPlugin plugin, Player player) {
|
/**
|
||||||
|
* This constructs a new {@link BukkitPlayer} for the given {@link Player}.
|
||||||
|
*
|
||||||
|
* @param plugin The running instance of {@link WorldEditPlugin}
|
||||||
|
* @param player The corresponding {@link Player} or null if you need a null WorldEdit player for some reason.
|
||||||
|
*/
|
||||||
|
public BukkitPlayer(@Nonnull WorldEditPlugin plugin, @Nullable Player player) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.permAttachment = plugin.getPermissionAttachmentManager().getOrAddAttachment(player);
|
this.permAttachment = plugin.getPermissionAttachmentManager().getOrAddAttachment(player);
|
||||||
if (Settings.IMP.CLIPBOARD.USE_DISK) {
|
if (player != null && Settings.IMP.CLIPBOARD.USE_DISK) {
|
||||||
loadClipboardFromDisk();
|
loadClipboardFromDisk();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren