mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-26 02:19:48 -05:00
Remove old Permission.class
Former-commit-id: 9dc50e78893b695e76d7742387f57fb653b11eee [formerly 0c1c2d9e75f3dca9bac39e13bcd2733f19823616] Former-commit-id: b46093b1ff87cf94f672daeda85d98e7ab7d823f
This commit is contained in:
1 parent
6fedbf1889
commit
25279f5d43
4 files changed
+2
-40
No files matched your search
@@ -28,7 +28,6 @@ import org.maxgamer.quickshop.Shop.Shop;
|
||||
import org.maxgamer.quickshop.Shop.ShopManager;
|
||||
import org.maxgamer.quickshop.Shop.ShopType;
|
||||
import org.maxgamer.quickshop.Util.MsgUtil;
|
||||
import org.maxgamer.quickshop.Util.Permissions;
|
||||
import org.maxgamer.quickshop.Util.SignMenuFactory;
|
||||
import org.maxgamer.quickshop.Util.Util;
|
||||
import org.maxgamer.quickshop.Watcher.ItemWatcher;
|
||||
@@ -158,11 +157,7 @@ public class QuickShop extends JavaPlugin {
|
||||
Bukkit.getPluginManager().disablePlugin(this);
|
||||
return;
|
||||
}
|
||||
if (Permissions.init()) {
|
||||
getLogger().info("Found permission provider.");
|
||||
} else {
|
||||
getLogger().info("Couldn't find a Vault permission provider. Some feature may be limited.");
|
||||
}
|
||||
|
||||
if (getConfig().getBoolean("plugin.Multiverse-Core")) {
|
||||
|
||||
if ( Bukkit.getPluginManager().getPlugin("Multiverse-Core") != null) {
|
||||
|
||||
@@ -28,7 +28,6 @@ import org.maxgamer.quickshop.QuickShop;
|
||||
import org.maxgamer.quickshop.Database.Database;
|
||||
import org.maxgamer.quickshop.Database.DatabaseHelper;
|
||||
import org.maxgamer.quickshop.Util.MsgUtil;
|
||||
import org.maxgamer.quickshop.Util.Permissions;
|
||||
import org.maxgamer.quickshop.Util.Util;
|
||||
|
||||
public class ShopManager {
|
||||
@@ -399,8 +398,7 @@ public class ShopManager {
|
||||
// themselves.
|
||||
// Do charge an amount of tax though.
|
||||
double tax = plugin.getConfig().getDouble("tax");
|
||||
if (shop.getOwner().equals(p.getUniqueId()) || Permissions
|
||||
.hasPermission(Bukkit.getOfflinePlayer(shop.getOwner()), "quickshop.taxexemption")) {
|
||||
if (shop.getOwner().equals(p.getUniqueId())) {
|
||||
tax = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package org.maxgamer.quickshop.Util;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
|
||||
public class Permissions {
|
||||
private Permissions() {}
|
||||
private static Permission provider;
|
||||
|
||||
public static boolean init() {
|
||||
RegisteredServiceProvider<Permission> registeredService = Bukkit.getServicesManager().getRegistration(Permission.class);
|
||||
if (registeredService!=null) {
|
||||
provider = registeredService.getProvider();
|
||||
}
|
||||
return provider != null;
|
||||
}
|
||||
|
||||
public static boolean hasPermission(OfflinePlayer player, String permission) {
|
||||
try {
|
||||
return provider.playerHas(null, player, permission);
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,9 +55,6 @@ permissions:
|
||||
quickshop.export:
|
||||
description: Allows exporting database to mysql or sqlite
|
||||
default: op
|
||||
quickshop.taxexemption:
|
||||
description: Tax exemption
|
||||
default: false
|
||||
quickshop.alerts:
|
||||
description: Alert the player when someone tries to cheat with the display item
|
||||
default: op
|
||||
|
||||
Reference in new issue
Block a user