mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-13 10:34:09 +01:00
check if clusters are enables
This commit is contained in:
parent
9a81e31cd6
commit
c4d84bb070
@ -248,12 +248,12 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
|||||||
}
|
}
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
Location loc = event.getBlock().getLocation();
|
Location loc = event.getBlock().getLocation();
|
||||||
if (isInPlot(loc)) {
|
final Plot plot = getCurrentPlot(loc);
|
||||||
|
if (plot != null) {
|
||||||
if (event.getBlock().getY() == 0) {
|
if (event.getBlock().getY() == 0) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final Plot plot = getCurrentPlot(loc);
|
|
||||||
if (!plot.hasOwner()) {
|
if (!plot.hasOwner()) {
|
||||||
if (PlotMain.hasPermission(player, "plots.admin.destroy.unowned")) {
|
if (PlotMain.hasPermission(player, "plots.admin.destroy.unowned")) {
|
||||||
return;
|
return;
|
||||||
@ -278,7 +278,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
|||||||
if (PlotMain.hasPermission(event.getPlayer(), "plots.admin.destroy.road")) {
|
if (PlotMain.hasPermission(event.getPlayer(), "plots.admin.destroy.road")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isPlotArea(loc)) {
|
if (isPlotArea(loc)) {
|
||||||
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.destroy.road");
|
PlayerFunctions.sendMessage(player, C.NO_PERMISSION, "plots.admin.destroy.road");
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ import com.sk89q.worldguard.protection.flags.BooleanFlag;
|
|||||||
|
|
||||||
public static boolean isPlotArea(Location location) {
|
public static boolean isPlotArea(Location location) {
|
||||||
PlotWorld plotworld = PlotMain.getWorldSettings(location.getWorld());
|
PlotWorld plotworld = PlotMain.getWorldSettings(location.getWorld());
|
||||||
if (plotworld.REQUIRE_CLUSTER) {
|
if (Settings.ENABLE_CLUSTERS && plotworld.REQUIRE_CLUSTER) {
|
||||||
return ClusterManager.getCluster(location) != null;
|
return ClusterManager.getCluster(location) != null;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user