mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-13 10:34:09 +01:00
Make VaultPermissionHandler extent BukkitPermissionHandler
This commit is contained in:
parent
6dba31b257
commit
532f2caa37
@ -26,13 +26,8 @@
|
||||
package com.plotsquared.bukkit.permissions;
|
||||
|
||||
import com.plotsquared.bukkit.player.BukkitOfflinePlayer;
|
||||
import com.plotsquared.bukkit.player.BukkitPlayer;
|
||||
import com.plotsquared.core.permissions.ConsolePermissionProfile;
|
||||
import com.plotsquared.core.permissions.PermissionHandler;
|
||||
import com.plotsquared.core.permissions.PermissionProfile;
|
||||
import com.plotsquared.core.player.ConsolePlayer;
|
||||
import com.plotsquared.core.player.OfflinePlotPlayer;
|
||||
import com.plotsquared.core.player.PlotPlayer;
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
@ -43,7 +38,7 @@ import java.util.EnumSet;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
public class VaultPermissionHandler implements PermissionHandler {
|
||||
public class VaultPermissionHandler extends BukkitPermissionHandler {
|
||||
|
||||
private Permission permissions;
|
||||
|
||||
@ -58,17 +53,6 @@ public class VaultPermissionHandler implements PermissionHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull @Override public Optional<PermissionProfile> getPermissionProfile(
|
||||
@Nonnull PlotPlayer<?> playerPlotPlayer) {
|
||||
if (playerPlotPlayer instanceof BukkitPlayer) {
|
||||
final BukkitPlayer bukkitPlayer = (BukkitPlayer) playerPlotPlayer;
|
||||
return Optional.of(new VaultPermissionProfile(bukkitPlayer.getPlatformPlayer()));
|
||||
} else if (playerPlotPlayer instanceof ConsolePlayer) {
|
||||
return Optional.of(ConsolePermissionProfile.INSTANCE);
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@Nonnull @Override public Optional<PermissionProfile> getPermissionProfile(
|
||||
@Nonnull OfflinePlotPlayer offlinePlotPlayer) {
|
||||
if (offlinePlotPlayer instanceof BukkitOfflinePlayer) {
|
||||
|
Loading…
Reference in New Issue
Block a user