Package org.mcmonkey.sentinel
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
Modifier and TypeFieldDescriptionboolean
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.static SentinelPlugin
Current plugin instance.static final HashMap
<String, SentinelIntegration> A map of target prefixes to the integration object.static final ArrayList
<SentinelIntegration> 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.static HashMap
<String, SentinelTarget> 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).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
-
Method Summary
Modifier and TypeMethodDescriptionCleans 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").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
onEnable()
Called when the plugin is enabled at server startup.void
registerIntegration
(SentinelIntegration integration) Registers a new integration to Sentinel.void
Fills thevaultPerms
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
-
Field Details
-
validEventTargets
A map of all valid event targets. -
targetOptions
A map of typeable target names to valid targets. -
entityToTargets
A map of entity types to target types. -
integrationPrefixMap
A map of target prefixes to the integration object. -
integrations
All current integrations available to Sentinel. -
instance
Current plugin instance. -
currentSentinelNPCs
A list of all currently spawned Sentinel NPCs. -
vaultPerms
public net.milkbowl.vault.permission.Permission vaultPermsPermissions handler. -
tickTimeTotal
public long tickTimeTotalTotal server tick time (for timing correction handlers). -
maxHealth
public double maxHealthConfiguration option: maximum health value any NPC can ever have. -
cleverTicks
public int cleverTicksConfiguration option: maximum duration (in ticks) an NPC can know where a hidden target is. -
canUseSkull
public boolean canUseSkullConfiguration option: whether the skull weapon is allowed. -
blockEvents
public boolean blockEventsConfiguration option: whether to block some events that may cause other plugins to have issues. -
alternateDamage
public boolean alternateDamageConfiguration option: whether to use an alternative (work-around) method of applying damage. -
workaroundDamage
public boolean workaroundDamageConfiguration option: whether to work-around damage-giving issues. -
doNativeAttack
public boolean doNativeAttackConfiguration option: whether to do native attack instead of direct damage for melee. -
minShootSpeed
public double minShootSpeedConfiguration option: minimum arrow shooting speed. -
workaroundDrops
public boolean workaroundDropsConfiguration option: whether to work-around potential NPC item drop issues. -
deathMessages
public boolean deathMessagesConfiguration option: whether to enable NPC death messages. -
spectralSound
public org.bukkit.Sound spectralSoundConfiguration option: the sound to play when using the Spectral attack. -
ignoreInvisible
public boolean ignoreInvisibleConfiguration option: whether to ignore invisible targets. -
guardDistanceMinimum
public int guardDistanceMinimumConfiguration option: guarding distance values. -
guardDistanceSelectionRange
public int guardDistanceSelectionRangeConfiguration option: guarding distance values. -
workaroundEntityChasePathfinder
public boolean workaroundEntityChasePathfinderConfiguration option: whether to work-around a pathfinder issue. -
autoCorrectpathfinderMode
public boolean autoCorrectpathfinderModeConfiguration option: whether to auto-enable use-new-finder. -
protectFromIgnores
Deprecated.Legacy configuration option: whether to protect all NPCs from being harmed by ignored entities. -
tickRate
public int tickRateConfiguration option: standard tick-rate for NPC updates. -
runAwayTime
public int runAwayTimeConfiguration option: time to keep running away for. -
noGuardDamage
public boolean noGuardDamageConfiguration option: whether to block players from damaging their own guards. -
blockSunburn
public boolean blockSunburnConfiguration option: whether to protect Sentinel NPCs from being burned by the sun. -
preventExplosionBlockDamage
public boolean preventExplosionBlockDamageConfiguration option: whether to prevent Sentinel weapons causing damage to blocks. -
arrowCleanupTime
public int arrowCleanupTimeConfiguration option: time until arrow cleanup. -
hasWorldGuard
public boolean hasWorldGuardWhether WorldGuard support is loaded and enabled. -
enhanceLosTraces
public boolean enhanceLosTracesWhether to use smarter LOS tracing. -
allowArmorStandTargets
public boolean allowArmorStandTargetsWhether NPCs should be able to target armor stands. -
debugMe
public static boolean debugMeWhether debugging is enabled.
-
-
Constructor Details
-
SentinelPlugin
public SentinelPlugin()
-
-
Method Details
-
cleanCurrentList
Cleans and returns the current Sentinel NPC list. -
tryGetPerms
public void tryGetPerms()Fills thevaultPerms
object if possible. -
registerIntegration
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 interfaceorg.bukkit.plugin.Plugin
- Overrides:
onEnable
in classorg.bukkit.plugin.java.JavaPlugin
-
onDisable
public void onDisable()Called when the plugin is disabled at server shutdown.- Specified by:
onDisable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onDisable
in classorg.bukkit.plugin.java.JavaPlugin
-
getSentinelFor
Gets the Sentinel Trait instance for a given command sender (based on their selected NPC). -
getOwner
Gets the owner identity of an NPC for output (player name or "server"). -
getOwner
Gets the owner identity of an NPC for output (player name or default String value).
-