Wiki: "Developer API: Usage" wrong method in example code
KaiKikuchi opened this issue ยท 3 comments
In this section there is the following example code:
public class CustomCalculator implements ContextCalculator<Player> {
@Override
public void calculate(Player t, ContextConsumer contextConsumer) {
contextConsumer.add("gamemode", t.getGameMode().name());
}
@Override
public ContextSet estimatePotentialContexts() {
ImmutableContextSet.Builder builder = ImmutableContextSet.builder();
for (GameMode gameMode : GameMode.values()) {
builder.add(KEY, gameMode.name().toLowerCase());
}
return builder.build();
}
}
ContextConsumer does not have an "add" method, but "accept". Link to ContextConsumer.java
I also suggest to change "KEY" to "gamemode" in order to have a working example.