Skip to content

Commit

Permalink
Fix "learn all" button still destroying already-learned items
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed Jul 15, 2024
1 parent 4176425 commit de1a58c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public void handle(Supplier<NetworkEvent.Context> context) {
storage.getCachedInventory().keySet().stream()
.filter(key -> key instanceof AEItemKey)
.map(AEItemKey.class::cast)
.filter(item -> !knowledge
.getProviderFor(sender.getUUID())
.get()
.hasKnowledge(item.toStack()))
.forEach(item -> {
var learned = knowledge
.getStorage()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package gripe._90.appliede.menu;

import moze_intel.projecte.api.ItemInfo;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
Expand All @@ -23,6 +22,8 @@
import gripe._90.appliede.me.misc.TransmutationTerminalHost;
import gripe._90.appliede.me.service.KnowledgeService;

import moze_intel.projecte.api.ItemInfo;

public class TransmutationTerminalMenu extends MEStorageMenu {
public static final MenuType<TransmutationTerminalMenu> TYPE = MenuTypeBuilder.create(
TransmutationTerminalMenu::new, TransmutationTerminalHost.class)
Expand Down

0 comments on commit de1a58c

Please sign in to comment.