From 8bbb727873d921d0f09817c6b06c3a8c6aa71e83 Mon Sep 17 00:00:00 2001 From: acrylic-style Date: Wed, 31 Jul 2024 09:01:14 +0900 Subject: [PATCH] change: exclude Build-Tool from being backed up --- build.gradle.kts | 2 +- .../java/com/github/mori01231/lifecore/util/ItemUtil.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 845e495..209ee22 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } group = "net.azisaba" -version = "1.15.2+6.16.7" +version = "1.15.2+6.16.8-SNAPSHOT" java { toolchain.languageVersion.set(JavaLanguageVersion.of(8)) diff --git a/src/main/java/com/github/mori01231/lifecore/util/ItemUtil.java b/src/main/java/com/github/mori01231/lifecore/util/ItemUtil.java index bcaa6c1..8e6ecc4 100644 --- a/src/main/java/com/github/mori01231/lifecore/util/ItemUtil.java +++ b/src/main/java/com/github/mori01231/lifecore/util/ItemUtil.java @@ -147,6 +147,11 @@ public static ItemStack backupTag(@Nullable ItemStack stack) { if (stack == null || stack.getType().isAir()) return null; NBTTagCompound tag = CraftItemStack.asNMSCopy(stack).getTag(); if (tag == null || tag.isEmpty()) return stack; + if (!tag.getCompound("backup").isEmpty()) return stack; + // exclude some items + if (tag.getCompound("PublicBukkitValues").getInt("minecraft:admin_item") == 1) { + return stack; + } return setTag(stack, "backup", tag); }