mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-20 09:36:14 +01:00
Fix SpongePlayerCalculator errors
This commit is contained in:
parent
3eca6205ab
commit
86d2523d33
@ -39,6 +39,7 @@ import net.luckperms.api.context.ImmutableContextSet;
|
|||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
import org.spongepowered.api.Game;
|
import org.spongepowered.api.Game;
|
||||||
import org.spongepowered.api.ResourceKey;
|
import org.spongepowered.api.ResourceKey;
|
||||||
|
import org.spongepowered.api.Server;
|
||||||
import org.spongepowered.api.data.Keys;
|
import org.spongepowered.api.data.Keys;
|
||||||
import org.spongepowered.api.data.value.ValueContainer;
|
import org.spongepowered.api.data.value.ValueContainer;
|
||||||
import org.spongepowered.api.entity.Entity;
|
import org.spongepowered.api.entity.Entity;
|
||||||
@ -82,11 +83,15 @@ public class SpongePlayerCalculator implements ContextCalculator<Subject> {
|
|||||||
game.registry(RegistryTypes.GAME_MODE).stream().forEach(mode -> {
|
game.registry(RegistryTypes.GAME_MODE).stream().forEach(mode -> {
|
||||||
builder.add(DefaultContextKeys.GAMEMODE_KEY, getContextKey(mode.key(RegistryTypes.GAME_MODE)));
|
builder.add(DefaultContextKeys.GAMEMODE_KEY, getContextKey(mode.key(RegistryTypes.GAME_MODE)));
|
||||||
});
|
});
|
||||||
game.registry(RegistryTypes.WORLD_TYPE).stream().forEach(dim -> {
|
|
||||||
builder.add(DefaultContextKeys.DIMENSION_TYPE_KEY, getContextKey(dim.key(RegistryTypes.WORLD_TYPE)));
|
|
||||||
});
|
|
||||||
if (game.isServerAvailable()) {
|
if (game.isServerAvailable()) {
|
||||||
for (ServerWorld world : game.server().worldManager().worlds()) {
|
Server server = game.server();
|
||||||
|
|
||||||
|
server.registry(RegistryTypes.WORLD_TYPE).stream().forEach(dim -> {
|
||||||
|
builder.add(DefaultContextKeys.DIMENSION_TYPE_KEY, getContextKey(dim.key(RegistryTypes.WORLD_TYPE)));
|
||||||
|
});
|
||||||
|
|
||||||
|
for (ServerWorld world : server.worldManager().worlds()) {
|
||||||
String worldName = getContextKey(world.key());
|
String worldName = getContextKey(world.key());
|
||||||
if (Context.isValidValue(worldName)) {
|
if (Context.isValidValue(worldName)) {
|
||||||
builder.add(DefaultContextKeys.WORLD_KEY, worldName);
|
builder.add(DefaultContextKeys.WORLD_KEY, worldName);
|
||||||
|
Loading…
Reference in New Issue
Block a user