Class HookHelper

java.lang.Object
de.Keyle.MyPet.api.util.hooks.HookHelper

public abstract class HookHelper extends Object
The HookHelper is a wrapper for the hooks of the default functionality this plugin needs from other plugins.
  • Constructor Details

    • HookHelper

      public HookHelper()
      Creates a hook helper.
  • Method Details

    • canHurt

      public abstract boolean canHurt(Player attacker, Player victim, boolean viceversa)
      Return if a player can hurt another player and if needed vice versa
      Parameters:
      attacker - attacking player
      victim - attacked player
      viceversa - when true check if the attacked can attack the attacker
      Returns:
      if the attacker can hurt the attacked (and optionally vice versa)
    • canHurt

      public abstract boolean canHurt(Player attacker, Player victim)
      Return if a player can hurt another player.
      Parameters:
      attacker - attacking player
      victim - attacked player
      Returns:
      if the attacker can hurt the attacked player
    • canHurt

      public abstract boolean canHurt(Player attacker, Entity victim)
      Return if a player can hurt a specific entity.
      Parameters:
      attacker - attacking player
      victim - attacked entity
      Returns:
      if the attacker can hurt the entity
    • isPetAllowed

      public abstract boolean isPetAllowed(MyPetPlayer player)
      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

      public abstract boolean canMount(MyPetPlayer rider, Entity pet)
      Returns whether a player may mount a pet where it currently stands, according to every registered MountInsideHook (WorldGuard's ride flag, GriefPrevention claim access, Residence's riding flag, and so on). A single denying hook refuses the mount; with no such hooks installed the answer is always true.
      Parameters:
      rider - the player trying to mount, owner or not
      pet - the pet entity being mounted; the check is made at its location
      Returns:
      false if any protection plugin forbids riding there
    • canPetFlyAt

      public abstract boolean canPetFlyAt(Location location)
      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

      public abstract boolean isInParty(Player player)
      Returns if a player is in a party (Ancient, mcMMO, Heroes)
      Parameters:
      player - checked player
      Returns:
      if a player is in a party
    • getPartyMembers

      public abstract List<Player> getPartyMembers(Player player)
      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

      public abstract boolean isVanished(Player player)
      Returns whether the player is vanished or not
      Parameters:
      player - the player to be checked
      Returns:
      whether the player is vanished
    • getEconomy

      public abstract EconomyHook 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

      public abstract boolean isBeaconAllowed(Location location)
      Returns if beacon effects can be activated at a certain location
      Parameters:
      location - checked location
      Returns:
      if beacon is allowed at this location
    • isBeaconShareAllowed

      public abstract boolean isBeaconShareAllowed(Location location)
      Returns if beacon effects can be shared to non-owners at a certain location
      Parameters:
      location - checked location
      Returns:
      if beacon sharing is allowed at this location
    • isBeaconSelfAllowed

      public abstract boolean isBeaconSelfAllowed(Location location)
      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

      public abstract double getBeaconRangeMultiplier(Location location)
      Returns the range multiplier for beacons at a certain location
      Parameters:
      location - checked location
      Returns:
      range multiplier (default 1.0)
    • getBeaconDurationMultiplier

      public abstract double getBeaconDurationMultiplier(Location location)
      Returns the duration multiplier for beacon effects at a certain location
      Parameters:
      location - checked location
      Returns:
      duration multiplier (default 1.0)
    • getBeaconAmplifierModifier

      public abstract int getBeaconAmplifierModifier(Location location)
      Returns the amplifier modifier for beacon effects at a certain location
      Parameters:
      location - checked location
      Returns:
      amplifier modifier (default 0)