Skip to content

Commit

Permalink
Fix EMC storage ignoring knowledge provider if multiple modules are p…
Browse files Browse the repository at this point in the history
…resent for the same player
  • Loading branch information
62832 committed May 13, 2024
1 parent 6e4aa24 commit be39ec7
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void removeNode(IGridNode gridNode) {
}

private void addProvider(UUID playerUUID) {
providers.put(playerUUID, () -> {
providers.putIfAbsent(playerUUID, () -> {
try {
return ITransmutationProxy.INSTANCE.getKnowledgeProviderFor(playerUUID);
} catch (NullPointerException e) {
Expand Down Expand Up @@ -171,9 +171,7 @@ IGrid getGrid() {
BigInteger getEmc() {
return providers.entrySet().stream()
.filter(tpeHandler::notSharingEmc)
.map(provider -> provider.getValue().get())
.distinct()
.map(IKnowledgeProvider::getEmc)
.map(provider -> provider.getValue().get().getEmc())
.reduce(BigInteger.ZERO, BigInteger::add);
}

Expand Down

0 comments on commit be39ec7

Please sign in to comment.