Fixed error triggering health event
This commit is contained in:
parent
511c035d84
commit
5ac1d9258a
|
@ -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)) {
|
||||
plugin.healthUtil.sendHealth(player, livingEntity, livingEntity.getHealth());
|
||||
Bukkit.getScheduler().runTask(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
plugin.healthUtil.sendHealth(player, livingEntity, livingEntity.getHealth());
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,9 +59,9 @@ public class Main extends JavaPlugin {
|
|||
if (Bukkit.getServer().getPluginManager().isPluginEnabled("MythicMobs")) {
|
||||
mythicMobsEnabled = true;
|
||||
}
|
||||
|
||||
|
||||
if (Bukkit.getServer().getPluginManager().isPluginEnabled("LangUtils")) {
|
||||
langUtilsEnabled = true;
|
||||
langUtilsEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
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) {
|
||||
return LanguageHelper.getEntityName(entity, player);
|
||||
}
|
||||
|
||||
|
||||
public String getName(Entity entity, String locale) {
|
||||
return LanguageHelper.getEntityName(entity, locale);
|
||||
}
|
||||
|
|
|
@ -187,11 +187,11 @@ public class HealthUtil {
|
|||
|
||||
if (mcMMOName == null) {
|
||||
if (entity.getCustomName() != null) {
|
||||
name = entity.getCustomName();
|
||||
} else if(plugin.langUtilsEnabled && plugin.configStore.useClientLanguage && receiver != null) {
|
||||
name = new LangUtilsSupport().getName(entity, receiver);
|
||||
name = entity.getCustomName();
|
||||
} else if (plugin.langUtilsEnabled && plugin.configStore.useClientLanguage && receiver != null) {
|
||||
name = new LangUtilsSupport().getName(entity, receiver);
|
||||
} else {
|
||||
name = getNameReflection(entity);
|
||||
name = getNameReflection(entity);
|
||||
}
|
||||
} else if (mcMMOName.equals("")) {
|
||||
name = getNameReflection(entity);
|
||||
|
|
Loading…
Reference in New Issue