Skip to content

Commit

Permalink
Fix "Learned!" text always showing even for already known items
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed May 10, 2024
1 parent b743359 commit 62d7cb1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/gripe/_90/appliede/me/service/EMCStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,19 @@ public long insertItem(

if (mode == Actionable.MODULATE && mayLearn && totalInserted > 0) {
source.player().ifPresent(player -> {
if (playerProvider != null) {
if (playerProvider != null && !playerProvider.get().hasKnowledge(what.toStack())) {
addKnowledge(what, playerProvider.get(), player);
onLearn.run();
}
});
source.machine().ifPresent(host -> {
if (machineProvider != null) {
if (machineProvider != null && !machineProvider.get().hasKnowledge(what.toStack())) {
var node = Objects.requireNonNull(host.getActionableNode());
var player = IPlayerRegistry.getConnected(node.getLevel().getServer(), node.getOwningPlayerId());
addKnowledge(what, machineProvider.get(), player);
onLearn.run();
}
});
onLearn.run();
}

return totalInserted;
Expand Down

0 comments on commit 62d7cb1

Please sign in to comment.