fix: replace deprecated usage of Core's NBTItem class with item-nbt-api

This commit is contained in:
Christian Koop 2024-06-22 15:27:46 +02:00
parent 5b5e554af8
commit 0094106b43
No known key found for this signature in database
GPG Key ID: 6A4A09E8ED946113

View File

@ -1,7 +1,6 @@
package com.craftaro.epichoppers.hopper.levels; package com.craftaro.epichoppers.hopper.levels;
import com.craftaro.core.nms.Nms; import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBT;
import com.craftaro.core.nms.nbt.NBTCore;
import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem; import com.craftaro.core.third_party.de.tr7zw.nbtapi.NBTItem;
import com.craftaro.epichoppers.hopper.levels.modules.Module; import com.craftaro.epichoppers.hopper.levels.modules.Module;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -45,9 +44,7 @@ public class LevelManagerImpl implements LevelManager {
@Override @Override
public boolean isEpicHopper(ItemStack item) { public boolean isEpicHopper(ItemStack item) {
NBTCore nbt = Nms.getImplementations().getNbt(); if (NBT.readNbt(item).hasTag("level")) {
if (nbt.of(item).has("level")) {
return true; return true;
} }