From 6b7fb05167f2b0a47d11a84493a82f31e569f266 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Sun, 27 Oct 2024 16:35:16 -0400 Subject: [PATCH] removed nbt api --- build.gradle.kts | 2 +- paper/build.gradle.kts | 3 --- .../crazyvouchers/api/CrazyManager.java | 15 --------------- .../listeners/VoucherCraftListener.java | 13 ------------- 4 files changed, 1 insertion(+), 32 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 5ed9642..c9315c2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { val buildNumber: String? = System.getenv("BUILD_NUMBER") -rootProject.version = if (buildNumber != null) "${libs.versions.minecraft.get()}-$buildNumber" else "3.8.2" +rootProject.version = if (buildNumber != null) "${libs.versions.minecraft.get()}-$buildNumber" else "3.9" subprojects.filter { it.name != "api" }.forEach { it.project.version = rootProject.version diff --git a/paper/build.gradle.kts b/paper/build.gradle.kts index f504259..ab6df84 100644 --- a/paper/build.gradle.kts +++ b/paper/build.gradle.kts @@ -14,8 +14,6 @@ repositories { dependencies { implementation(libs.vital.paper) - implementation(libs.nbtapi) - compileOnly(libs.headdatabaseapi) compileOnly(libs.placeholderapi) @@ -54,7 +52,6 @@ tasks { archiveClassifier.set("") listOf( - "de.tr7zw.changeme.nbtapi", "com.ryderbelserion.vital" ).forEach { relocate(it, "libs.$it") diff --git a/paper/src/main/java/com/badbones69/crazyvouchers/api/CrazyManager.java b/paper/src/main/java/com/badbones69/crazyvouchers/api/CrazyManager.java index 1cc092c..be066ed 100644 --- a/paper/src/main/java/com/badbones69/crazyvouchers/api/CrazyManager.java +++ b/paper/src/main/java/com/badbones69/crazyvouchers/api/CrazyManager.java @@ -7,7 +7,6 @@ import com.badbones69.crazyvouchers.api.objects.Voucher; import com.ryderbelserion.vital.common.util.FileUtil; import com.ryderbelserion.vital.paper.api.files.CustomFile; -import de.tr7zw.changeme.nbtapi.NBTItem; import com.badbones69.crazyvouchers.api.objects.VoucherCode; import io.papermc.paper.persistence.PersistentDataContainerView; import org.bukkit.Material; @@ -19,7 +18,6 @@ import org.bukkit.persistence.PersistentDataType; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -173,12 +171,6 @@ public Voucher getVoucherFromItem(final ItemStack item) { final String voucherName = container.get(PersistentKeys.voucher_item.getNamespacedKey(), PersistentDataType.STRING); voucher = getVoucher(voucherName); - } else { - NBTItem nbt = new NBTItem(item); // this section related to nbt items is deprecated, and marked for removal - - if (nbt.hasTag("voucher")) { - voucher = getVoucher(nbt.getString("voucher")); - } } } @@ -199,13 +191,6 @@ public String getArgument(final ItemStack item, final Voucher voucher) { return arg; } } - } else { - NBTItem nbt = new NBTItem(item); // this section related to nbt items is deprecated, and marked for removal - - if (nbt.hasTag("voucher") && nbt.hasTag("argument")) { - if (nbt.getString("voucher").equalsIgnoreCase(voucher.getName())) - return nbt.getString("argument"); - } } } } diff --git a/paper/src/main/java/com/badbones69/crazyvouchers/listeners/VoucherCraftListener.java b/paper/src/main/java/com/badbones69/crazyvouchers/listeners/VoucherCraftListener.java index fa60180..210030c 100644 --- a/paper/src/main/java/com/badbones69/crazyvouchers/listeners/VoucherCraftListener.java +++ b/paper/src/main/java/com/badbones69/crazyvouchers/listeners/VoucherCraftListener.java @@ -7,7 +7,6 @@ import com.badbones69.crazyvouchers.api.enums.PersistentKeys; import com.badbones69.crazyvouchers.api.objects.Voucher; import com.badbones69.crazyvouchers.config.ConfigManager; -import de.tr7zw.changeme.nbtapi.NBTItem; import io.papermc.paper.persistence.PersistentDataContainerView; import org.bukkit.Material; import org.bukkit.event.EventHandler; @@ -47,18 +46,6 @@ public void prepareItemCraft(PrepareItemCraftEvent event) { } break; - } else { - NBTItem nbt = new NBTItem(itemStack); // this section related to nbt items is deprecated, and marked for removal - - if (nbt.hasTag("voucher")) { - event.getInventory().setResult(new ItemStack(Material.AIR)); - - if (this.config.getProperty(ConfigKeys.prevent_using_vouchers_in_recipes_alert)) { - Messages.cannot_put_items_in_crafting_table.sendMessage(event.getView().getPlayer()); - } - - break; - } } } }