Class SentinelPlugin

java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
org.mcmonkey.sentinel.SentinelPlugin
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor, org.bukkit.plugin.Plugin

public class SentinelPlugin extends org.bukkit.plugin.java.JavaPlugin
The main Sentinel plugin class.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
    Whether NPCs should be able to target armor stands.
    boolean
    Configuration option: whether to use an alternative (work-around) method of applying damage.
    int
    Configuration option: time until arrow cleanup.
    boolean
    Configuration option: whether to auto-enable use-new-finder.
    boolean
    Configuration option: whether to block some events that may cause other plugins to have issues.
    boolean
    Configuration option: whether to protect Sentinel NPCs from being burned by the sun.
    boolean
    Configuration option: whether the skull weapon is allowed.
    int
    Configuration option: maximum duration (in ticks) an NPC can know where a hidden target is.
    A list of all currently spawned Sentinel NPCs.
    boolean
    Configuration option: whether to enable NPC death messages.
    static boolean
    Whether debugging is enabled.
    boolean
    Configuration option: whether to do native attack instead of direct damage for melee.
    boolean
    Whether to use smarter LOS tracing.
    static HashMap<org.bukkit.entity.EntityType,HashSet<SentinelTarget>>
    A map of entity types to target types.
    int
    Configuration option: guarding distance values.
    int
    Configuration option: guarding distance values.
    boolean
    Whether WorldGuard support is loaded and enabled.
    boolean
    Configuration option: whether to ignore invisible targets.
    Current plugin instance.
    A map of target prefixes to the integration object.
    All current integrations available to Sentinel.
    double
    Configuration option: maximum health value any NPC can ever have.
    double
    Configuration option: minimum arrow shooting speed.
    boolean
    Configuration option: whether to block players from damaging their own guards.
    boolean
    Configuration option: whether to prevent Sentinel weapons causing damage to blocks.
    boolean
    Deprecated.
    int
    Configuration option: time to keep running away for.
    org.bukkit.Sound
    Configuration option: the sound to play when using the Spectral attack.
    A map of typeable target names to valid targets.
    int
    Configuration option: standard tick-rate for NPC updates.
    long
    Total server tick time (for timing correction handlers).
    static HashSet<String>
    A map of all valid event targets.
    net.milkbowl.vault.permission.Permission
    Permissions handler.
    boolean
    Configuration option: whether to work-around damage-giving issues.
    boolean
    Configuration option: whether to work-around potential NPC item drop issues.
    boolean
    Configuration option: whether to work-around a pathfinder issue.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Cleans and returns the current Sentinel NPC list.
    getOwner(net.citizensnpcs.api.npc.NPC npc)
    Gets the owner identity of an NPC for output (player name or "server").
    getOwner(net.citizensnpcs.api.npc.NPC npc, String defName)
    Gets the owner identity of an NPC for output (player name or default String value).
    getSentinelFor(org.bukkit.command.CommandSender sender)
    Gets the Sentinel Trait instance for a given command sender (based on their selected NPC).
    void
    Reloads the config and updates settings fields accordingly.
    void
    Called when the plugin is disabled at server shutdown.
    void
    Called when the plugin is enabled at server startup.
    void
    Registers a new integration to Sentinel.
    void
    Fills the vaultPerms object if possible.

    Methods inherited from class org.bukkit.plugin.java.JavaPlugin

    getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onLoad, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString

    Methods inherited from class org.bukkit.plugin.PluginBase

    equals, getName, hashCode

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • validEventTargets

      public static HashSet<String> validEventTargets
      A map of all valid event targets.
    • targetOptions

      public static HashMap<String,SentinelTarget> targetOptions
      A map of typeable target names to valid targets.
    • entityToTargets

      public static HashMap<org.bukkit.entity.EntityType,HashSet<SentinelTarget>> entityToTargets
      A map of entity types to target types.
    • integrationPrefixMap

      public static final HashMap<String,SentinelIntegration> integrationPrefixMap
      A map of target prefixes to the integration object.
    • integrations

      public static final ArrayList<SentinelIntegration> integrations
      All current integrations available to Sentinel.
    • instance

      public static SentinelPlugin instance
      Current plugin instance.
    • currentSentinelNPCs

      public ArrayList<SentinelTrait> currentSentinelNPCs
      A list of all currently spawned Sentinel NPCs.
    • vaultPerms

      public net.milkbowl.vault.permission.Permission vaultPerms
      Permissions handler.
    • tickTimeTotal

      public long tickTimeTotal
      Total server tick time (for timing correction handlers).
    • maxHealth

      public double maxHealth
      Configuration option: maximum health value any NPC can ever have.
    • cleverTicks

      public int cleverTicks
      Configuration option: maximum duration (in ticks) an NPC can know where a hidden target is.
    • canUseSkull

      public boolean canUseSkull
      Configuration option: whether the skull weapon is allowed.
    • blockEvents

      public boolean blockEvents
      Configuration option: whether to block some events that may cause other plugins to have issues.
    • alternateDamage

      public boolean alternateDamage
      Configuration option: whether to use an alternative (work-around) method of applying damage.
    • workaroundDamage

      public boolean workaroundDamage
      Configuration option: whether to work-around damage-giving issues.
    • doNativeAttack

      public boolean doNativeAttack
      Configuration option: whether to do native attack instead of direct damage for melee.
    • minShootSpeed

      public double minShootSpeed
      Configuration option: minimum arrow shooting speed.
    • workaroundDrops

      public boolean workaroundDrops
      Configuration option: whether to work-around potential NPC item drop issues.
    • deathMessages

      public boolean deathMessages
      Configuration option: whether to enable NPC death messages.
    • spectralSound

      public org.bukkit.Sound spectralSound
      Configuration option: the sound to play when using the Spectral attack.
    • ignoreInvisible

      public boolean ignoreInvisible
      Configuration option: whether to ignore invisible targets.
    • guardDistanceMinimum

      public int guardDistanceMinimum
      Configuration option: guarding distance values.
    • guardDistanceSelectionRange

      public int guardDistanceSelectionRange
      Configuration option: guarding distance values.
    • workaroundEntityChasePathfinder

      public boolean workaroundEntityChasePathfinder
      Configuration option: whether to work-around a pathfinder issue.
    • autoCorrectpathfinderMode

      public boolean autoCorrectpathfinderMode
      Configuration option: whether to auto-enable use-new-finder.
    • protectFromIgnores

      @Deprecated public boolean protectFromIgnores
      Deprecated.
      Legacy configuration option: whether to protect all NPCs from being harmed by ignored entities.
    • tickRate

      public int tickRate
      Configuration option: standard tick-rate for NPC updates.
    • runAwayTime

      public int runAwayTime
      Configuration option: time to keep running away for.
    • noGuardDamage

      public boolean noGuardDamage
      Configuration option: whether to block players from damaging their own guards.
    • blockSunburn

      public boolean blockSunburn
      Configuration option: whether to protect Sentinel NPCs from being burned by the sun.
    • preventExplosionBlockDamage

      public boolean preventExplosionBlockDamage
      Configuration option: whether to prevent Sentinel weapons causing damage to blocks.
    • arrowCleanupTime

      public int arrowCleanupTime
      Configuration option: time until arrow cleanup.
    • hasWorldGuard

      public boolean hasWorldGuard
      Whether WorldGuard support is loaded and enabled.
    • enhanceLosTraces

      public boolean enhanceLosTraces
      Whether to use smarter LOS tracing.
    • allowArmorStandTargets

      public boolean allowArmorStandTargets
      Whether NPCs should be able to target armor stands.
    • debugMe

      public static boolean debugMe
      Whether debugging is enabled.
  • Constructor Details

    • SentinelPlugin

      public SentinelPlugin()
  • Method Details

    • cleanCurrentList

      public ArrayList<SentinelTrait> cleanCurrentList()
      Cleans and returns the current Sentinel NPC list.
    • tryGetPerms

      public void tryGetPerms()
      Fills the vaultPerms object if possible.
    • registerIntegration

      public void registerIntegration(SentinelIntegration integration)
      Registers a new integration to Sentinel.
    • loadConfigSettings

      public void loadConfigSettings()
      Reloads the config and updates settings fields accordingly.
    • onEnable

      public void onEnable()
      Called when the plugin is enabled at server startup.
      Specified by:
      onEnable in interface org.bukkit.plugin.Plugin
      Overrides:
      onEnable in class org.bukkit.plugin.java.JavaPlugin
    • onDisable

      public void onDisable()
      Called when the plugin is disabled at server shutdown.
      Specified by:
      onDisable in interface org.bukkit.plugin.Plugin
      Overrides:
      onDisable in class org.bukkit.plugin.java.JavaPlugin
    • getSentinelFor

      public SentinelTrait getSentinelFor(org.bukkit.command.CommandSender sender)
      Gets the Sentinel Trait instance for a given command sender (based on their selected NPC).
    • getOwner

      public String getOwner(net.citizensnpcs.api.npc.NPC npc)
      Gets the owner identity of an NPC for output (player name or "server").
    • getOwner

      public String getOwner(net.citizensnpcs.api.npc.NPC npc, String defName)
      Gets the owner identity of an NPC for output (player name or default String value).