3
0
Mirror von https://github.com/St3venAU/ArmorStandTools.git synchronisiert 2024-12-29 13:00:07 +01:00

Fix PlotSquared hook + add fallback

Dieser Commit ist enthalten in:
boy0001 2015-08-03 21:06:20 +10:00
Ursprung fa7b5a148f
Commit 7b621b20fb
2 geänderte Dateien mit 9 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -115,7 +115,12 @@ class Config {
Plugin plotSquared = plugin.getServer().getPluginManager().getPlugin("PlotSquared"); Plugin plotSquared = plugin.getServer().getPluginManager().getPlugin("PlotSquared");
if (plotSquared != null && plotSquared.isEnabled()) { if (plotSquared != null && plotSquared.isEnabled()) {
new PlotSquaredHook(plugin); try {
new PlotSquaredHook(plugin);
}
catch (Throwable e) {
e.printStackTrace();
}
} }
Plugin worldGuard = plugin.getServer().getPluginManager().getPlugin("WorldGuard"); Plugin worldGuard = plugin.getServer().getPluginManager().getPlugin("WorldGuard");

Datei anzeigen

@ -10,7 +10,6 @@ import com.intellectualcrafters.plot.api.PlotAPI;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.Permissions;
import com.intellectualcrafters.plot.util.bukkit.BukkitUtil;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
class PlotSquaredHook { class PlotSquaredHook {
@ -28,11 +27,11 @@ class PlotSquaredHook {
public static boolean checkPermission(Player player, Location loc) { public static boolean checkPermission(Player player, Location loc) {
Plot plot = api.getPlot(loc); Plot plot = api.getPlot(loc);
PlotPlayer pp = PlotPlayer.wrap(player);
if (plot == null) { if (plot == null) {
return Permissions.hasPermission(BukkitUtil.getPlayer(player), "plots.admin.build.road"); return pp.hasPermission("plots.admin.build.road");
} }
PlotPlayer pp = BukkitUtil.getPlayer(player);
UUID uuid = pp.getUUID(); UUID uuid = pp.getUUID();
return plot.isAdded(uuid) || Permissions.hasPermission(pp, "plots.admin.build.other"); return plot.isAdded(uuid) || pp.hasPermission("plots.admin.build.other");
} }
} }