|
@@ -1,29 +1,28 @@
|
|
|
package com.gmail.nossr50.core.runnables.skills;
|
|
|
|
|
|
-import com.gmail.nossr50.core.config.skills.AdvancedConfig;
|
|
|
+import com.gmail.nossr50.core.config.AdvancedConfig;
|
|
|
import com.gmail.nossr50.core.datatypes.interactions.NotificationType;
|
|
|
-import com.gmail.nossr50.mcMMO;
|
|
|
-import com.gmail.nossr50.util.MobHealthbarUtils;
|
|
|
-import com.gmail.nossr50.util.player.NotificationManager;
|
|
|
-import com.gmail.nossr50.util.skills.CombatUtils;
|
|
|
-import com.gmail.nossr50.util.skills.ParticleEffectUtils;
|
|
|
-import com.gmail.nossr50.util.sounds.SoundManager;
|
|
|
-import com.gmail.nossr50.util.sounds.SoundType;
|
|
|
-import org.bukkit.entity.LivingEntity;
|
|
|
-import org.bukkit.entity.Player;
|
|
|
-import org.bukkit.scheduler.BukkitRunnable;
|
|
|
+import com.gmail.nossr50.core.mcmmo.entity.Living;
|
|
|
+import com.gmail.nossr50.core.mcmmo.entity.Player;
|
|
|
+import com.gmail.nossr50.core.util.MobHealthbarUtils;
|
|
|
+import com.gmail.nossr50.core.util.player.NotificationManager;
|
|
|
+import com.gmail.nossr50.core.util.skills.CombatUtils;
|
|
|
+import com.gmail.nossr50.core.util.skills.ParticleEffectUtils;
|
|
|
+import com.gmail.nossr50.core.util.sounds.SoundManager;
|
|
|
+import com.gmail.nossr50.core.util.sounds.SoundType;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Iterator;
|
|
|
import java.util.Map;
|
|
|
import java.util.Map.Entry;
|
|
|
+import java.util.UUID;
|
|
|
|
|
|
public class BleedTimerTask extends BukkitRunnable {
|
|
|
- private static Map<LivingEntity, BleedContainer> bleedList = new HashMap<LivingEntity, BleedContainer>();
|
|
|
+ private static Map<UUID, BleedContainer> bleedList = new HashMap<UUID, BleedContainer>();
|
|
|
|
|
|
public static BleedContainer copyContainer(BleedContainer container) {
|
|
|
- LivingEntity target = container.target;
|
|
|
- LivingEntity source = container.damageSource;
|
|
|
+ Living target = container.target;
|
|
|
+ Living source = container.damageSource;
|
|
|
int bleedTicks = container.bleedTicks;
|
|
|
int bleedRank = container.bleedRank;
|
|
|
|
|
@@ -32,11 +31,11 @@ public class BleedTimerTask extends BukkitRunnable {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Instantly Bleed out a LivingEntity
|
|
|
+ * Instantly Bleed out a Living
|
|
|
*
|
|
|
- * @param entity LivingEntity to bleed out
|
|
|
+ * @param entity Living to bleed out
|
|
|
*/
|
|
|
- public static void bleedOut(LivingEntity entity) {
|
|
|
+ public static void bleedOut(Living entity) {
|
|
|
/*
|
|
|
* Don't remove anything from the list outside of run()
|
|
|
*/
|
|
@@ -47,27 +46,27 @@ public class BleedTimerTask extends BukkitRunnable {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Add a LivingEntity to the bleedList if it is not in it.
|
|
|
+ * Add a Living to the bleedList if it is not in it.
|
|
|
*
|
|
|
- * @param entity LivingEntity to add
|
|
|
+ * @param entity Living to add
|
|
|
* @param ticks Number of bleeding ticks
|
|
|
*/
|
|
|
- public static void add(LivingEntity entity, LivingEntity attacker, int ticks, int bleedRank) {
|
|
|
+ public static void add(Living entity, Living attacker, int ticks, int bleedRank) {
|
|
|
BleedContainer newBleedContainer = new BleedContainer(entity, ticks, bleedRank, attacker);
|
|
|
bleedList.put(entity, newBleedContainer);
|
|
|
}
|
|
|
|
|
|
- public static boolean isBleeding(LivingEntity entity) {
|
|
|
+ public static boolean isBleeding(Living entity) {
|
|
|
return bleedList.containsKey(entity);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void run() {
|
|
|
- Iterator<Entry<LivingEntity, BleedContainer>> bleedIterator = bleedList.entrySet().iterator();
|
|
|
+ Iterator<Entry<Living, BleedContainer>> bleedIterator = bleedList.entrySet().iterator();
|
|
|
|
|
|
while (bleedIterator.hasNext()) {
|
|
|
- Entry<LivingEntity, BleedContainer> containerEntry = bleedIterator.next();
|
|
|
- LivingEntity target = containerEntry.getKey();
|
|
|
+ Entry<Living, BleedContainer> containerEntry = bleedIterator.next();
|
|
|
+ Living target = containerEntry.getKey();
|
|
|
|
|
|
int bleedTicks = containerEntry.getValue().bleedTicks;
|
|
|
|