From 3b249aa4e6c9101149f34cd4b3307aa92cb98480 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Sat, 11 Oct 2014 12:03:08 +0200 Subject: [PATCH] This function is designed for API usage. --- .../com/gmail/nossr50/api/AbilityAPI.java | 41 +++++++++++++++++++ .../java/com/gmail/nossr50/api/ChatAPI.java | 16 ++++++++ .../java/com/gmail/nossr50/api/PartyAPI.java | 8 ++++ 3 files changed, 65 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/api/AbilityAPI.java b/src/main/java/com/gmail/nossr50/api/AbilityAPI.java index 3c98e4845..08a689d6f 100644 --- a/src/main/java/com/gmail/nossr50/api/AbilityAPI.java +++ b/src/main/java/com/gmail/nossr50/api/AbilityAPI.java @@ -13,6 +13,8 @@ public final class AbilityAPI { /** * Checks if the ability "Berserk" is active. + *
+ * This function is designed for API usage. * * @param player The {@link Player} to check * @@ -24,6 +26,8 @@ public final class AbilityAPI { /** * Checks if the ability "Giga Drill Breaker" is active. + *
+ * This function is designed for API usage. * * @param player The {@link Player} to check * @@ -35,6 +39,8 @@ public final class AbilityAPI { /** * Checks if the ability "Green Terra" is active. + *
+ * This function is designed for API usage. * * @param player The {@link Player} to check * @@ -46,6 +52,8 @@ public final class AbilityAPI { /** * Checks if the ability "Serrated Strikes" is active. + *
+ * This function is designed for API usage. * * @param player The {@link Player} to check * @@ -57,6 +65,8 @@ public final class AbilityAPI { /** * Checks if the ability "Skull Splitter" is active. + *
+ * This function is designed for API usage. * * @param player The {@link Player} to check * @@ -68,6 +78,8 @@ public final class AbilityAPI { /** * Checks if the ability "Super Breaker" is active. + *
+ * This function is designed for API usage. * * @param player The {@link Player} to check * @@ -79,6 +91,8 @@ public final class AbilityAPI { /** * Checks if the ability "Tree Feller" is active. + *
+ * This function is designed for API usage. * * @param player The {@link Player} to check * @@ -90,6 +104,8 @@ public final class AbilityAPI { /** * Checks if any ability is active. + *
+ * This function is designed for API usage. * * @param player The {@link Player} to check * @@ -109,6 +125,8 @@ public final class AbilityAPI { /** * Reset the ability cooldowns for a player + *
+ * This function is designed for API usage. * * @param player The {@link Player} to reset the cooldowns for */ @@ -118,6 +136,8 @@ public final class AbilityAPI { /** * Set the cooldown for the "Berserk" ability + *
+ * This function is designed for API usage. * * @param player The {@link Player} to set the cooldown for * @param cooldown The cooldown length to set @@ -128,6 +148,8 @@ public final class AbilityAPI { /** * Set the cooldown for the "Giga Drill Breaker" ability + *
+ * This function is designed for API usage. * * @param player The {@link Player} to set the cooldown for * @param cooldown The cooldown length to set @@ -138,6 +160,8 @@ public final class AbilityAPI { /** * Set the cooldown for the "Green Terra" ability + *
+ * This function is designed for API usage. * * @param player The {@link Player} to set the cooldown for * @param cooldown The cooldown length to set @@ -148,6 +172,8 @@ public final class AbilityAPI { /** * Set the cooldown for the "Serrated Strikes" ability + *
+ * This function is designed for API usage. * * @param player The {@link Player} to set the cooldown for * @param cooldown The cooldown length to set @@ -158,6 +184,8 @@ public final class AbilityAPI { /** * Set the cooldown for the "Skull Splitter" ability + *
+ * This function is designed for API usage. * * @param player The {@link Player} to set the cooldown for * @param cooldown The cooldown length to set @@ -168,6 +196,8 @@ public final class AbilityAPI { /** * Set the cooldown for the "Super Breaker" ability + *
+ * This function is designed for API usage. * * @param player The {@link Player} to set the cooldown for * @param cooldown The cooldown length to set @@ -178,6 +208,8 @@ public final class AbilityAPI { /** * Set the cooldown for the "Tree Feller" ability + *
+ * This function is designed for API usage. * * @param player The {@link Player} to set the cooldown for * @param cooldown The cooldown length to set @@ -186,6 +218,15 @@ public final class AbilityAPI { UserManager.getPlayer(player).setAbilityDATS(AbilityType.TREE_FELLER, cooldown); } + + /** + * Check if a LivingEntity is bleeding + *
+ * This function is designed for API usage. + * + * @param entity The {@link LivingEntity} to check + * @return true if entity is bleeding, false otherwise + */ public static boolean isBleeding(LivingEntity entity) { return BleedTimerTask.isBleeding(entity); } diff --git a/src/main/java/com/gmail/nossr50/api/ChatAPI.java b/src/main/java/com/gmail/nossr50/api/ChatAPI.java index 5206295cd..e0822d2ae 100644 --- a/src/main/java/com/gmail/nossr50/api/ChatAPI.java +++ b/src/main/java/com/gmail/nossr50/api/ChatAPI.java @@ -71,6 +71,8 @@ public final class ChatAPI { /** * Check if a player is currently talking in party chat. + *
+ * This function is designed for API usage. * * @param player The player to check * @return true if the player is using party chat, false otherwise @@ -81,6 +83,8 @@ public final class ChatAPI { /** * Check if a player is currently talking in party chat. + *
+ * This function is designed for API usage. * * @param playerName The name of the player to check * @return true if the player is using party chat, false otherwise @@ -91,6 +95,8 @@ public final class ChatAPI { /** * Check if a player is currently talking in admin chat. + *
+ * This function is designed for API usage. * * @param player The player to check * @return true if the player is using admin chat, false otherwise @@ -101,6 +107,8 @@ public final class ChatAPI { /** * Check if a player is currently talking in admin chat. + *
+ * This function is designed for API usage. * * @param playerName The name of the player to check * @return true if the player is using admin chat, false otherwise @@ -111,6 +119,8 @@ public final class ChatAPI { /** * Toggle the party chat mode of a player. + *
+ * This function is designed for API usage. * * @param player The player to toggle party chat on. */ @@ -120,6 +130,8 @@ public final class ChatAPI { /** * Toggle the party chat mode of a player. + *
+ * This function is designed for API usage. * * @param playerName The name of the player to toggle party chat on. */ @@ -129,6 +141,8 @@ public final class ChatAPI { /** * Toggle the admin chat mode of a player. + *
+ * This function is designed for API usage. * * @param player The player to toggle admin chat on. */ @@ -138,6 +152,8 @@ public final class ChatAPI { /** * Toggle the admin chat mode of a player. + *
+ * This function is designed for API usage. * * @param playerName The name of the player to toggle party chat on. */ diff --git a/src/main/java/com/gmail/nossr50/api/PartyAPI.java b/src/main/java/com/gmail/nossr50/api/PartyAPI.java index c2d0d9b76..869069d6a 100644 --- a/src/main/java/com/gmail/nossr50/api/PartyAPI.java +++ b/src/main/java/com/gmail/nossr50/api/PartyAPI.java @@ -192,6 +192,14 @@ public final class PartyAPI { return PartyManager.getOnlineMembers(player); } + /** + * Check is a certain party has an ally + *
+ * This function is designed for API usage. + * + * @param partyName The name of the party to check + * @return true if the party has an ally, false otherwise + */ public static boolean hasAlly(String partyName) { return getAllyName(partyName) != null; }