Skip to content

Commit

Permalink
fix: attribute filter not clearing attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
klikli-dev committed Aug 19, 2024
1 parent 189fd04 commit 2a393ac
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import net.minecraft.nbt.Tag;
import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.network.chat.Component;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.ClickType;
Expand Down Expand Up @@ -73,7 +72,7 @@ protected void addFilterSlots() {
this.addSlot(new SlotItemHandler(this.ghostInventory, 0, 16, 24));
this.addSlot(new SlotItemHandler(this.ghostInventory, 1, 22, 59) {
@Override
public boolean mayPickup(Player playerIn) {
public boolean mayPickup(@NotNull Player playerIn) {
return false;
}
});
Expand Down Expand Up @@ -163,4 +162,9 @@ protected void saveData(ItemStack contentHolder) {
tag.put("MatchedAttributes", attributes);
contentHolder.set(DataComponentRegistry.FILTER_ATTRIBUTES, CustomData.of(tag));
}

@Override
public void clearContents() {
this.selectedAttributes.clear();
}
}

0 comments on commit 2a393ac

Please sign in to comment.