Fixed display name not working and prompting console errors

This commit is contained in:
Jules 2024-05-20 21:50:40 -07:00
parent 16d93e244d
commit 159031c8ec
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ public class DisplayName extends StringStat implements GemStoneStat {
public void whenApplied(@NotNull ItemStackBuilder item, @NotNull StringData data) {
// Make sure stat history exists
Validate.isTrue(item.getMMOItem().hasStatHistory(this));
item.getMMOItem().computeStatHistory(this);
final ItemTier tier = item.getMMOItem().getTier();
final AdventureParser parser = MythicLib.plugin.getAdventureParser();

View File

@ -100,7 +100,7 @@ public class SkullTextureStat extends ItemStat<SkullTextureData, SkullTextureDat
try {
// TODO better exception handling
final ItemMeta meta = mmoitem.getNBT().getItem().getItemMeta();
Validate.isTrue(meta instanceof SkullMeta);
Validate.isTrue(meta instanceof SkullMeta, "Item is not a skull");
final Object profile = MythicLib.plugin.getVersion().getWrapper().getProfile((SkullMeta) meta);
mmoitem.setData(ItemStats.SKULL_TEXTURE, new SkullTextureData(profile));
} catch (RuntimeException ignored) {