Class SheepWarsBooster

  • All Implemented Interfaces:
    org.bukkit.event.Listener

    public abstract class SheepWarsBooster
    extends java.lang.Object
    implements org.bukkit.event.Listener
    • Constructor Summary

      Constructors 
      Constructor Description
      SheepWarsBooster​(fr.royalpha.sheepwars.core.message.Message.Messages name, fr.royalpha.sheepwars.core.handler.DisplayColor displayColor, int duration)
      Use this constructor instead.
      SheepWarsBooster​(fr.royalpha.sheepwars.core.message.Message.Messages name, fr.royalpha.sheepwars.core.handler.DisplayColor displayColor, org.bukkit.DyeColor woolColor, int duration)
      Use this constructor instead.
      SheepWarsBooster​(fr.royalpha.sheepwars.core.message.Message name, java.lang.String configPath, fr.royalpha.sheepwars.core.handler.DisplayColor displayColor, org.bukkit.DyeColor woolColor, int duration)
      Use this constructor instead.
      SheepWarsBooster​(java.lang.String name, fr.royalpha.sheepwars.core.handler.DisplayColor displayColor, int duration)
      Initialize a new Booster !
      SheepWarsBooster​(java.lang.String name, fr.royalpha.sheepwars.core.handler.DisplayColor displayColor, org.bukkit.DyeColor woolColor, int duration)
      Initialize a new Booster !
    • Field Detail

      • availableBoosters

        private static java.util.List<SheepWarsBooster> availableBoosters
      • waitingBoosters

        private static java.util.List<SheepWarsBooster> waitingBoosters
      • configFile

        private static java.io.File configFile
      • config

        private static org.bukkit.configuration.file.FileConfiguration config
      • name

        private final fr.royalpha.sheepwars.core.message.Message name
      • configPath

        private final java.lang.String configPath
      • displayColor

        private fr.royalpha.sheepwars.core.handler.DisplayColor displayColor
      • woolColor

        private org.bukkit.DyeColor woolColor
      • duration

        private int duration
    • Constructor Detail

      • SheepWarsBooster

        public SheepWarsBooster​(java.lang.String name,
                                fr.royalpha.sheepwars.core.handler.DisplayColor displayColor,
                                int duration)
        Initialize a new Booster !
        Parameters:
        name - Display name of this booster.
        displayColor - Display color of this booster (wool color will be the same).
        duration - Duration of this booster (0 for instant booster such as instant potion effect).
      • SheepWarsBooster

        public SheepWarsBooster​(java.lang.String name,
                                fr.royalpha.sheepwars.core.handler.DisplayColor displayColor,
                                org.bukkit.DyeColor woolColor,
                                int duration)
        Initialize a new Booster !
        Parameters:
        name - Display name of this booster.
        displayColor - Display color of this booster (boss bar and chat color).
        woolColor - Wool color of this booster.
        duration - Duration of this booster (0 for instant booster such as instant potion effect).
      • SheepWarsBooster

        public SheepWarsBooster​(fr.royalpha.sheepwars.core.message.Message.Messages name,
                                fr.royalpha.sheepwars.core.handler.DisplayColor displayColor,
                                int duration)
        Use this constructor instead.
      • SheepWarsBooster

        public SheepWarsBooster​(fr.royalpha.sheepwars.core.message.Message.Messages name,
                                fr.royalpha.sheepwars.core.handler.DisplayColor displayColor,
                                org.bukkit.DyeColor woolColor,
                                int duration)
        Use this constructor instead.
      • SheepWarsBooster

        public SheepWarsBooster​(fr.royalpha.sheepwars.core.message.Message name,
                                java.lang.String configPath,
                                fr.royalpha.sheepwars.core.handler.DisplayColor displayColor,
                                org.bukkit.DyeColor woolColor,
                                int duration)
        Use this constructor instead.
    • Method Detail

      • getName

        public fr.royalpha.sheepwars.core.message.Message getName()
        No need to use this method.
      • getWoolColor

        public org.bukkit.DyeColor getWoolColor()
        Get booster wool color.
      • getDisplayColor

        public fr.royalpha.sheepwars.core.handler.DisplayColor getDisplayColor()
        Get booster display color.
      • setDisplayColor

        public void setDisplayColor​(fr.royalpha.sheepwars.core.handler.DisplayColor displayColor)
        Set booster display color.
      • getDuration

        public int getDuration()
        Get booster duration.
      • getConfigFieldPath

        private java.lang.String getConfigFieldPath​(java.lang.String field)
        No need to use this method.
      • onStart

        public abstract boolean onStart​(org.bukkit.entity.Player player,
                                        SheepWarsTeam team)
        Triggered on activation of the booster.
        Parameters:
        player - Who activate the booster.
        team - Player's team.
        Returns:
        Boolean value not used yet.
      • onFinish

        public abstract void onFinish()
        Triggered on deactivation of the booster.
      • activateBooster

        private static SheepWarsBooster activateBooster​(org.bukkit.entity.Player activator,
                                                        SheepWarsBooster booster,
                                                        org.bukkit.plugin.Plugin plugin)
      • activateRandomBooster

        public static SheepWarsBooster activateRandomBooster​(org.bukkit.entity.Player activator,
                                                             org.bukkit.plugin.Plugin plugin)
        Activate a random booster.
        Parameters:
        activator - Player who activates the booster.
        plugin - Any plugin instance.
        Returns:
        The booster activated.
      • activateBooster

        public static SheepWarsBooster activateBooster​(org.bukkit.entity.Player activator,
                                                       org.bukkit.DyeColor color,
                                                       org.bukkit.plugin.Plugin plugin)
        Activate a booster according to a DyeColor.
        Parameters:
        activator - Player who activates the booster.
        plugin - Any plugin instance.
        Returns:
        The booster activated.
      • registerBooster

        public static boolean registerBooster​(SheepWarsBooster booster)
                                       throws java.io.IOException
        Use UltimateSheepWarsAPI methods instead.
        Throws:
        java.io.IOException
      • setupConfig

        public static void setupConfig​(java.io.File file,
                                       fr.royalpha.sheepwars.core.SheepWarsPlugin plugin)
        No need to use this method.
      • getAvailableBoosters

        public static java.util.List<SheepWarsBooster> getAvailableBoosters()
        Get registered boosters.