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>
availableBoosters
private static org.bukkit.configuration.file.FileConfiguration
config
private static java.io.File
configFile
private java.lang.String
configPath
private fr.royalpha.sheepwars.core.handler.DisplayColor
displayColor
private int
duration
private fr.royalpha.sheepwars.core.message.Message
name
private static java.util.List<SheepWarsBooster>
waitingBoosters
private org.bukkit.DyeColor
woolColor
-
Constructor Summary
Constructors Constructor Description SheepWarsBooster(fr.royalpha.sheepwars.core.message.Message.Messages name, fr.royalpha.sheepwars.core.handler.DisplayColor displayColor, int duration)
Usethis constructor
instead.SheepWarsBooster(fr.royalpha.sheepwars.core.message.Message.Messages name, fr.royalpha.sheepwars.core.handler.DisplayColor displayColor, org.bukkit.DyeColor woolColor, int duration)
Usethis 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)
Usethis 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 !
-
Method Summary
Modifier and Type Method Description private static SheepWarsBooster
activateBooster(org.bukkit.entity.Player activator, SheepWarsBooster booster, org.bukkit.plugin.Plugin plugin)
static SheepWarsBooster
activateBooster(org.bukkit.entity.Player activator, org.bukkit.DyeColor color, org.bukkit.plugin.Plugin plugin)
Activate a booster according to a DyeColor.static SheepWarsBooster
activateRandomBooster(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.String
getConfigFieldPath(java.lang.String field)
No need to use this method.fr.royalpha.sheepwars.core.handler.DisplayColor
getDisplayColor()
Get booster display color.int
getDuration()
Get booster duration.fr.royalpha.sheepwars.core.message.Message
getName()
No need to use this method.org.bukkit.DyeColor
getWoolColor()
Get booster wool color.abstract void
onFinish()
Triggered on deactivation of the booster.abstract boolean
onStart(org.bukkit.entity.Player player, SheepWarsTeam team)
Triggered on activation of the booster.static boolean
registerBooster(SheepWarsBooster booster)
UseUltimateSheepWarsAPI
methods instead.void
setDisplayColor(fr.royalpha.sheepwars.core.handler.DisplayColor displayColor)
Set booster display color.static void
setupConfig(java.io.File file, fr.royalpha.sheepwars.core.SheepWarsPlugin plugin)
No need to use this method.static boolean
unregisterBooster(SheepWarsBooster booster)
UseUltimateSheepWarsAPI
methods 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 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)
Usethis 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)
Usethis 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
UseUltimateSheepWarsAPI
methods instead.- Throws:
java.io.IOException
-
unregisterBooster
public static boolean unregisterBooster(SheepWarsBooster booster)
UseUltimateSheepWarsAPI
methods 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.
-
-