Skip to content

Commit

Permalink
Only unlearn items that are actually known
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed Jul 15, 2024
1 parent de1a58c commit 0fe7287
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,14 @@ public void doAction(ServerPlayer player, InventoryAction action, int slot, long

if (knowledge.isTrackingPlayer(player)) {
var provider = knowledge.getProviderFor(player.getUUID()).get();
provider.removeKnowledge(getCarried());
provider.syncKnowledgeChange(player, ItemInfo.fromStack(getCarried()), false);
unlearnedLabelTicks = 300;
learnedLabelTicks = 0;
broadcastChanges();

if (provider.hasKnowledge(getCarried())) {
provider.removeKnowledge(getCarried());
provider.syncKnowledgeChange(player, ItemInfo.fromStack(getCarried()), false);
unlearnedLabelTicks = 300;
learnedLabelTicks = 0;
broadcastChanges();
}
}
}
}
Expand Down

0 comments on commit 0fe7287

Please sign in to comment.