Class OpenPACClientAPI

java.lang.Object
xaero.pac.client.api.OpenPACClientAPI

public final class OpenPACClientAPI extends Object
This is the main client API access point. You can get the instance with 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 Details

    • OpenPACClientAPI

      public OpenPACClientAPI()
  • Method Details

    • getPlayerConfigClientStorageManager

      @Nonnull public IPlayerConfigClientStorageManagerAPI 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

      @Nonnull public IClientPartyStorageAPI 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

      @Nonnull public IClientClaimsManagerAPI 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

      @Nonnull public OPACKeyBindingsAPI 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 null
      parent - the screen to switch to when the screen is exited normally, can be null
    • getCapabilityHelper

      @Nonnull public ICapabilityHelperAPI getCapabilityHelper()
      Gets the capability API for accessing the data attached to some objects, e.g. game worlds.

      For example, MAIN_CAP in ClientWorldCapabilityTypes is attached to all ClientLevel instances and lets you access the IClientWorldDataAPI of a client world instance.

      Uses Forge capabilities when possible.

      Returns:
      instance of the capability API, not null
    • get

      @Nonnull public static OpenPACClientAPI get()
      Gets the client-side Open Parties and Claims API instance.
      Returns:
      instance of the client-side API, not null