diff --git a/Changelog.txt b/Changelog.txt index 9e85db040..03443359f 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -13,6 +13,7 @@ Version 1.5.01-dev + Added option to config.yml for Alchemy. Skills.Alchemy.Prevent_Hopper_Transfer_Bottles + Added support for `MATERIAL|data` format in treasures.yml + Added API to experience events to get XP gain reason + + Added API to check if an entity is bleeding = Fixed bug where the Updater was running on the main thread. = Fixed bug when players would use /ptp without being in a party = Fixed bug where player didn't have a mcMMOPlayer object in AsyncPlayerChatEvent diff --git a/src/main/java/com/gmail/nossr50/api/AbilityAPI.java b/src/main/java/com/gmail/nossr50/api/AbilityAPI.java index d701fb180..8aa59f202 100644 --- a/src/main/java/com/gmail/nossr50/api/AbilityAPI.java +++ b/src/main/java/com/gmail/nossr50/api/AbilityAPI.java @@ -1,9 +1,11 @@ package com.gmail.nossr50.api; +import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.AbilityType; +import com.gmail.nossr50.runnables.skills.BleedTimerTask; import com.gmail.nossr50.util.player.UserManager; public final class AbilityAPI { @@ -80,4 +82,8 @@ public final class AbilityAPI { public static void setTreeFellerCooldown(Player player, long cooldown) { UserManager.getPlayer(player).setAbilityDATS(AbilityType.TREE_FELLER, cooldown); } + + public static boolean isBleeding(LivingEntity entity) { + return BleedTimerTask.isBleeding(entity); + } } diff --git a/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java b/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java index 03e09612a..df13f98d5 100644 --- a/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/skills/BleedTimerTask.java @@ -107,4 +107,8 @@ public class BleedTimerTask extends BukkitRunnable { bleedList.put(entity, Math.min(newTicks, MAX_BLEED_TICKS)); } } + + public static boolean isBleeding(LivingEntity entity) { + return bleedList.containsKey(entity); + } }