Class HeroxVoteAPI

java.lang.Object
com.xSavior_of_God.HeroxVote.api.HeroxVoteAPI

public class HeroxVoteAPI extends Object

HeroxVote API!

Central API of HeroxVote
Since:
2020-06-04
Version:
7.0.2
Author:
xSavior_of_God
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addMoney(org.bukkit.OfflinePlayer p, double amount)
    Add Herox economy money to the player.
    static void
    addVote(org.bukkit.OfflinePlayer player, int amount)
    SET MAX 1 000 VOTES x TIME!
    static void
    addVote(org.bukkit.OfflinePlayer player, int amount, String serviceName, String address)
    SET MAX 1 000 VOTES x TIME!
    static boolean
    Deprecated. 
    static String
    getDiscordID(org.bukkit.OfflinePlayer player)
    Returns NULL if DiscordId is not linked!
    static String
    getLastVoteServiceName(org.bukkit.OfflinePlayer player)
     
    static Timestamp
    getLastVoteTimeStamp(org.bukkit.OfflinePlayer player)
     
    static String
    getMinecraftItaliaValue(String value, org.bukkit.OfflinePlayer p)
    Deprecated. 
    static double
    getMoney(org.bukkit.OfflinePlayer p)
    Get the current Herox economy balance of the player.
    static int
     
    static org.bukkit.OfflinePlayer
    Returns NULL if DiscordId is not linked!
    static org.bukkit.OfflinePlayer
    Returns NULL if TelegramId is not linked!
    static String
    getTelegramID(org.bukkit.OfflinePlayer player)
    Returns NULL if TelegramId is not linked!
    static Map<Integer,com.xSavior_of_God.HeroxVote.utils.HeroxVotePlayer>
    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 balance
    static int
    getVote(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' == December
    static Map<Integer,com.xSavior_of_God.HeroxVote.party.VoteSites>
    A map that contains the values of VoteParty.
    static int
    getVotesTotal(int time)
    Simple use
    '-1' == ALL TIME
    '-2' == THIS MONTH
    '-3' == THIS WEEK
    '-4' == THIS YEAR
    '-5' == TODAY
    static boolean
    hasVotedOnMinecraftItalia(org.bukkit.OfflinePlayer player)
    Deprecated. 
    static boolean
    hasVotedOnMinecraftItaliaNicknameCheck(org.bukkit.OfflinePlayer player)
    Deprecated. 
    static boolean
    hasVotedOnNameMC(org.bukkit.OfflinePlayer player)
    Check if the player has voted on NameMC
    static String
    lastVoteDate(org.bukkit.OfflinePlayer player)
    Check the last vote date
    static String
    lastVoteServiceName(org.bukkit.OfflinePlayer player)
    Check the last ServiceName
    static List<String>
    missingVoteSites(org.bukkit.entity.Player p)
    Get the list of sites where the player has not voted.
    static void
    setMoney(org.bukkit.OfflinePlayer p, double amount)
    Update the current Herox economy balance of the player.
    static void
    setVote(org.bukkit.OfflinePlayer p, int amount)
    SET MAX 1 000 VOTES x TIME!
    static void
    takeVote(org.bukkit.OfflinePlayer p, int amount)
    SET MAX 1 000 VOTES x TIME!

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HeroxVoteAPI

      public HeroxVoteAPI()
  • Method Details

    • getVote

      public static int getVote(org.bukkit.OfflinePlayer p, int month) throws SQLException
      Simple use
      '-1' == ALL TIME
      '-2' == THIS MONTH
      '-3' == THIS WEEK
      '-4' == THIS YEAR
      '-5' == TODAY
      '0' == January
      '11' == December
      Parameters:
      p - OfflinePlayer
      month - 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 - OfflinePlayer
      amount - Amount of Vote
    • addVote

      public static void addVote(org.bukkit.OfflinePlayer player, int amount)

      SET MAX 1 000 VOTES x TIME!

      Parameters:
      player - OfflinePlayer
      amount - 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 - OfflinePlayer
      amount - Amount of Vote
      serviceName - Service Name
      address - Address
    • takeVote

      public static void takeVote(org.bukkit.OfflinePlayer p, int amount)

      SET MAX 1 000 VOTES x TIME!

      Parameters:
      p - OfflinePlayer
      amount - Amount of Vote
    • getMoney

      public static double getMoney(org.bukkit.OfflinePlayer p) throws SQLException
      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 - OfflinePlayer
      amount - Amount of money
    • addMoney

      public static void addMoney(org.bukkit.OfflinePlayer p, double amount) throws SQLException
      Add Herox economy money to the player.
      Parameters:
      p - OfflinePlayer
      amount - Amount of money
      Throws:
      SQLException - SQL Error
    • getVoteParty

      public static Map<Integer,com.xSavior_of_God.HeroxVote.party.VoteSites> 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 balance
      month - 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

      public static boolean hasVotedOnNameMC(org.bukkit.OfflinePlayer player) throws IOException
      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

      public static String lastVoteDate(org.bukkit.OfflinePlayer player) throws SQLException
      Check the last vote date
      Parameters:
      player - Player to check
      Returns:
      String value of a TimeStamp
      Throws:
      SQLException - SQL Error
    • lastVoteServiceName

      public static String lastVoteServiceName(org.bukkit.OfflinePlayer player) throws SQLException
      Check the last ServiceName
      Parameters:
      player - Player to check
      Returns:
      ServiceName
      Throws:
      SQLException - SQL Error
    • getVotesTotal

      public static int getVotesTotal(int time) throws SQLException
      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

      public static String getDiscordID(org.bukkit.OfflinePlayer player) throws SQLException
      Returns NULL if DiscordId is not linked!
      Parameters:
      player - Player to check
      Returns:
      Discord user Id
      Throws:
      SQLException - SQL Error
    • getTelegramID

      public static String getTelegramID(org.bukkit.OfflinePlayer player) throws SQLException
      Returns NULL if 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
      Returns NULL if 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
      Returns NULL if TelegramId is not linked!
      Parameters:
      TelegramId - Telegram user Id
      Returns:
      OfflinePlayer linked to the TelegramId
      Throws:
      SQLException - SQL Error
    • getLastVoteTimeStamp

      public static Timestamp getLastVoteTimeStamp(org.bukkit.OfflinePlayer player) throws SQLException
      Parameters:
      player - Player to check
      Returns:
      the last vote time of the player
      Throws:
      SQLException - SQL Error
    • getLastVoteServiceName

      public static String getLastVoteServiceName(org.bukkit.OfflinePlayer player) throws SQLException
      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

      public static int getNumberOfPlayerRegistered() throws SQLException
      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

      public static String getMinecraftItaliaValue(String value, org.bukkit.OfflinePlayer p)
      Deprecated.
      Parameters:
      value - Available values are:
      * POSITION
      * VOTESTOTAL
      * VOTESYESTERDAY
      * VOTED
      p - Player to check
      Returns:
      the value
    • missingVoteSites

      public static List<String> missingVoteSites(org.bukkit.entity.Player p) throws SQLException
      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