Package com.jubiman.customplayerlib
Class CustomPlayerRegistry
java.lang.Object
com.jubiman.customplayerlib.CustomPlayerRegistry
Registry where mods can register CustomPlayers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clientTickAll
(necesse.engine.network.client.Client client) Client ticks all registered CustomPlayers.static void
forEach
(BiConsumer<? super String, ? super CustomPlayersHandler<?>> action) Applies forEach function on the registry HasMapstatic CustomPlayersHandler<?>
Get CustomPlayers instance in registrystatic void
loadAllEnter
(necesse.engine.save.LoadData data) Loads all registered CustomPlayers, is called before the rest of the player is loadedstatic void
loadAllExit
(necesse.engine.save.LoadData data) Loads all registered CustomPlayers, is called after the rest of the player is loadedstatic void
register
(String identifier, CustomPlayersHandler<?> customPlayersHandlerInstance) Register a new CustomPlayers instancestatic void
saveAll
(necesse.engine.save.SaveData save, necesse.engine.network.server.ServerClient player) Saves player data from all registered CustomPlayers classesstatic void
serverTickAll
(necesse.engine.network.server.Server server) Server ticks all registered CustomPlayers.
-
Constructor Details
-
CustomPlayerRegistry
public CustomPlayerRegistry()
-
-
Method Details
-
register
public static void register(String identifier, CustomPlayersHandler<?> customPlayersHandlerInstance) Register a new CustomPlayers instance- Parameters:
identifier
- the name of the class (used to return the instance)customPlayersHandlerInstance
- a new instance of the class
-
get
Get CustomPlayers instance in registry- Parameters:
identifier
- the identifier of the CustomPlayers- Returns:
- CustomPlayers instance registered with the identifier
-
forEach
Applies forEach function on the registry HasMap- Parameters:
action
- the function to execute
-
saveAll
public static void saveAll(necesse.engine.save.SaveData save, necesse.engine.network.server.ServerClient player) Saves player data from all registered CustomPlayers classes- Parameters:
save
- the SaveData to save toplayer
- the player to save
-
loadAllEnter
public static void loadAllEnter(necesse.engine.save.LoadData data) Loads all registered CustomPlayers, is called before the rest of the player is loaded- Parameters:
data
- the LoadData to load from
-
loadAllExit
public static void loadAllExit(necesse.engine.save.LoadData data) Loads all registered CustomPlayers, is called after the rest of the player is loaded- Parameters:
data
- the LoadData to load from
-
serverTickAll
public static void serverTickAll(necesse.engine.network.server.Server server) Server ticks all registered CustomPlayers. Please do not call this function as it's called every tick when Necesse's server ticks.- Parameters:
server
- the server to tick from
-
clientTickAll
public static void clientTickAll(necesse.engine.network.client.Client client) Client ticks all registered CustomPlayers. Please do not call this function as it's called every tick when Necesse's client ticks.- Parameters:
client
- the client to tick from
-