Skip to content

Commit

Permalink
add holder argument to getKeyFromActor
Browse files Browse the repository at this point in the history
  • Loading branch information
HSGamer committed Jan 30, 2025
1 parent c2d58e5 commit 57fc8fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ protected SnapshotQueryManager() {
return getDisplayValue(value, holder, "raw");
});
registerActorFunction("top_rank", (actor, holder) -> {
int index = getSnapshotAgent(holder).getSnapshotIndex(getKeyFromActor(actor));
int index = getSnapshotAgent(holder).getSnapshotIndex(getKeyFromActor(actor, holder));
return Integer.toString(index + 1);
});
registerAction("value", (actor, holder, args) -> {
if (actor == null) return null;
V value = holder.getEntry(getKeyFromActor(actor)).map(DataEntry::getValue).orElse(null);
V value = holder.getEntry(getKeyFromActor(actor, holder)).map(DataEntry::getValue).orElse(null);
return getDisplayValue(value, holder, args);
});
registerActorFunction("value_raw", (actor, holder) -> {
V value = holder.getEntry(getKeyFromActor(actor)).map(DataEntry::getValue).orElse(null);
V value = holder.getEntry(getKeyFromActor(actor, holder)).map(DataEntry::getValue).orElse(null);
return getDisplayValue(value, holder, "raw");
});
}
Expand All @@ -83,5 +83,5 @@ protected SnapshotQueryManager() {
protected abstract String getDisplayKey(@Nullable K key, @NotNull H holder);

@NotNull
protected abstract K getKeyFromActor(@NotNull A actor);
protected abstract K getKeyFromActor(@NotNull A actor, @NotNull H holder);
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected Optional<NumberTopHolder> getHolder(String name) {
}

@Override
protected @NotNull UUID getKeyFromActor(@NotNull OfflinePlayer actor) {
protected @NotNull UUID getKeyFromActor(@NotNull OfflinePlayer actor, @NotNull NumberTopHolder holder) {
return actor.getUniqueId();
}
}

0 comments on commit 57fc8fb

Please sign in to comment.