Package fr.royalpha.sheepwars.api
Class SheepWarsBooster
- java.lang.Object
-
- fr.royalpha.sheepwars.api.SheepWarsBooster
-
- All Implemented Interfaces:
org.bukkit.event.Listener
public abstract class SheepWarsBooster extends java.lang.Object implements org.bukkit.event.Listener
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.List<SheepWarsBooster>availableBoostersprivate static org.bukkit.configuration.file.FileConfigurationconfigprivate static java.io.FileconfigFileprivate java.lang.StringconfigPathprivate fr.royalpha.sheepwars.core.handler.DisplayColordisplayColorprivate intdurationprivate fr.royalpha.sheepwars.core.message.Messagenameprivate static java.util.List<SheepWarsBooster>waitingBoostersprivate org.bukkit.DyeColorwoolColor
-
Constructor Summary
Constructors Constructor Description SheepWarsBooster(fr.royalpha.sheepwars.core.message.Message.Messages name, fr.royalpha.sheepwars.core.handler.DisplayColor displayColor, int duration)Usethis constructorinstead.SheepWarsBooster(fr.royalpha.sheepwars.core.message.Message.Messages name, fr.royalpha.sheepwars.core.handler.DisplayColor displayColor, org.bukkit.DyeColor woolColor, int duration)Usethis constructorinstead.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)Usethis constructorinstead.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 !
-
Method Summary
Modifier and Type Method Description private static SheepWarsBoosteractivateBooster(org.bukkit.entity.Player activator, SheepWarsBooster booster, org.bukkit.plugin.Plugin plugin)static SheepWarsBoosteractivateBooster(org.bukkit.entity.Player activator, org.bukkit.DyeColor color, org.bukkit.plugin.Plugin plugin)Activate a booster according to a DyeColor.static SheepWarsBoosteractivateRandomBooster(org.bukkit.entity.Player activator, org.bukkit.plugin.Plugin plugin)Activate a random booster.static java.util.List<SheepWarsBooster>getAvailableBoosters()Get registered boosters.private java.lang.StringgetConfigFieldPath(java.lang.String field)No need to use this method.fr.royalpha.sheepwars.core.handler.DisplayColorgetDisplayColor()Get booster display color.intgetDuration()Get booster duration.fr.royalpha.sheepwars.core.message.MessagegetName()No need to use this method.org.bukkit.DyeColorgetWoolColor()Get booster wool color.abstract voidonFinish()Triggered on deactivation of the booster.abstract booleanonStart(org.bukkit.entity.Player player, SheepWarsTeam team)Triggered on activation of the booster.static booleanregisterBooster(SheepWarsBooster booster)UseUltimateSheepWarsAPImethods instead.voidsetDisplayColor(fr.royalpha.sheepwars.core.handler.DisplayColor displayColor)Set booster display color.static voidsetupConfig(java.io.File file, fr.royalpha.sheepwars.core.SheepWarsPlugin plugin)No need to use this method.static booleanunregisterBooster(SheepWarsBooster booster)UseUltimateSheepWarsAPImethods instead.
-
-
-
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)Usethis constructorinstead.
-
SheepWarsBooster
public SheepWarsBooster(fr.royalpha.sheepwars.core.message.Message.Messages name, fr.royalpha.sheepwars.core.handler.DisplayColor displayColor, org.bukkit.DyeColor woolColor, int duration)Usethis constructorinstead.
-
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)Usethis constructorinstead.
-
-
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
UseUltimateSheepWarsAPImethods instead.- Throws:
java.io.IOException
-
unregisterBooster
public static boolean unregisterBooster(SheepWarsBooster booster)
UseUltimateSheepWarsAPImethods instead.
-
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.
-
-