Skip to content

Commit

Permalink
removed nbt api
Browse files Browse the repository at this point in the history
  • Loading branch information
ryderbelserion committed Oct 27, 2024
1 parent efb60c8 commit 6b7fb05
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 32 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions paper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ repositories {
dependencies {
implementation(libs.vital.paper)

implementation(libs.nbtapi)

compileOnly(libs.headdatabaseapi)

compileOnly(libs.placeholderapi)
Expand Down Expand Up @@ -54,7 +52,6 @@ tasks {
archiveClassifier.set("")

listOf(
"de.tr7zw.changeme.nbtapi",
"com.ryderbelserion.vital"
).forEach {
relocate(it, "libs.$it")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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"));
}
}
}

Expand All @@ -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");
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
}
}
Expand Down

0 comments on commit 6b7fb05

Please sign in to comment.