From 8f7c6c1165e0794d1fa6de2d903d9a6b8e61f277 Mon Sep 17 00:00:00 2001 From: Niels Vergucht Date: Sat, 15 Dec 2018 23:20:18 +0100 Subject: [PATCH] Fixed permissions & infinite use --- pom.xml | 2 +- .../epicbuckets/command/CommandGenbucket.java | 8 +++---- .../listener/GenbucketPlaceListener.java | 4 ++-- .../RegionMassiveCraftFactions.java | 23 ------------------- 4 files changed, 7 insertions(+), 30 deletions(-) delete mode 100644 src/main/java/com/songoda/epicbuckets/regionhandler/RegionMassiveCraftFactions.java diff --git a/pom.xml b/pom.xml index 076c770..1903061 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ com.songoda EpicBuckets 4.0.0 - 1.2.3 + 1.2.4 clean package diff --git a/src/main/java/com/songoda/epicbuckets/command/CommandGenbucket.java b/src/main/java/com/songoda/epicbuckets/command/CommandGenbucket.java index 5915590..1648b85 100644 --- a/src/main/java/com/songoda/epicbuckets/command/CommandGenbucket.java +++ b/src/main/java/com/songoda/epicbuckets/command/CommandGenbucket.java @@ -41,14 +41,14 @@ public class CommandGenbucket extends BaseCommand { @Default @Description("Opens up the Genbucket shop") public void shop(Player player) { - if (!permCheck(player, "genbucket.shop")) return; + if (!permCheck(player, "epicbuckets.shop")) return; new GUIMain(player).open(); } @Subcommand("reload") @Description("Reloads the messages & config files") public void reload(Player player) { - if (!permCheck(player, "genbucket.reload")) return; + if (!permCheck(player, "epicbuckets.reload")) return; epicBuckets.reload(); player.sendMessage(ChatUtil.colorPrefix(epicBuckets.getLocale().getMessage("command.reload.success"))); } @@ -56,14 +56,14 @@ public class CommandGenbucket extends BaseCommand { @Subcommand("admin toggle") @Description("Toggles your admin status to receive genbucket placement notifications") public void admin(Player player) { - if (!permCheck(player, "genbucket.admin") || !permCheck(player, "genbucket.admin.toggle")) return; + if (!permCheck(player, "epicbuckets.admin") || !permCheck(player, "epicbuckets.admin.toggle")) return; epicBuckets.getGenbucketManager().toggleAdmin(player); } @Subcommand("admin panel") @Description("Opens up the panel with all the active genbuckets") public void panel(Player player) { - if (!permCheck(player, "genbucket.admin") || !permCheck(player, "genbucket.admin.panel")) return; + if (!permCheck(player, "epicbuckets.admin") || !permCheck(player, "epicbuckets.admin.panel")) return; GUIPanel.PANEL.open(player); } diff --git a/src/main/java/com/songoda/epicbuckets/listener/GenbucketPlaceListener.java b/src/main/java/com/songoda/epicbuckets/listener/GenbucketPlaceListener.java index 70a455b..df26ccf 100644 --- a/src/main/java/com/songoda/epicbuckets/listener/GenbucketPlaceListener.java +++ b/src/main/java/com/songoda/epicbuckets/listener/GenbucketPlaceListener.java @@ -38,7 +38,7 @@ public class GenbucketPlaceListener implements Listener { e.setCancelled(true); - if (!e.getPlayer().hasPermission("genbucket.place")) { + if (!e.getPlayer().hasPermission("epicbuckets.place")) { e.getPlayer().sendMessage(EpicBuckets.getInstance().getLocale().getMessage("event.place.nothere")); return; } @@ -80,7 +80,7 @@ public class GenbucketPlaceListener implements Listener { return; } - if (e.getPlayer().getGameMode() != GameMode.CREATIVE || !EpicBuckets.getInstance().getConfigManager().isUnlimitedGenbuckets()) { + if (e.getPlayer().getGameMode() != GameMode.CREATIVE && !EpicBuckets.getInstance().getConfigManager().isUnlimitedGenbuckets()) { if (e.getItem().getAmount() > 1) { e.getItem().setAmount(e.getItem().getAmount() - 1); } else { diff --git a/src/main/java/com/songoda/epicbuckets/regionhandler/RegionMassiveCraftFactions.java b/src/main/java/com/songoda/epicbuckets/regionhandler/RegionMassiveCraftFactions.java deleted file mode 100644 index 1e36f89..0000000 --- a/src/main/java/com/songoda/epicbuckets/regionhandler/RegionMassiveCraftFactions.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.songoda.epicbuckets.regionhandler; - -import com.massivecraft.factions.*; -import com.songoda.epicbuckets.EpicBuckets; -import org.bukkit.Location; -import org.bukkit.entity.Player; - -public class RegionMassiveCraftFactions { - - public static boolean canBuild(Player player, Location location) { - if (!EpicBuckets.getInstance().getConfigManager().isSupportFactions()) return true; - if (!EpicBuckets.getInstance().getServer().getPluginManager().isPluginEnabled("Factions")) return true; - - Faction f = Board.getInstance().getFactionAt(new FLocation(location)); - - if (f == null) return false; - - if (FPlayers.getInstance().getByPlayer(player).getFaction() != f) return false; - - return true; - } - -}