Package de.Keyle.MyPet.api.util.hooks
Class HookHelper
java.lang.Object
de.Keyle.MyPet.api.util.hooks.HookHelper
The
HookHelper is a wrapper for the hooks of the default functionality this plugin needs from other plugins.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanReturn if a player can hurt a specific entity.abstract booleanReturn if a player can hurt another player.abstract booleanReturn if a player can hurt another player and if needed vice versaabstract booleancanMount(MyPetPlayer rider, Entity pet) Returns whether a player may mount a pet where it currently stands, according to every registeredMountInsideHook(WorldGuard'srideflag, GriefPrevention claim access, Residence'sridingflag, and so on).abstract booleancanPetFlyAt(Location location) Returns if a player can fly a pet at a certain locationabstract intgetBeaconAmplifierModifier(Location location) Returns the amplifier modifier for beacon effects at a certain locationabstract doublegetBeaconDurationMultiplier(Location location) Returns the duration multiplier for beacon effects at a certain locationabstract doublegetBeaconRangeMultiplier(Location location) Returns the range multiplier for beacons at a certain locationabstract EconomyHookReturns the Vault economy hookgetPartyMembers(Player player) Returns all members of a party if the player is in one (Ancient, mcMMO, Heroes)abstract booleanisBeaconAllowed(Location location) Returns if beacon effects can be activated at a certain locationabstract booleanisBeaconSelfAllowed(Location location) Returns if owners can receive their own beacon effects at a certain locationabstract booleanisBeaconShareAllowed(Location location) Returns if beacon effects can be shared to non-owners at a certain locationabstract booleanReturns if the Vault economy hook is enabledabstract booleanReturns if a player is in a party (Ancient, mcMMO, Heroes)abstract booleanisPetAllowed(MyPetPlayer player) Return if a MyPet player is in any type of arena (Minigames, Survival Games, PvP Arena, etc.)abstract booleanisVanished(Player player) Returns whether the player is vanished or not
-
Constructor Details
-
HookHelper
public HookHelper()Creates a hook helper.
-
-
Method Details
-
canHurt
Return if a player can hurt another player and if needed vice versa- Parameters:
attacker- attacking playervictim- attacked playerviceversa- when true check if the attacked can attack the attacker- Returns:
- if the attacker can hurt the attacked (and optionally vice versa)
-
canHurt
Return if a player can hurt another player.- Parameters:
attacker- attacking playervictim- attacked player- Returns:
- if the attacker can hurt the attacked player
-
canHurt
Return if a player can hurt a specific entity.- Parameters:
attacker- attacking playervictim- attacked entity- Returns:
- if the attacker can hurt the entity
-
isPetAllowed
Return if a MyPet player is in any type of arena (Minigames, Survival Games, PvP Arena, etc.)- Parameters:
player- the MyPet player- Returns:
- if player is in arena
-
canMount
Returns whether a player may mount a pet where it currently stands, according to every registeredMountInsideHook(WorldGuard'srideflag, GriefPrevention claim access, Residence'sridingflag, and so on). A single denying hook refuses the mount; with no such hooks installed the answer is alwaystrue.- Parameters:
rider- the player trying to mount, owner or notpet- the pet entity being mounted; the check is made at its location- Returns:
falseif any protection plugin forbids riding there
-
canPetFlyAt
Returns if a player can fly a pet at a certain location- Parameters:
location- checked location- Returns:
- if a player can fly the pet
-
isInParty
Returns if a player is in a party (Ancient, mcMMO, Heroes)- Parameters:
player- checked player- Returns:
- if a player is in a party
-
getPartyMembers
Returns all members of a party if the player is in one (Ancient, mcMMO, Heroes)- Parameters:
player- members of the party- Returns:
- all members of the party
-
isVanished
Returns whether the player is vanished or not- Parameters:
player- the player to be checked- Returns:
- whether the player is vanished
-
getEconomy
Returns the Vault economy hook- Returns:
- the Vault economy hook
-
isEconomyEnabled
public abstract boolean isEconomyEnabled()Returns if the Vault economy hook is enabled- Returns:
- true if enabled
-
isBeaconAllowed
Returns if beacon effects can be activated at a certain location- Parameters:
location- checked location- Returns:
- if beacon is allowed at this location
-
isBeaconSelfAllowed
Returns if owners can receive their own beacon effects at a certain location- Parameters:
location- checked location- Returns:
- if beacon self-effects are allowed at this location
-
getBeaconRangeMultiplier
Returns the range multiplier for beacons at a certain location- Parameters:
location- checked location- Returns:
- range multiplier (default 1.0)
-
getBeaconDurationMultiplier
Returns the duration multiplier for beacon effects at a certain location- Parameters:
location- checked location- Returns:
- duration multiplier (default 1.0)
-
getBeaconAmplifierModifier
Returns the amplifier modifier for beacon effects at a certain location- Parameters:
location- checked location- Returns:
- amplifier modifier (default 0)
-