2016-11-25 13:01:44 +00:00
|
|
|
/*
|
2020-02-01 13:03:15 +00:00
|
|
|
* Copyright (C) 2011-2020 lishid. All rights reserved.
|
2018-02-04 15:29:07 +00:00
|
|
|
*
|
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;
|
|
|
|
|
|
|
|
import org.bukkit.OfflinePlayer;
|
|
|
|
import org.bukkit.entity.Player;
|
2019-05-05 19:15:17 +00:00
|
|
|
import org.bukkit.inventory.InventoryView;
|
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
|
|
|
*/
|
2020-03-25 01:01:59 +00:00
|
|
|
@Nullable
|
|
|
|
Player loadPlayer(@NotNull OfflinePlayer offline);
|
2016-11-25 13:01:44 +00:00
|
|
|
|
2020-04-19 21:52:44 +00:00
|
|
|
/**
|
|
|
|
* Creates a new Player from an existing one that will function slightly better offline.
|
|
|
|
*
|
|
|
|
* @return the Player
|
|
|
|
*/
|
|
|
|
@NotNull
|
|
|
|
Player inject(@NotNull Player player);
|
|
|
|
|
2019-05-05 19:15:17 +00:00
|
|
|
/**
|
|
|
|
* Opens an ISpecialInventory for a Player.
|
|
|
|
*
|
|
|
|
* @param player the Player opening the ISpecialInventory
|
|
|
|
* @param inventory the Inventory
|
|
|
|
*`
|
|
|
|
* @return the InventoryView opened
|
|
|
|
*/
|
2020-03-25 01:01:59 +00:00
|
|
|
@Nullable
|
2019-05-05 19:15:17 +00:00
|
|
|
InventoryView openInventory(@NotNull Player player, @NotNull ISpecialInventory inventory);
|
2016-12-22 14:55:51 +00:00
|
|
|
|
2020-03-25 01:01:59 +00:00
|
|
|
void sendSystemMessage(@NotNull Player player, @NotNull String message);
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
default String getLocale(Player player) {
|
|
|
|
return player.getLocale();
|
|
|
|
}
|
|
|
|
|
2016-11-25 13:01:44 +00:00
|
|
|
}
|