Class OpenPACServerAPI

java.lang.Object
xaero.pac.common.server.api.OpenPACServerAPI

public class OpenPACServerAPI extends Object
This is the main server-side API access point. You can get the instance with get(MinecraftServer).

For functionality that requires registering handlers/listeners, it is often required or recommended to do so during the OPACServerAddonRegister.EVENT on Fabric or the OPACServerAddonRegisterEvent on Forge.

Additionally, to access some data attached to online server players, use ServerPlayerDataAPI.from(ServerPlayer). You probably won't need that though.

  • Constructor Details

    • OpenPACServerAPI

      public OpenPACServerAPI(xaero.pac.common.server.IServerDataAPI serverData)
      Constructor for internal usage.
      Parameters:
      serverData - the server data
  • Method Details

    • getPartyManager

      @Nonnull public IPartyManagerAPI getPartyManager()
      Gets the API for the server-side player party manager.
      Returns:
      instance of the server-side player party manager API, not null
    • getServerClaimsManager

      @Nonnull public IServerClaimsManagerAPI getServerClaimsManager()
      Gets the API for the server-side claims manager.
      Returns:
      instance of the server-side claims manager API, not null
    • getPlayerConfigs

      @Nonnull public IPlayerConfigManagerAPI getPlayerConfigs()
      Gets the API for the server-side player config manager.
      Returns:
      instance of the server-side player config manager API, not null
    • getAdaptiveTextLocalizer

      public IAdaptiveLocalizerAPI getAdaptiveTextLocalizer()
      Gets the API for the server-side adaptive text localizer that lets you create translated text components that are readable even by players that don't have the mod installed.
      Returns:
      the adaptive text localizer API, not null
    • getChunkProtection

      public IChunkProtectionAPI getChunkProtection()
      Gets the API for the chunk protection with some basic methods you can use.
      Returns:
      the chunk protection API
    • get

      @Nonnull public static OpenPACServerAPI get(@Nonnull net.minecraft.server.MinecraftServer server)
      Gets the server-side Open Parties and Claims API instance.
      Parameters:
      server - the server instance, not null
      Returns:
      instance of the server-side API, not null