mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Merge pull request #351 from MinelinkNetwork/master
Add option to allow helpers to WorldEdit
This commit is contained in:
commit
5621570772
@ -848,6 +848,7 @@ public class PlotSquared {
|
||||
|
||||
// WorldEdit
|
||||
options.put("worldedit.require-selection-in-mask", Settings.REQUIRE_SELECTION);
|
||||
options.put("worldedit.enable-for-helpers", Settings.WE_ALLOW_HELPER);
|
||||
options.put("worldedit.max-volume", Settings.WE_MAX_VOLUME);
|
||||
options.put("worldedit.max-iterations", Settings.WE_MAX_ITERATIONS);
|
||||
options.put("worldedit.blacklist", Arrays.asList("cs", ".s", "restore", "snapshot", "delchunks", "listchunks"));
|
||||
@ -928,6 +929,7 @@ public class PlotSquared {
|
||||
|
||||
// WorldEdit
|
||||
Settings.REQUIRE_SELECTION = config.getBoolean("worldedit.require-selection-in-mask");
|
||||
Settings.WE_ALLOW_HELPER = config.getBoolean("worldedit.enable-for-helpers");
|
||||
Settings.WE_MAX_VOLUME = config.getLong("worldedit.max-volume");
|
||||
Settings.WE_MAX_ITERATIONS = config.getLong("worldedit.max-iterations");
|
||||
Settings.WE_BLACKLIST = config.getStringList("worldedit.blacklist");
|
||||
|
@ -73,6 +73,7 @@ public class Settings {
|
||||
* Default worldedit-require-selection-in-mask: false
|
||||
*/
|
||||
public static boolean REQUIRE_SELECTION = true;
|
||||
public static boolean WE_ALLOW_HELPER = false;
|
||||
public static long WE_MAX_VOLUME = 500000;
|
||||
public static long WE_MAX_ITERATIONS = 1000;
|
||||
public static List<String> WE_BLACKLIST = new ArrayList<>();
|
||||
|
@ -4,6 +4,7 @@ import java.util.HashSet;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.config.Settings;
|
||||
import com.intellectualcrafters.plot.object.Location;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
@ -27,7 +28,7 @@ public class WEManager {
|
||||
UUID uuid = player.getUUID();
|
||||
for (Plot plot : PlotSquared.getPlots(player.getLocation().getWorld()).values()) {
|
||||
if (!plot.settings.getMerged(0) && !plot.settings.getMerged(3)) {
|
||||
if (plot.isOwner(uuid) || plot.trusted.contains(uuid)) {
|
||||
if (Settings.WE_ALLOW_HELPER ? plot.isAdded(uuid) : (plot.isOwner(uuid) || plot.trusted.contains(uuid))) {
|
||||
Location pos1 = MainUtil.getPlotBottomLoc(plot.world, plot.id).add(1, 0, 1);
|
||||
Location pos2 = MainUtil.getPlotTopLoc(plot.world, plot.id);
|
||||
regions.add(new RegionWrapper(pos1.getX(), pos2.getX(), pos1.getZ(), pos2.getZ()));
|
||||
|
Loading…
Reference in New Issue
Block a user