本文整理汇总了Java中org.spongepowered.api.entity.living.player.Player.getUniqueId方法的典型用法代码示例。如果您正苦于以下问题:Java Player.getUniqueId方法的具体用法?Java Player.getUniqueId怎么用?Java Player.getUniqueId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.spongepowered.api.entity.living.player.Player
的用法示例。
在下文中一共展示了Player.getUniqueId方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPlayerJoin
import org.spongepowered.api.entity.living.player.Player; //导入方法依赖的package包/类
@Listener
public void onPlayerJoin(ClientConnectionEvent.Join event, @Root Player player) {
if (!player.hasPermission("iplog.bypasslogging")) {
final Storage storage = IPLog.getPlugin().getStorage();
final InetAddress ip = player.getConnection().getAddress().getAddress();
final UUID uuid = player.getUniqueId();
final LocalDateTime time = LocalDateTime.now();
if (storage.isPresent(ip, uuid)) {
storage.updateConnection(ip, uuid, time);
} else {
storage.addConnection(ip, uuid, time);
}
}
}
示例2: createInventory
import org.spongepowered.api.entity.living.player.Player; //导入方法依赖的package包/类
public Inventory createInventory(Player player)
{
UUID uuid = player.getUniqueId();
if (!inventories.containsKey(uuid))
{
VirtualChestEventListener listener = new VirtualChestEventListener(player);
Inventory chestInventory = Inventory.builder().of(InventoryArchetypes.CHEST).withCarrier(player)
.property(InventoryTitle.PROPERTY_NAME, new InventoryTitle(this.title))
.property(InventoryDimension.PROPERTY_NAME, new InventoryDimension(9, this.height))
.listener(ClickInventoryEvent.class, listener::fireClickEvent)
.listener(InteractInventoryEvent.Open.class, listener::fireOpenEvent)
.listener(InteractInventoryEvent.Close.class, listener::fireCloseEvent)
.build(this.plugin);
inventories.put(uuid, chestInventory);
return chestInventory;
}
return inventories.get(uuid);
}
示例3: LoadedRegion
import org.spongepowered.api.entity.living.player.Player; //导入方法依赖的package包/类
public LoadedRegion(Region region, Player owner, ChunkType type) {
this.epoch = Date.from(Instant.now());
this.owner = owner.getUniqueId();
this.id = UUID.randomUUID();
this.region = region;
this.type = type;
}
示例4: onPlayerJoin
import org.spongepowered.api.entity.living.player.Player; //导入方法依赖的package包/类
@Listener
public void onPlayerJoin(ClientConnectionEvent.Join event)
throws IOException, ClassNotFoundException, DataFormatException {
@NonNull
Player player = event.getTargetEntity();
UUID uuid = player.getUniqueId();
synchronized (waitingPlayers) {
Task task = Task.builder()
.execute(new WaitingForPreviousServerToFinish(player, Config.Values.Global.getMaxWait()))
.intervalTicks(1).submit(InventorySync.getInstance());
waitingPlayers.put(uuid, task);
}
}
示例5: onPlayerLeave
import org.spongepowered.api.entity.living.player.Player; //导入方法依赖的package包/类
@Listener
public void onPlayerLeave(ClientConnectionEvent.Disconnect event) throws IOException {
@NonNull
Player player = event.getTargetEntity();
UUID uuid = player.getUniqueId();
savePlayer(player);
synchronized (waitingPlayers) {
if (waitingPlayers.containsKey(uuid)) {
waitingPlayers.remove(uuid).cancel();
}
}
}
示例6: getCommandSender
import org.spongepowered.api.entity.living.player.Player; //导入方法依赖的package包/类
private CommandSender getCommandSender(CommandSource commandSource) {
if (commandSource instanceof Player) {
Player player = (Player) commandSource;
UUID uuid = player.getUniqueId();
ClanPlayerImpl clanPlayer = ClansImpl.getInstance().getClanPlayer(uuid);
if (clanPlayer == null) {
clanPlayer = ClansImpl.getInstance().createClanPlayer(uuid, player.getName());
}
return clanPlayer;
}
return null;
}
示例7: onBlockPlace
import org.spongepowered.api.entity.living.player.Player; //导入方法依赖的package包/类
@Listener(order = Order.POST)
public void onBlockPlace(ChangeBlockEvent.Place e, @Root Player p) {
long time = new Date().getTime();
for (Transaction<BlockSnapshot> transaction : e.getTransactions()) {
UUID id = p.getUniqueId();
if (transaction.getOriginal().getState().getType() != BlockTypes.AIR) {
db.addToQueue(new BlockQueueEntry(transaction.getOriginal(), ActionType.DESTROY, id.toString(), time));
}
db.addToQueue(new BlockQueueEntry(transaction.getFinal(), ActionType.PLACE, id.toString(), time));
}
}
示例8: VirtualChestEventListener
import org.spongepowered.api.entity.living.player.Player; //导入方法依赖的package包/类
private VirtualChestEventListener(Player player)
{
this.itemsInSlots = new TreeMap<>();
this.parsedOpenAction = VirtualChestActionDispatcher.parseCommand(openActionCommand.orElse(""));
this.parsedCloseAction = VirtualChestActionDispatcher.parseCommand(closeActionCommand.orElse(""));
this.slotToListen = SlotIndex.lessThan(height * 9);
this.playerUniqueId = player.getUniqueId();
}
示例9: getUUID
import org.spongepowered.api.entity.living.player.Player; //导入方法依赖的package包/类
@Override
protected UUID getUUID(Player player) {
return player.getUniqueId();
}
示例10: PlayerWrapper
import org.spongepowered.api.entity.living.player.Player; //导入方法依赖的package包/类
PlayerWrapper(Player player) {
this.playerReference = new WeakReference<>(player);
this.playerId = player.getUniqueId();
}
示例11: getSVPlayerData
import org.spongepowered.api.entity.living.player.Player; //导入方法依赖的package包/类
private SVPlayerData getSVPlayerData(Player player) {
UUID uuid = player.getUniqueId();
uuidsvPlayerDataMap.putIfAbsent(uuid, new SVPlayerData());
return uuidsvPlayerDataMap.get(uuid);
}
示例12: getAccountByPlayer
import org.spongepowered.api.entity.living.player.Player; //导入方法依赖的package包/类
private UniqueAccount getAccountByPlayer(Player player)
{
UUID uniqueId = player.getUniqueId();
String message = "Unsupported account for uuid: " + uniqueId.toString();
return economyService.getOrCreateAccount(uniqueId).orElseThrow(() -> new IllegalArgumentException(message));
}