mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 18:47:20 +01:00
Allow permission check for offline worlds
This commit is contained in:
parent
6f673066a8
commit
791d8b653c
@ -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()));
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user