i'm very confused on where contexts get their "value" from when being calculated.
been analyzing ExtraContexts + luckperms context managers and calculators for a while, and I feel like i'm missing something silly. it seems like contexts just submit their value (like target.isWhitelisted()), and then the value just goes into the void
here's my situation:
I am trying to add a context for minimum-playtime=<time in ticks>, which (obviously) requires the Player to have a Statistic.PLAY_ONE_TICK >= <time in ticks>. I have cloned ExtraContexts and registered it and everything:
@Override
public void calculate(Player target, ContextConsumer consumer) {
consumer.accept(KEY, String.valueOf(target.getStatistic(Statistic.PLAY_ONE_TICK)));
}
So my questions are; where is "player's data" compared to the context "value" to return true or false for each context, and how can i modify this behaviour to simply check "is the players playtime >= <time in ticks>" of this minimum-playtime context?
All I need is a permalink to a line # for even the built in gamemode context. Where is their gamemode compared to the value of the gamemode=<gamemode> context?
I hope this makes sense, maybe i am overthinking it. not sure ๐