API Manager - Nutty101/NPC-Police GitHub Wiki

Documentation

API is class that allows custom communication with the NPCPolice plugin from your own plugins. This allows further expansion of the plugin without the need to modify the base plugin itself. It also ensures that your customization points do not break, based on changes that I do to the plugin internally down the road.

  • Author: Sir_Nutty (Bruce Johnson)
  • Since: 2.1.8

public static PlayerManager getPlayerManager(OfflinePlayer player)

This method provides access to the players information, as well as custom methods to change information on that player.

  • Parameters: player — OfflinePlayer class from bukkit representing the player you want

    to gain information on.

  • Returns: PlayerManager returns an object that allows for

    interaction with the players record.

  • Since: 2.1.1

public static List<String> getWorldJailNames(World world) throws InvalidWorldException

This method provides access to a list of jail names for a specific world.

  • Parameters: world — Pass a world object from bukkit representing the world you would

    like to get string list of all jail names

  • Returns: List returns a listing of all jail shortnames

    in the referenced world

  • Since: 2.1.1

public static JailManager getJailManager(String jailName) throws InvalidJailException

This method provides access to the configuration settings for the named jail.

  • Parameters: jailName — Pass a string object with the jails short name like to get a

    configuration object for

  • Returns: JailManager returns an object with methods and

    configuration information

  • Since: 2.1.1

public static JailManager getJailManager(Location jailLocation) throws InvalidJailException

This method provides access to the configuration settings for any jail in the location specified.

  • Parameters: jailLocation — Pass a bukkit Location object to get any jail at the specific

    point

  • Returns: JailManager returns an object with methods and

    configuration information

  • Since: 2.1.1

public static void disableMonitoringDamage(boolean disable)

This method provides access to the configuration settings for any jail in the location specified.

  • Parameters: disable — Passing a true will stop the plugin from processing damage based

    on bukkit events

  • Since: 2.1.1

public static void processCustomDamageEvent(EntityDamageByEntityEvent event)

This method allows passing customized damage from another plugin to the NPCPolice plugin.

Make sure you stop all damage processing via disableMonitoringDamage(boolean), otherwise you can cause double events.

  • Parameters: event — Pass a new EntityDamageByEntityEvent, or a modified event with

    your damage modifier.

  • Since: 2.1.1

⚠️ **GitHub.com Fallback** ⚠️