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 class
SheepWarsKit.KitResult
static class
SheepWarsKit.SheepWarsKitLevel
Used to create different levels for a kit.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.ArrayList<SheepWarsKit>
availableKits
private static org.bukkit.configuration.file.FileConfiguration
config
private static java.io.File
configFile
private java.lang.String
configPath
private boolean
freeKit
private ItemBuilder
icon
private int
id
private java.util.LinkedList<SheepWarsKit.SheepWarsKitLevel>
levels
private fr.royalpha.sheepwars.core.message.Message
name
private org.bukkit.plugin.Plugin
plugin
private 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 constructor
instead.SheepWarsKit(int id, fr.royalpha.sheepwars.core.message.Message.Messages name, ItemBuilder icon, SheepWarsKit.SheepWarsKitLevel... levels)
Usethis constructor
instead.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 constructor
instead.
-
Method Summary
Modifier and Type Method Description static boolean
existKit(int id)
Get if this ID is linked to a kit.static java.util.List<SheepWarsKit>
getAvailableKits()
Get registered kits.private java.lang.String
getConfigFieldPath(java.lang.String field)
No need to use this method.static SheepWarsKit
getFromId(int id)
Get a Kit from an ID.ItemBuilder
getIcon()
Get the kit icon.int
getId()
Get kit id.static SheepWarsKit
getInstanceKit(SheepWarsKit kit)
Get the same instance of a Kit.SheepWarsKit.SheepWarsKitLevel
getLevel(int level)
SheepWarsKit.SheepWarsKitLevel
getLevel(org.bukkit.entity.Player player)
java.util.LinkedList<SheepWarsKit.SheepWarsKitLevel>
getLevels()
Get the level classes of this kit.java.lang.String
getName(Language lang)
Get the kit name according to the (player's) language.java.lang.String
getName(org.bukkit.entity.Player player)
Get the kit name according to the player's language.org.bukkit.plugin.Plugin
getPlugin()
Plugin who register this kit.boolean
hasLevel(int level)
boolean
isFreeKit()
Is this kit free or not a kit ?boolean
isKit(SheepWarsKit kit)
Get if this kit id is equal to another kit id.static boolean
registerKit(SheepWarsKit kit, org.bukkit.plugin.Plugin plugin)
UseUltimateSheepWarsAPI
methods instead.static void
setupConfig(java.io.File file, fr.royalpha.sheepwars.core.SheepWarsPlugin plugin)
No need to use this method.static boolean
unregisterKit(SheepWarsKit kit)
UseUltimateSheepWarsAPI
methods 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 constructor
instead.
-
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 constructor
instead.
-
SheepWarsKit
public SheepWarsKit(int id, java.lang.String configPath, fr.royalpha.sheepwars.core.message.Message name, boolean freeKit, ItemBuilder icon, SheepWarsKit.SheepWarsKitLevel... levels)
Usethis constructor
instead.
-
-
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
UseUltimateSheepWarsAPI
methods instead.- Throws:
java.io.IOException
-
unregisterKit
public static boolean unregisterKit(SheepWarsKit kit)
UseUltimateSheepWarsAPI
methods instead.
-
setupConfig
public static void setupConfig(java.io.File file, fr.royalpha.sheepwars.core.SheepWarsPlugin plugin)
No need to use this method.
-
-