Added API to check if an entity is bleeding

This commit is contained in:
TfT_02 2014-05-02 19:41:44 +02:00
parent 66a4925371
commit af64bdf742
3 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -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);
}
}

View File

@ -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);
}
}