Skip to content

Commit

Permalink
fix merge error
Browse files Browse the repository at this point in the history
  • Loading branch information
acrylic-style committed Nov 5, 2024
1 parent 75c7e28 commit 0e356af
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/java/com/github/mori01231/lifecore/util/ItemUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ public static boolean isProbablyAdminSword(@Nullable ItemStack stack) {
}

@Contract("null, _ -> null")
public static @Nullable NBTBase getTag(@Nullable ItemStack stack, @NotNull String key) {
if (stack == null || stack.getType().isAir()) return null;
NBTTagCompound tag = CraftItemStack.asNMSCopy(stack).getTag();
public static @Nullable Tag getTag(@Nullable ItemStack stack, @NotNull String key) {
CompoundTag tag = getCustomData(stack);
if (tag == null) return null;
return tag.get(key);
}
Expand All @@ -65,8 +64,7 @@ public static boolean isProbablyAdminSword(@Nullable ItemStack stack) {
}

public static int getIntTag(@Nullable ItemStack stack, @NotNull String key) {
if (stack == null || stack.getType().isAir()) return 0;
NBTTagCompound tag = CraftItemStack.asNMSCopy(stack).getTag();
CompoundTag tag = getCustomData(stack);
if (tag == null) return 0;
return tag.getInt(key);
}
Expand Down Expand Up @@ -193,7 +191,7 @@ public static ItemStack restoreTag(@Nullable ItemStack stack) {
ItemStack newStack = setTag(stack, null, backup);
for (String bypassTag : RESTORE_BYPASS_SET) {
if (containsTag(stack, bypassTag)) {
NBTBase value = getTag(stack, bypassTag);
Tag value = getTag(stack, bypassTag);
assert value != null;
newStack = setTag(newStack, bypassTag, value);
}
Expand Down

0 comments on commit 0e356af

Please sign in to comment.