Class OpenPACClientAPI
get()
.
For functionality that requires registering handlers/listeners, it is often required or recommended to do so during the OPACClientAddonRegister.EVENT on Fabric or the OPACClientAddonRegisterEvent on Forge.
Make sure to check whether the server side has the mod installed with
ClientWorldMainCapabilityAPI capability = api.getCapabilityHelper().getCapability(Minecraft.getInstance().level, ClientWorldCapabilityTypes.MAIN_CAP);
IClientWorldDataAPI worldData = capability.getClientWorldData();
boolean serverHasMod = worldData.serverHasMod();
for each client world instance (Minecraft.getInstance().level
).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OpenPACClientAPI
get()
Gets the client-side Open Parties and Claims API instance.Gets the capability API for accessing the data attached to some objects, e.g.Gets the API for the client-side claims manager updated by the server.Gets the API for the client-side party data updated by the server.Gets the API for the mod's keybindings.Gets the API for the client-side config data updated by the server.void
openMainMenuScreen
(net.minecraft.client.gui.screens.Screen escape, net.minecraft.client.gui.screens.Screen parent) Opens the main menu screen of the Parties and Claims mod.
-
Constructor Details
-
OpenPACClientAPI
public OpenPACClientAPI()
-
-
Method Details
-
getPlayerConfigClientStorageManager
Gets the API for the client-side config data updated by the server.- Returns:
- instance of the client-side player config API, not null
-
getClientPartyStorage
Gets the API for the client-side party data updated by the server.- Returns:
- instance of the client-side party API, not null
-
getClaimsManager
Gets the API for the client-side claims manager updated by the server.- Returns:
- instance of the client-side claims manager API, not null
-
getKeyBindings
Gets the API for the mod's keybindings.- Returns:
- instance of the mod's keybindings API, not null
-
openMainMenuScreen
public void openMainMenuScreen(@Nullable net.minecraft.client.gui.screens.Screen escape, @Nullable net.minecraft.client.gui.screens.Screen parent) Opens the main menu screen of the Parties and Claims mod.- Parameters:
escape
- the screen to switch to when the escape key is hit, can be nullparent
- the screen to switch to when the screen is exited normally, can be null
-
getCapabilityHelper
Gets the capability API for accessing the data attached to some objects, e.g. game worlds.For example,
MAIN_CAP
inClientWorldCapabilityTypes
is attached to allClientLevel
instances and lets you access theIClientWorldDataAPI
of a client world instance.Uses Forge capabilities when possible.
- Returns:
- instance of the capability API, not null
-
get
Gets the client-side Open Parties and Claims API instance.- Returns:
- instance of the client-side API, not null
-