mirror of
https://github.com/PEXPlugins/Modifyworld.git
synced 2025-03-11 13:21:25 +01:00
Check that animal owner is not null before name-based permission check
This commit is contained in:
parent
fe91279f9e
commit
0bfc70e98a
@ -72,7 +72,7 @@ public abstract class ModifyworldListener implements Listener {
|
||||
} else if (entity instanceof Tameable) {
|
||||
Tameable animal = (Tameable) entity;
|
||||
|
||||
return "animal." + entityName + (animal.isTamed() ? "." + animal.getOwner().getName() : "");
|
||||
return "animal." + entityName + (animal.isTamed() && animal.getOwner() != null ? "." + animal.getOwner().getName() : "");
|
||||
}
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ public abstract class ModifyworldListener implements Listener {
|
||||
|
||||
return category.getNameDot() + entityName;
|
||||
}
|
||||
|
||||
|
||||
private String getInventoryTypePermission(InventoryType type) {
|
||||
return formatEnumString(type.name());
|
||||
}
|
||||
@ -179,7 +179,7 @@ public abstract class ModifyworldListener implements Listener {
|
||||
private void registerEvents(Plugin plugin) {
|
||||
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
||||
}
|
||||
|
||||
|
||||
private String formatEnumString(String enumName) {
|
||||
return enumName.toLowerCase().replace("_", "");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user