Skip to content

Commit eaf85b7

Browse files
committed
fix(minestom): adapt to upstream LuckPerms common API
The upstream merge changed the common permission-calculator API. Port MinestomCalculatorFactory to the new CalculatorFactory.build signature (QueryOptions, Map<String,Node>, CacheMetadata), pass the source map to the now-parameterised processors, and return the concrete PermissionCalculatorMonitored instead of the now-abstract PermissionCalculator (mirrors StandaloneCalculatorFactory). Add the slf4j-api compile dependency that common no longer exposes transitively. https://claude.ai/code/session_01S76fk9ma5Szkf9r1W44RVP
1 parent aa05c7c commit eaf85b7

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

minestom/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dependencies {
1212
compileOnly project(':minestom:app')
1313

1414
compileOnly 'net.minestom:minestom:2026.05.17-1.21.11'
15+
compileOnly 'org.slf4j:slf4j-api:2.0.17'
1516
}
1617

1718
java {

minestom/src/main/java/me/lucko/luckperms/minestom/calculator/MinestomCalculatorFactory.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@
2828
import me.lucko.luckperms.common.cacheddata.CacheMetadata;
2929
import me.lucko.luckperms.common.calculator.CalculatorFactory;
3030
import me.lucko.luckperms.common.calculator.PermissionCalculator;
31+
import me.lucko.luckperms.common.calculator.PermissionCalculatorMonitored;
3132
import me.lucko.luckperms.common.calculator.processor.*;
3233
import me.lucko.luckperms.common.config.ConfigKeys;
3334
import me.lucko.luckperms.minestom.LPMinestomPlugin;
35+
import net.luckperms.api.node.Node;
3436
import net.luckperms.api.query.QueryOptions;
3537

3638
import java.util.ArrayList;
3739
import java.util.List;
40+
import java.util.Map;
3841

3942
public class MinestomCalculatorFactory implements CalculatorFactory {
4043
private final LPMinestomPlugin plugin;
@@ -44,24 +47,24 @@ public MinestomCalculatorFactory(LPMinestomPlugin plugin) {
4447
}
4548

4649
@Override
47-
public PermissionCalculator build(QueryOptions queryOptions, CacheMetadata metadata) {
50+
public PermissionCalculator build(QueryOptions queryOptions, Map<String, Node> sourceMap, CacheMetadata metadata) {
4851
List<PermissionProcessor> processors = new ArrayList<>(4);
4952

50-
processors.add(new DirectProcessor());
53+
processors.add(new DirectProcessor(sourceMap));
5154

5255
if (this.plugin.getConfiguration().get(ConfigKeys.APPLYING_REGEX)) {
53-
processors.add(new RegexProcessor());
56+
processors.add(new RegexProcessor(sourceMap));
5457
}
5558

5659
if (this.plugin.getConfiguration().get(ConfigKeys.APPLYING_WILDCARDS)) {
57-
processors.add(new WildcardProcessor());
60+
processors.add(new WildcardProcessor(sourceMap));
5861
}
5962

6063
if (this.plugin.getConfiguration().get(ConfigKeys.APPLYING_WILDCARDS_SPONGE)) {
61-
processors.add(new SpongeWildcardProcessor());
64+
processors.add(new SpongeWildcardProcessor(sourceMap));
6265
}
6366

64-
return new PermissionCalculator(this.plugin, metadata, processors);
67+
return new PermissionCalculatorMonitored(this.plugin, metadata, processors);
6568
}
6669
}
6770

0 commit comments

Comments
 (0)