From 532f2caa37da43252a72b7c2098ce2d5ed3051cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= Date: Wed, 22 Jul 2020 12:06:56 +0200 Subject: [PATCH] Make VaultPermissionHandler extent BukkitPermissionHandler --- .../permissions/VaultPermissionHandler.java | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/permissions/VaultPermissionHandler.java b/Bukkit/src/main/java/com/plotsquared/bukkit/permissions/VaultPermissionHandler.java index a7978e671..ec2724e6a 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/permissions/VaultPermissionHandler.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/permissions/VaultPermissionHandler.java @@ -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 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 getPermissionProfile( @Nonnull OfflinePlotPlayer offlinePlotPlayer) { if (offlinePlotPlayer instanceof BukkitOfflinePlayer) {