Fixed a NPE where an attribute name would start with minecraft:

This commit is contained in:
Focusvity 2023-10-02 12:15:59 +11:00
parent d806ad56f2
commit 7254ddcce3
No known key found for this signature in database
GPG Key ID: 85AD157561ABE94B
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ public enum Attributes
{
for (Attributes attr : values())
{
if (attr.name().equalsIgnoreCase(name) || attr.mcName.equalsIgnoreCase(name))
if (attr.name().equalsIgnoreCase(name) || attr.mcName.equalsIgnoreCase(name.replace("minecraft:", "")))
{
return attr;
}

View File

@ -295,7 +295,7 @@ public class ItemizerXCommand implements CommandExecutor, ItemizerXBase
lores.set(index - 1, lore);
meta.lore(lores);
item.setItemMeta(meta);
sender.sendMessage(mm.deserialize("<dark_gree>Line <white>'" + index + "' <dark_green>has been changed to <white>'" + mm.serialize(lore) + "<white>'"));
sender.sendMessage(mm.deserialize("<dark_green>Line <white>'" + index + "' <dark_green>has been changed to <white>'" + mm.serialize(lore) + "<white>'"));
return true;
}
case "clear" ->