diff --git a/src/main/java/com/songoda/epichoppers/EpicHoppers.java b/src/main/java/com/songoda/epichoppers/EpicHoppers.java index 6bd0b35..0f98e6e 100644 --- a/src/main/java/com/songoda/epichoppers/EpicHoppers.java +++ b/src/main/java/com/songoda/epichoppers/EpicHoppers.java @@ -12,8 +12,7 @@ import com.songoda.core.gui.GuiManager; import com.songoda.core.hooks.EconomyManager; import com.songoda.core.hooks.ProtectionManager; import com.songoda.core.locale.Locale; -import com.songoda.core.nms.NmsManager; -import com.songoda.core.nms.nbt.NBTItem; +import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem; import com.songoda.core.utils.TextUtils; import com.songoda.epichoppers.boost.BoostManager; import com.songoda.epichoppers.commands.CommandBoost; @@ -251,9 +250,9 @@ public class EpicHoppers extends SongodaPlugin { } item.setItemMeta(itemmeta); - NBTItem nbtItem = NmsManager.getNbt().of(item); - nbtItem.set("level", level.getLevel()); - return nbtItem.finish(); + NBTItem nbtItem = new NBTItem(item); + nbtItem.setInteger("level", level.getLevel()); + return nbtItem.getItem(); } @Override diff --git a/src/main/java/com/songoda/epichoppers/hopper/levels/LevelManager.java b/src/main/java/com/songoda/epichoppers/hopper/levels/LevelManager.java index 2d6ab46..3559192 100644 --- a/src/main/java/com/songoda/epichoppers/hopper/levels/LevelManager.java +++ b/src/main/java/com/songoda/epichoppers/hopper/levels/LevelManager.java @@ -2,7 +2,7 @@ package com.songoda.epichoppers.hopper.levels; import com.songoda.core.nms.NmsManager; import com.songoda.core.nms.nbt.NBTCore; -import com.songoda.core.nms.nbt.NBTItem; +import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem; import com.songoda.epichoppers.hopper.levels.modules.Module; import org.bukkit.ChatColor; import org.bukkit.inventory.ItemStack; @@ -28,11 +28,10 @@ public class LevelManager { } public Level getLevel(ItemStack item) { - NBTCore nbt = NmsManager.getNbt(); - NBTItem nbtItem = nbt.of(item); + NBTItem nbtItem = new NBTItem(item); - if (nbtItem.has("level")) - return getLevel(nbtItem.getNBTObject("level").asInt()); + if (nbtItem.hasKey("level")) + return getLevel(nbtItem.getInteger("level")); // Legacy trash. if (item.hasItemMeta() && item.getItemMeta().getDisplayName().contains(":")) {