Fixed error triggering health event

This commit is contained in:
Zeshan Aslam 2019-08-08 12:20:59 -04:00
parent 511c035d84
commit 5ac1d9258a
5 changed files with 18 additions and 14 deletions

View File

@ -46,7 +46,12 @@ public class LookThread extends BukkitRunnable {
String name = plugin.healthUtil.getName(livingEntity, player);
if (TargetHelper.canSee(player, livingEntity.getLocation(), transparentTypeIds) && !plugin.healthUtil.isBlacklisted(livingEntity, name)) {
Bukkit.getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
plugin.healthUtil.sendHealth(player, livingEntity, livingEntity.getHealth());
}
});
break;
}
}

View File

@ -21,6 +21,10 @@ public class HealthSendEvent extends Event implements Cancellable {
this.isCancelled = false;
}
public static HandlerList getHandlerList() {
return handlers;
}
public Player getPlayer() {
return player;
}
@ -37,10 +41,6 @@ public class HealthSendEvent extends Event implements Cancellable {
this.message = message;
}
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public HandlerList getHandlers() {
return handlers;

View File

@ -1,10 +1,9 @@
package com.zeshanaslam.actionhealth.support;
import com.meowj.langutils.lang.LanguageHelper;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import com.meowj.langutils.lang.LanguageHelper;
public class LangUtilsSupport {
public String getName(Entity entity, Player player) {