Package com.xSavior_of_God.HeroxVote.api
Class HeroxVoteAPI
java.lang.Object
com.xSavior_of_God.HeroxVote.api.HeroxVoteAPI
HeroxVote API!
Central API of HeroxVote- Since:
- 2020-06-04
- Version:
- 7.0.2
- Author:
- xSavior_of_God
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddMoney(org.bukkit.OfflinePlayer p, double amount) Add Herox economy money to the player.static voidaddVote(org.bukkit.OfflinePlayer player, int amount) SET MAX 1 000 VOTES x TIME!static voidSET MAX 1 000 VOTES x TIME!static booleanDeprecated.static StringgetDiscordID(org.bukkit.OfflinePlayer player) ReturnsNULLif DiscordId is not linked!static StringgetLastVoteServiceName(org.bukkit.OfflinePlayer player) static TimestampgetLastVoteTimeStamp(org.bukkit.OfflinePlayer player) static StringgetMinecraftItaliaValue(String value, org.bukkit.OfflinePlayer p) Deprecated.static doublegetMoney(org.bukkit.OfflinePlayer p) Get the current Herox economy balance of the player.static intstatic org.bukkit.OfflinePlayergetOfflinePlayerByDiscordID(String DiscordId) ReturnsNULLif DiscordId is not linked!static org.bukkit.OfflinePlayergetOfflinePlayerByTelegramID(String TelegramId) ReturnsNULLif TelegramId is not linked!static StringgetTelegramID(org.bukkit.OfflinePlayer player) ReturnsNULLif TelegramId is not linked!getTOP(int finishPos, boolean Votes, int month) Simple use of month
'-1' == ALL TIME
'-2' == THIS MONTH
'-3' == THIS WEEK
'0' == January
'11' == December
Simple use of Votes
true == top vote
false == top balancestatic intgetVote(org.bukkit.OfflinePlayer p, int month) Simple use
'-1' == ALL TIME
'-2' == THIS MONTH
'-3' == THIS WEEK
'-4' == THIS YEAR
'-5' == TODAY
'0' == January
'11' == DecemberA map that contains the values of VoteParty.static intgetVotesTotal(int time) Simple use
'-1' == ALL TIME
'-2' == THIS MONTH
'-3' == THIS WEEK
'-4' == THIS YEAR
'-5' == TODAYstatic booleanhasVotedOnMinecraftItalia(org.bukkit.OfflinePlayer player) Deprecated.static booleanhasVotedOnMinecraftItaliaNicknameCheck(org.bukkit.OfflinePlayer player) Deprecated.static booleanhasVotedOnNameMC(org.bukkit.OfflinePlayer player) Check if the player has voted on NameMCstatic StringlastVoteDate(org.bukkit.OfflinePlayer player) Check the last vote datestatic StringlastVoteServiceName(org.bukkit.OfflinePlayer player) Check the last ServiceNamemissingVoteSites(org.bukkit.entity.Player p) Get the list of sites where the player has not voted.static voidsetMoney(org.bukkit.OfflinePlayer p, double amount) Update the current Herox economy balance of the player.static voidsetVote(org.bukkit.OfflinePlayer p, int amount) SET MAX 1 000 VOTES x TIME!static voidtakeVote(org.bukkit.OfflinePlayer p, int amount) SET MAX 1 000 VOTES x TIME!
-
Constructor Details
-
HeroxVoteAPI
public HeroxVoteAPI()
-
-
Method Details
-
getVote
Simple use
'-1' == ALL TIME
'-2' == THIS MONTH
'-3' == THIS WEEK
'-4' == THIS YEAR
'-5' == TODAY
'0' == January
'11' == December- Parameters:
p- OfflinePlayermonth- Month as Number- Returns:
- the player's votes for a specific month OF the CURRENT YEAR
- Throws:
SQLException- SQL Error
-
setVote
public static void setVote(org.bukkit.OfflinePlayer p, int amount) SET MAX 1 000 VOTES x TIME!
- Parameters:
p- OfflinePlayeramount- Amount of Vote
-
addVote
public static void addVote(org.bukkit.OfflinePlayer player, int amount) SET MAX 1 000 VOTES x TIME!
- Parameters:
player- OfflinePlayeramount- Amount of Vote
-
addVote
public static void addVote(org.bukkit.OfflinePlayer player, int amount, String serviceName, String address) SET MAX 1 000 VOTES x TIME!
- Parameters:
player- OfflinePlayeramount- Amount of VoteserviceName- Service Nameaddress- Address
-
takeVote
public static void takeVote(org.bukkit.OfflinePlayer p, int amount) SET MAX 1 000 VOTES x TIME!
- Parameters:
p- OfflinePlayeramount- Amount of Vote
-
getMoney
Get the current Herox economy balance of the player.- Parameters:
p- OfflinePlayer- Returns:
- the player's money
- Throws:
SQLException- SQL Error
-
setMoney
public static void setMoney(org.bukkit.OfflinePlayer p, double amount) Update the current Herox economy balance of the player.- Parameters:
p- OfflinePlayeramount- Amount of money
-
addMoney
Add Herox economy money to the player.- Parameters:
p- OfflinePlayeramount- Amount of money- Throws:
SQLException- SQL Error
-
getVoteParty
A map that contains the values of VoteParty.- Returns:
- VoteParty HashMap
-
getTOP
public static Map<Integer,com.xSavior_of_God.HeroxVote.utils.HeroxVotePlayer> getTOP(int finishPos, boolean Votes, int month) throws SQLException Simple use of month
'-1' == ALL TIME
'-2' == THIS MONTH
'-3' == THIS WEEK
'0' == January
'11' == December
Simple use of Votes
true == top vote
false == top balance- Parameters:
finishPos- TOP # (ex. if 15 return the top 15)Votes- Boolean if true return the top vote, if false return the top balancemonth- Month as Number- Returns:
- a map that contains the TOP Votes or Balance for a specific month of the current Year
- Throws:
SQLException- SQL Error
-
hasVotedOnNameMC
Check if the player has voted on NameMC- Parameters:
player- Player to check- Returns:
- true if the player has voted on NameMC
- Throws:
IOException- if the connection is not available
-
lastVoteDate
Check the last vote date- Parameters:
player- Player to check- Returns:
- String value of a TimeStamp
- Throws:
SQLException- SQL Error
-
lastVoteServiceName
Check the last ServiceName- Parameters:
player- Player to check- Returns:
- ServiceName
- Throws:
SQLException- SQL Error
-
getVotesTotal
Simple use
'-1' == ALL TIME
'-2' == THIS MONTH
'-3' == THIS WEEK
'-4' == THIS YEAR
'-5' == TODAY- Returns:
- the total votes for a specific time
- Throws:
SQLException- SQL Error
-
getDiscordID
ReturnsNULLif DiscordId is not linked!- Parameters:
player- Player to check- Returns:
- Discord user Id
- Throws:
SQLException- SQL Error
-
getTelegramID
ReturnsNULLif TelegramId is not linked!- Parameters:
player- Player to check- Returns:
- Telegram user Id
- Throws:
SQLException- SQL Error
-
getOfflinePlayerByDiscordID
public static org.bukkit.OfflinePlayer getOfflinePlayerByDiscordID(String DiscordId) throws SQLException ReturnsNULLif DiscordId is not linked!- Parameters:
DiscordId- Discord user Id- Returns:
- OfflinePlayer linked to the DiscordId
- Throws:
SQLException- SQL Error
-
getOfflinePlayerByTelegramID
public static org.bukkit.OfflinePlayer getOfflinePlayerByTelegramID(String TelegramId) throws SQLException ReturnsNULLif TelegramId is not linked!- Parameters:
TelegramId- Telegram user Id- Returns:
- OfflinePlayer linked to the TelegramId
- Throws:
SQLException- SQL Error
-
getLastVoteTimeStamp
- Parameters:
player- Player to check- Returns:
- the last vote time of the player
- Throws:
SQLException- SQL Error
-
getLastVoteServiceName
- Parameters:
player- Player to check- Returns:
- the last vote service name of the player
- Throws:
SQLException- SQL Error
-
hasVotedOnMinecraftItalia
public static boolean hasVotedOnMinecraftItalia(org.bukkit.OfflinePlayer player) throws SQLException Deprecated.- Parameters:
player- Player to check- Returns:
- true if the player has voted on MinecraftItalia
- Throws:
SQLException- SQL Error
-
hasVotedOnMinecraftItaliaNicknameCheck
public static boolean hasVotedOnMinecraftItaliaNicknameCheck(org.bukkit.OfflinePlayer player) Deprecated.- Parameters:
player- Player to check- Returns:
- true if the player has voted on MinecraftItalia
-
getNumberOfPlayerRegistered
- Returns:
- the number of players registered to the HeroxVote system.
- Throws:
SQLException- SQL Error
-
enabledMinecraftItalia
public static boolean enabledMinecraftItalia()Deprecated.- Returns:
- if the MinecraftItalia feature is enabled
-
getMinecraftItaliaValue
Deprecated.- Parameters:
value- Available values are:
* POSITION
* VOTESTOTAL
* VOTESYESTERDAY
* VOTEDp- Player to check- Returns:
- the value
-
missingVoteSites
Get the list of sites where the player has not voted.- Parameters:
p- Player to check- Returns:
- List of sites where the player has not voted
- Throws:
SQLException- SQL Error
-