Class MiscUtils
java.lang.Object
com.bencodez.advancedcore.api.misc.MiscUtils
Miscellaneous utility methods.
-
Method Summary
Modifier and TypeMethodDescriptionaddSeconds(Date date, int seconds) Adds seconds to a date.voidBroadcast.voidbroadcast(String broadcastMsg, Collection<? extends org.bukkit.entity.Player> players) Broadcasts a message to specific players.booleancheckChance(double chance, double outOf) convertUsers(ArrayList<AdvancedCoreUser> array) Convert.convertUsers(Set<AdvancedCoreUser> set) Convert set.voidvoidexecuteConsoleCommands(String playerName, ArrayList<String> cmds, HashMap<String, String> placeholders, boolean stagger) voidexecuteConsoleCommands(ArrayList<String> cmds, HashMap<String, String> placeholders, boolean stagger) voidexecuteConsoleCommands(org.bukkit.entity.Player player, String command, HashMap<String, String> placeholders) voidexecuteConsoleCommands(org.bukkit.entity.Player player, ArrayList<String> cmds, HashMap<String, String> placeholders, boolean stagger) getBlockMeta(org.bukkit.block.Block block, String str) getConnection(org.bukkit.entity.Player player) Gets the connection.intgetDayFromMili(long time) Gets the day from mili.org.bukkit.enchantments.EnchantmentgetEnchant(String enchant, String enchant2) getEntityMeta(org.bukkit.entity.Entity entity, String str) org.bukkit.entity.EntityTypegetEntityType(String entity, String entity2) intgetHourFromMili(long time) Gets the hour from mili.static MiscUtilsintgetMinutesFromMili(long time) Gets the minutes from mili.intgetMonthFromMili(long time) Gets the month from mili.getMonthString(int month) Gets the month string.org.bukkit.potion.PotionEffectTypegetPotionType(String potion, String potion2) getProgressBar(int current, int max, int totalBars, String symbol, String completedColor, String notCompletedColor) List<org.bukkit.block.Block> getRegionBlocks(org.bukkit.World world, org.bukkit.Location loc1, org.bukkit.Location loc2) Gets the region blocks.getTime(long mills) intgetYearFromMili(long time) Gets the year from mili.voidsetBlockMeta(org.bukkit.block.Block block, String str, Object value) voidsetEntityMeta(org.bukkit.entity.Entity entity, String str, Object value) org.bukkit.inventory.ItemStacksetSkullOwner(String playerName) Deprecated.org.bukkit.inventory.ItemStacksetSkullOwner(org.bukkit.OfflinePlayer player) sortByKeys(LinkedHashMap<Double, String> topVoterAllTime, boolean order) sortByValues(HashMap<AdvancedCoreUser, Integer> unsortMap, boolean order) Sort by values.sortByValuesLong(HashMap<AdvancedCoreUser, Long> unsortMap, boolean order)
-
Method Details
-
getInstance
-
addSeconds
Adds seconds to a date.- Parameters:
date- the date to add toseconds- the number of seconds to add- Returns:
- the new date
-
broadcast
Broadcast.- Parameters:
broadcastMsg- the broadcast msg
-
broadcast
Broadcasts a message to specific players.- Parameters:
broadcastMsg- the message to broadcastplayers- the players to broadcast to
-
checkChance
public boolean checkChance(double chance, double outOf) -
convertUsers
Convert.- Parameters:
array- the array- Returns:
- the user[]
-
convertUsers
Convert set.- Parameters:
set- the set- Returns:
- the array list
-
executeConsoleCommands
-
executeConsoleCommands
-
executeConsoleCommands
-
executeConsoleCommands
-
executeConsoleCommands
-
getBlockMeta
-
getConnection
public Object getConnection(org.bukkit.entity.Player player) throws SecurityException, NoSuchMethodException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, InvocationTargetException Gets the connection.- Parameters:
player- the player- Returns:
- the connection
- Throws:
SecurityException- the security exceptionNoSuchMethodException- the no such method exceptionNoSuchFieldException- the no such field exceptionIllegalArgumentException- the illegal argument exceptionIllegalAccessException- the illegal access exceptionInvocationTargetException- the invocation target exception
-
getDayFromMili
public int getDayFromMili(long time) Gets the day from mili.- Parameters:
time- the time- Returns:
- the day from mili
-
getEnchant
-
getEntityMeta
-
getEntityType
-
getHourFromMili
public int getHourFromMili(long time) Gets the hour from mili.- Parameters:
time- the time- Returns:
- the hour from mili
-
getMinutesFromMili
public int getMinutesFromMili(long time) Gets the minutes from mili.- Parameters:
time- the time- Returns:
- the minutes from mili
-
getMonthFromMili
public int getMonthFromMili(long time) Gets the month from mili.- Parameters:
time- the time- Returns:
- the month from mili
-
getMonthString
Gets the month string.- Parameters:
month- the month- Returns:
- the month string
-
getPotionType
-
getProgressBar
-
getRegionBlocks
public List<org.bukkit.block.Block> getRegionBlocks(org.bukkit.World world, org.bukkit.Location loc1, org.bukkit.Location loc2) Gets the region blocks.- Parameters:
world- the worldloc1- the loc 1loc2- the loc 2- Returns:
- the region blocks
-
getTime
-
getWorldNames
-
getYearFromMili
public int getYearFromMili(long time) Gets the year from mili.- Parameters:
time- the time- Returns:
- the year from mili
-
setBlockMeta
-
setEntityMeta
-
setSkullOwner
public org.bukkit.inventory.ItemStack setSkullOwner(org.bukkit.OfflinePlayer player) -
setSkullOwner
Deprecated.Sets the skull owner.- Parameters:
playerName- the player name- Returns:
- the item stack
-
sortByKeys
public LinkedHashMap<Double,String> sortByKeys(LinkedHashMap<Double, String> topVoterAllTime, boolean order) -
sortByValues
public HashMap<AdvancedCoreUser,Integer> sortByValues(HashMap<AdvancedCoreUser, Integer> unsortMap, boolean order) Sort by values.- Parameters:
unsortMap- the unsort maporder- the order- Returns:
- the hash map
-
sortByValuesLong
public HashMap<AdvancedCoreUser,Long> sortByValuesLong(HashMap<AdvancedCoreUser, Long> unsortMap, boolean order)
-