diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/interaction/ItemSkin.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/interaction/ItemSkin.java index 4650f8a7..6878ec20 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/interaction/ItemSkin.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/interaction/ItemSkin.java @@ -137,10 +137,6 @@ public class ItemSkin extends UseItem { target.addTag(new ItemTag(SKIN_ID_TAG, appliedSkinId)); target.addTag(new ItemTag(SKIN_TYPE_TAG, appliedTypeId)); - // Custom model data - if (nbtSkin.getInteger("CustomModelData") != 0) - target.addTag(new ItemTag("CustomModelData", nbtSkin.getInteger("CustomModelData"))); - // Particles if (!nbtSkin.getString("MMOITEMS_ITEM_PARTICLES").isEmpty()) target.addTag(new ItemTag("MMOITEMS_ITEM_PARTICLES", nbtSkin.getString("MMOITEMS_ITEM_PARTICLES"))); @@ -155,6 +151,9 @@ public class ItemSkin extends UseItem { // TODO SkinStat interface + // Custom model data + if (skinMeta.hasCustomModelData()) meta.setCustomModelData(skinMeta.getCustomModelData()); + // Unbreakable & durability if (skinMeta.isUnbreakable()) { meta.setUnbreakable(true); diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/stat/CanDeskin.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/stat/CanDeskin.java index b73fff4b..9d00a1a1 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/stat/CanDeskin.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/stat/CanDeskin.java @@ -53,12 +53,6 @@ public class CanDeskin extends BooleanStat implements ConsumableItemInteraction MMOItem originalMmoitem = targetTemplate.newBuilder(playerData.getRPG()).build(); ItemStack originalItem = targetTemplate.newBuilder(playerData.getRPG()).build().newBuilder().build(); - int originalCustomModelData = originalItem.getItemMeta().hasCustomModelData() ? originalItem.getItemMeta().getCustomModelData() : -1; - if (originalCustomModelData != -1) - target.addTag(new ItemTag("CustomModelData", originalCustomModelData)); - else - target.removeTag("CustomModelData"); - if (originalMmoitem.hasData(ItemStats.ITEM_PARTICLES)) { JsonObject itemParticles = ((ParticleData) originalMmoitem.getData(ItemStats.ITEM_PARTICLES)).toJson(); target.addTag(new ItemTag("MMOITEMS_ITEM_PARTICLES", itemParticles.toString())); @@ -69,6 +63,10 @@ public class CanDeskin extends BooleanStat implements ConsumableItemInteraction ItemMeta targetItemMeta = targetItem.getItemMeta(); ItemMeta originalItemMeta = originalItem.getItemMeta(); + // Custom model data + final Integer originalCustomModelData = originalItemMeta.hasCustomModelData() ? originalItemMeta.getCustomModelData() : null; + targetItemMeta.setCustomModelData(originalCustomModelData); + // TODO SkinStat if (targetItemMeta.isUnbreakable()) {