Skip to content

Commit

Permalink
Fix removable tags not working properly
Browse files Browse the repository at this point in the history
  • Loading branch information
AViewFromTheTop committed Jun 24, 2024
1 parent 9601498 commit c521b11
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ public final class ItemStackMixin implements ItemStackExtension {

// Removable Item Tags

CustomData data = stack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY);

data.update(compound -> {
CustomData.update(DataComponents.CUSTOM_DATA, stack, compound -> {
for (String key : RemovableItemTags.keys()) {
if (RemovableItemTags.canRemoveTag(key, level, entity, slot, selected)) {
compound.remove(key);
Expand Down Expand Up @@ -86,8 +84,7 @@ public final class ItemStackMixin implements ItemStackExtension {

@Unique
private static void frozenLib$fixEmptyTags(ItemStack stack) {
CustomData data = stack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY);
data.update(compound -> {
CustomData.update(DataComponents.CUSTOM_DATA, stack, compound -> {
for (String key : RemovableItemTags.keys()) {
if (RemovableItemTags.shouldRemoveTagOnStackMerge(key)) {
compound.remove(key);
Expand Down

0 comments on commit c521b11

Please sign in to comment.