2016-11-25 13:01:44 +00:00
|
|
|
/*
|
2018-02-04 15:29:07 +00:00
|
|
|
* Copyright (C) 2011-2018 lishid. All rights reserved.
|
|
|
|
*
|
2016-11-25 13:01:44 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2018-02-04 15:29:07 +00:00
|
|
|
* the Free Software Foundation, version 3.
|
|
|
|
*
|
2016-11-25 13:01:44 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2018-02-04 15:29:07 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2016-11-25 13:01:44 +00:00
|
|
|
* GNU General Public License for more details.
|
2018-02-04 15:29:07 +00:00
|
|
|
*
|
2016-11-25 13:01:44 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package com.lishid.openinv.internal;
|
|
|
|
|
2016-12-22 14:55:51 +00:00
|
|
|
import java.util.Collection;
|
2016-11-25 13:01:44 +00:00
|
|
|
import org.bukkit.OfflinePlayer;
|
|
|
|
import org.bukkit.entity.Player;
|
2019-04-29 00:37:05 +00:00
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
import org.jetbrains.annotations.Nullable;
|
2016-11-25 13:01:44 +00:00
|
|
|
|
|
|
|
public interface IPlayerDataManager {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads a Player for an OfflinePlayer.
|
|
|
|
* </p>
|
|
|
|
* This method is potentially blocking, and should not be called on the main thread.
|
2018-02-04 15:29:07 +00:00
|
|
|
*
|
|
|
|
* @param offline the OfflinePlayer
|
|
|
|
* @return the Player loaded
|
2016-11-25 13:01:44 +00:00
|
|
|
*/
|
2019-04-29 00:37:05 +00:00
|
|
|
@Nullable
|
|
|
|
Player loadPlayer(@NotNull OfflinePlayer offline);
|
2016-11-25 13:01:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a unique identifying string for an OfflinePlayer.
|
2018-02-04 15:29:07 +00:00
|
|
|
*
|
|
|
|
* @param offline the OfflinePlayer
|
|
|
|
* @return the unique identifier
|
2016-11-25 13:01:44 +00:00
|
|
|
*/
|
2019-04-29 00:37:05 +00:00
|
|
|
@NotNull
|
|
|
|
String getPlayerDataID(@NotNull OfflinePlayer offline);
|
2016-11-25 13:01:44 +00:00
|
|
|
|
2016-11-26 20:31:53 +00:00
|
|
|
/**
|
|
|
|
* Gets an OfflinePlayer by the given unique identifier.
|
2018-02-04 15:29:07 +00:00
|
|
|
*
|
2016-11-26 20:31:53 +00:00
|
|
|
* @param identifier the unique identifier
|
|
|
|
* @return the OfflinePlayer, or null if no exact match was found
|
|
|
|
*/
|
2019-04-29 00:37:05 +00:00
|
|
|
@Nullable
|
|
|
|
OfflinePlayer getPlayerByID(@NotNull String identifier);
|
2016-11-26 20:31:53 +00:00
|
|
|
|
2016-12-22 14:55:51 +00:00
|
|
|
/**
|
|
|
|
* Gets a Collection of all Players currently online.
|
2018-02-04 15:29:07 +00:00
|
|
|
*
|
2016-12-22 14:55:51 +00:00
|
|
|
* @return the Collection of Players
|
|
|
|
*/
|
2019-04-29 00:37:05 +00:00
|
|
|
@NotNull
|
|
|
|
Collection<? extends Player> getOnlinePlayers();
|
2016-12-22 14:55:51 +00:00
|
|
|
|
2016-11-25 13:01:44 +00:00
|
|
|
}
|