public class CharacterManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static WauzCore |
core
A direct reference to the main class.
|
static int |
SCHEMA_VERSION
The current schema version of character files.
|
Constructor and Description |
---|
CharacterManager() |
Modifier and Type | Method and Description |
---|---|
static void |
createCharacter(org.bukkit.entity.Player player,
WauzMode wauzMode)
Creates and logs in the new character specified in the player data.
|
static void |
deleteCharacter(org.bukkit.entity.Player player,
java.lang.String characterSlot)
Deletes the given character permanently.
|
static void |
equipCharacterItems(org.bukkit.entity.Player player)
Equips a player with default mmorpg character items.
|
static void |
equipHubItems(org.bukkit.entity.Player player)
Equips a player with default hub items.
|
static void |
loginCharacter(org.bukkit.entity.Player player,
WauzMode wauzMode)
Logs in the character specified in the player data.
|
static void |
logoutCharacter(org.bukkit.entity.Player player)
Logs out the current chracter of the player.
|
private static void |
persistCharacterFile(java.io.File playerDataFile,
org.bukkit.configuration.file.FileConfiguration playerDataConfig)
Saves a newly created character config to a file.
|
static void |
saveCharacter(org.bukkit.entity.Player player)
Saves the character specified in the player data.
|
public static final int SCHEMA_VERSION
private static WauzCore core
public static void loginCharacter(org.bukkit.entity.Player player, WauzMode wauzMode)
player
- The player that selected the character.wauzMode
- The mode of the character.WauzPlayerDataSectionSelections.getSelectedCharacterSlot()
,
InventoryStringConverter.loadInventory(Player)
,
equipCharacterItems(Player)
public static void logoutCharacter(org.bukkit.entity.Player player)
player
- The player that is logging out their character.saveCharacter(Player)
,
equipHubItems(Player)
public static void saveCharacter(org.bukkit.entity.Player player)
player
- The player that selected the character.InventoryStringConverter.saveInventory(Player)
,
PlayerConfigurator.setCharacterLocation(Player, Location)
public static void createCharacter(org.bukkit.entity.Player player, WauzMode wauzMode)
player
- The player that selected the new character.wauzMode
- The mode of the new character.private static void persistCharacterFile(java.io.File playerDataFile, org.bukkit.configuration.file.FileConfiguration playerDataConfig)
playerDataFile
- The file the config should be saved in.playerDataConfig
- The config to save.public static void deleteCharacter(org.bukkit.entity.Player player, java.lang.String characterSlot)
player
- The player who owns the character.characterSlot
- The slot of the character.public static void equipHubItems(org.bukkit.entity.Player player)
player
- The player that should receive the items.MenuUtils.setMainMenuOpener(org.bukkit.inventory.Inventory, int)
public static void equipCharacterItems(org.bukkit.entity.Player player)
player
- The player that should receive the items.MenuUtils.setMainMenuOpener(org.bukkit.inventory.Inventory, int)
,
TabardMenu.equipSelectedTabard(Player)