Package fr.royalpha.sheepwars.api
Class SheepWarsKit
- java.lang.Object
-
- fr.royalpha.sheepwars.api.SheepWarsKit
-
public abstract class SheepWarsKit extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSheepWarsKit.KitResultstatic classSheepWarsKit.SheepWarsKitLevelUsed to create different levels for a kit.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.ArrayList<SheepWarsKit>availableKitsprivate static org.bukkit.configuration.file.FileConfigurationconfigprivate static java.io.FileconfigFileprivate java.lang.StringconfigPathprivate booleanfreeKitprivate ItemBuildericonprivate intidprivate java.util.LinkedList<SheepWarsKit.SheepWarsKitLevel>levelsprivate fr.royalpha.sheepwars.core.message.Messagenameprivate org.bukkit.plugin.Pluginpluginprivate static java.util.ArrayList<SheepWarsKit>waitingKits
-
Constructor Summary
Constructors Constructor Description SheepWarsKit(int id, fr.royalpha.sheepwars.core.message.Message.Messages name, boolean freeKit, ItemBuilder icon, SheepWarsKit.SheepWarsKitLevel... levels)Usethis constructorinstead.SheepWarsKit(int id, fr.royalpha.sheepwars.core.message.Message.Messages name, ItemBuilder icon, SheepWarsKit.SheepWarsKitLevel... levels)Usethis constructorinstead.SheepWarsKit(int id, java.lang.String name, boolean freeKit, ItemBuilder icon, SheepWarsKit.SheepWarsKitLevel... levels)Initialize a new Kit !SheepWarsKit(int id, java.lang.String name, ItemBuilder icon, SheepWarsKit.SheepWarsKitLevel... levels)Initialize a new Kit !SheepWarsKit(int id, java.lang.String configPath, fr.royalpha.sheepwars.core.message.Message name, boolean freeKit, ItemBuilder icon, SheepWarsKit.SheepWarsKitLevel... levels)Usethis constructorinstead.
-
Method Summary
Modifier and Type Method Description static booleanexistKit(int id)Get if this ID is linked to a kit.static java.util.List<SheepWarsKit>getAvailableKits()Get registered kits.private java.lang.StringgetConfigFieldPath(java.lang.String field)No need to use this method.static SheepWarsKitgetFromId(int id)Get a Kit from an ID.ItemBuildergetIcon()Get the kit icon.intgetId()Get kit id.static SheepWarsKitgetInstanceKit(SheepWarsKit kit)Get the same instance of a Kit.SheepWarsKit.SheepWarsKitLevelgetLevel(int level)SheepWarsKit.SheepWarsKitLevelgetLevel(org.bukkit.entity.Player player)java.util.LinkedList<SheepWarsKit.SheepWarsKitLevel>getLevels()Get the level classes of this kit.java.lang.StringgetName(Language lang)Get the kit name according to the (player's) language.java.lang.StringgetName(org.bukkit.entity.Player player)Get the kit name according to the player's language.org.bukkit.plugin.PlugingetPlugin()Plugin who register this kit.booleanhasLevel(int level)booleanisFreeKit()Is this kit free or not a kit ?booleanisKit(SheepWarsKit kit)Get if this kit id is equal to another kit id.static booleanregisterKit(SheepWarsKit kit, org.bukkit.plugin.Plugin plugin)UseUltimateSheepWarsAPImethods instead.static voidsetupConfig(java.io.File file, fr.royalpha.sheepwars.core.SheepWarsPlugin plugin)No need to use this method.static booleanunregisterKit(SheepWarsKit kit)UseUltimateSheepWarsAPImethods instead.
-
-
-
Field Detail
-
availableKits
private static java.util.ArrayList<SheepWarsKit> availableKits
-
waitingKits
private static java.util.ArrayList<SheepWarsKit> waitingKits
-
configFile
private static java.io.File configFile
-
config
private static org.bukkit.configuration.file.FileConfiguration config
-
id
private int id
-
configPath
private java.lang.String configPath
-
name
private fr.royalpha.sheepwars.core.message.Message name
-
icon
private ItemBuilder icon
-
freeKit
private boolean freeKit
-
plugin
private org.bukkit.plugin.Plugin plugin
-
levels
private java.util.LinkedList<SheepWarsKit.SheepWarsKitLevel> levels
-
-
Constructor Detail
-
SheepWarsKit
public SheepWarsKit(int id, java.lang.String name, ItemBuilder icon, SheepWarsKit.SheepWarsKitLevel... levels)Initialize a new Kit !- Parameters:
id- Unique ID of this Kit. Default kits : 0,1,2,->9.name- Name of this Kit.icon- Icon of this Kit.levels- Levels of the kit.
-
SheepWarsKit
public SheepWarsKit(int id, fr.royalpha.sheepwars.core.message.Message.Messages name, ItemBuilder icon, SheepWarsKit.SheepWarsKitLevel... levels)Usethis constructorinstead.
-
SheepWarsKit
public SheepWarsKit(int id, java.lang.String name, boolean freeKit, ItemBuilder icon, SheepWarsKit.SheepWarsKitLevel... levels)Initialize a new Kit !- Parameters:
id- Unique ID of this Kit. Default kits : 0,1,2,->9.name- Name of this Kit.freeKit- Is this kit free or not a kit ?icon- Icon of this Kit.levels- Levels of the kit.
-
SheepWarsKit
public SheepWarsKit(int id, fr.royalpha.sheepwars.core.message.Message.Messages name, boolean freeKit, ItemBuilder icon, SheepWarsKit.SheepWarsKitLevel... levels)Usethis constructorinstead.
-
SheepWarsKit
public SheepWarsKit(int id, java.lang.String configPath, fr.royalpha.sheepwars.core.message.Message name, boolean freeKit, ItemBuilder icon, SheepWarsKit.SheepWarsKitLevel... levels)Usethis constructorinstead.
-
-
Method Detail
-
getName
public java.lang.String getName(org.bukkit.entity.Player player)
Get the kit name according to the player's language.
-
getName
public java.lang.String getName(Language lang)
Get the kit name according to the (player's) language.
-
getIcon
public ItemBuilder getIcon()
Get the kit icon.
-
getLevel
public SheepWarsKit.SheepWarsKitLevel getLevel(org.bukkit.entity.Player player)
-
getLevels
public java.util.LinkedList<SheepWarsKit.SheepWarsKitLevel> getLevels()
Get the level classes of this kit.
-
getPlugin
public org.bukkit.plugin.Plugin getPlugin()
Plugin who register this kit.
-
isKit
public boolean isKit(SheepWarsKit kit)
Get if this kit id is equal to another kit id.
-
hasLevel
public boolean hasLevel(int level)
-
getLevel
public SheepWarsKit.SheepWarsKitLevel getLevel(int level)
-
getId
public int getId()
Get kit id.
-
isFreeKit
public boolean isFreeKit()
Is this kit free or not a kit ?
-
getConfigFieldPath
private java.lang.String getConfigFieldPath(java.lang.String field)
No need to use this method.
-
existKit
public static boolean existKit(int id)
Get if this ID is linked to a kit.
-
getFromId
public static SheepWarsKit getFromId(int id)
Get a Kit from an ID.
-
getInstanceKit
public static SheepWarsKit getInstanceKit(SheepWarsKit kit) throws fr.royalpha.sheepwars.core.exception.UnknownKitException
Get the same instance of a Kit.- Throws:
fr.royalpha.sheepwars.core.exception.UnknownKitException
-
getAvailableKits
public static java.util.List<SheepWarsKit> getAvailableKits()
Get registered kits.
-
registerKit
public static boolean registerKit(SheepWarsKit kit, org.bukkit.plugin.Plugin plugin) throws java.io.IOException
UseUltimateSheepWarsAPImethods instead.- Throws:
java.io.IOException
-
unregisterKit
public static boolean unregisterKit(SheepWarsKit kit)
UseUltimateSheepWarsAPImethods instead.
-
setupConfig
public static void setupConfig(java.io.File file, fr.royalpha.sheepwars.core.SheepWarsPlugin plugin)No need to use this method.
-
-