mirror of
https://github.com/HibiscusMC/HibiscusCommons.git
synced 2025-12-19 15:09:26 +00:00
fix: check if hook is active before getString methods for hooks
This commit is contained in:
@@ -93,7 +93,7 @@ public class Hooks {
|
||||
|
||||
public static String getStringItem(ItemStack itemStack) {
|
||||
for (Hook hook : hooks.values()) {
|
||||
if (hook.hasEnabledItemHook()) {
|
||||
if (hook.isActive() && hook.hasEnabledItemHook()) {
|
||||
String stringyItem = hook.getItemString(itemStack);
|
||||
if (stringyItem == null) continue;
|
||||
return hook.getId() + ":" + stringyItem;
|
||||
@@ -104,7 +104,7 @@ public class Hooks {
|
||||
|
||||
public static String getStringEntity(Entity entity) {
|
||||
for (Hook hook : hooks.values()) {
|
||||
if (Bukkit.getPluginManager().getPlugin(hook.getId()) != null && hook.hasEnabledEntityHook()) {
|
||||
if (hook.isActive() && hook.hasEnabledEntityHook()) {
|
||||
String stringyEntity = hook.getEntityString(entity);
|
||||
if (stringyEntity != null) return hook.getId() + ":" + stringyEntity;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user