From f2d56ec2316af0f83d376ea02fc17e3381b6ead2 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Tue, 25 Aug 2015 00:00:29 +1000 Subject: [PATCH] Plot merge limits --- .../java/com/intellectualcrafters/plot/commands/Merge.java | 6 ++++++ .../com/plotsquared/bukkit/listeners/ChunkListener.java | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/intellectualcrafters/plot/commands/Merge.java b/src/main/java/com/intellectualcrafters/plot/commands/Merge.java index 7a40d948d..96b0b0341 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/Merge.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/Merge.java @@ -26,6 +26,7 @@ import java.util.UUID; import com.intellectualcrafters.plot.PS; import com.intellectualcrafters.plot.config.C; +import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotId; @@ -142,6 +143,11 @@ public class Merge extends SubCommand { default: return false; } + int size = selPlots.size(); + if (Permissions.hasPermissionRange(plr, "plots.merge", Settings.MAX_PLOTS) < size) { + MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.merge." + size); + return false; + } final PlotId botId = selPlots.get(0); final PlotId topId = selPlots.get(selPlots.size() - 1); final PlotId bot1 = MainUtil.getBottomPlot(MainUtil.getPlot(world, botId)).id; diff --git a/src/main/java/com/plotsquared/bukkit/listeners/ChunkListener.java b/src/main/java/com/plotsquared/bukkit/listeners/ChunkListener.java index 56ee577d9..2a90a85ef 100644 --- a/src/main/java/com/plotsquared/bukkit/listeners/ChunkListener.java +++ b/src/main/java/com/plotsquared/bukkit/listeners/ChunkListener.java @@ -10,7 +10,6 @@ import org.bukkit.Chunk; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.BlockState; -import org.bukkit.craftbukkit.v1_8_R2.CraftChunk; import org.bukkit.entity.Entity; import org.bukkit.entity.Item; import org.bukkit.entity.LivingEntity; @@ -23,7 +22,6 @@ import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.world.ChunkLoadEvent; import org.bukkit.event.world.ChunkUnloadEvent; -import org.bukkit.event.world.WorldSaveEvent; import com.intellectualcrafters.plot.PS; import com.intellectualcrafters.plot.config.Settings;