Allow permission check for offline worlds

This commit is contained in:
Ben Woo 2023-09-03 23:40:08 +08:00
parent 6f673066a8
commit 791d8b653c
No known key found for this signature in database
GPG Key ID: FB2A3645536E12C8
2 changed files with 4 additions and 2 deletions

View File

@ -2,13 +2,14 @@ package com.onarandombox.MultiverseCore.permissions;
import com.dumptruckman.minecraft.util.Logging;
import com.onarandombox.MultiverseCore.worldnew.MVWorld;
import com.onarandombox.MultiverseCore.worldnew.OfflineWorld;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jvnet.hk2.annotations.Service;
@Service
public class CorePermissionsChecker {
public boolean hasWorldAccessPermission(@NotNull CommandSender sender, @NotNull MVWorld world) {
public boolean hasWorldAccessPermission(@NotNull CommandSender sender, @NotNull OfflineWorld world) {
return hasPermission(sender, concatPermission(CorePermissions.WORLD_ACCESS, world.getName()));
}

View File

@ -7,6 +7,7 @@ import com.onarandombox.MultiverseCore.utils.result.Result;
import com.onarandombox.MultiverseCore.utils.result.ResultChain;
import com.onarandombox.MultiverseCore.world.configuration.EntryFee;
import com.onarandombox.MultiverseCore.worldnew.MVWorld;
import com.onarandombox.MultiverseCore.worldnew.OfflineWorld;
import org.bukkit.Material;
import org.bukkit.command.BlockCommandSender;
import org.bukkit.command.CommandSender;
@ -49,7 +50,7 @@ public class WorldEntryChecker {
.build();
}
public Result<WorldAccessResult.Success, WorldAccessResult.Failure> canAccessWorld(@NotNull MVWorld world) {
public Result<WorldAccessResult.Success, WorldAccessResult.Failure> canAccessWorld(@NotNull OfflineWorld world) {
if (!config.getEnforceAccess()) {
return Result.success(WorldAccessResult.Success.NO_ENFORCE_WORLD_ACCESS);
}