mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-23 12:06:15 +01:00
added flag "no-worldedit"
This commit is contained in:
parent
4c8adcda68
commit
fc869c0ec8
@ -8,7 +8,7 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<artifactId>PlotSquared</artifactId>
|
||||
<version>2.5.11</version>
|
||||
<version>2.5.12</version>
|
||||
<name>PlotSquared</name>
|
||||
<packaging>jar</packaging>
|
||||
<build>
|
||||
|
@ -1020,7 +1020,7 @@ public class PlotMain extends JavaPlugin implements Listener {
|
||||
}
|
||||
|
||||
private static void addPlusFlags() {
|
||||
final List<String> booleanFlags = Arrays.asList("notify-enter", "notify-leave", "item-drop", "invincible", "instabreak", "drop-protection", "forcefield", "titles", "pve", "pvp");
|
||||
final List<String> booleanFlags = Arrays.asList("notify-enter", "notify-leave", "item-drop", "invincible", "instabreak", "drop-protection", "forcefield", "titles", "pve", "pvp", "no-worldedit");
|
||||
final List<String> intervalFlags = Arrays.asList("feed", "heal");
|
||||
final List<String> stringFlags = Arrays.asList("greeting", "farewell");
|
||||
for (final String flag : stringFlags) {
|
||||
|
@ -86,6 +86,14 @@ import com.intellectualcrafters.plot.object.PlotWorld;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isPlotFlagTrue(Plot plot, String strFlag) {
|
||||
Flag flag = getPlotFlag(plot, strFlag);
|
||||
if (flag == null) {
|
||||
return false;
|
||||
}
|
||||
return flag.getValue().equals("true");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of a flag for a plot (ignores flag defaults)
|
||||
* @param plot
|
||||
|
@ -244,6 +244,8 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
||||
|
||||
@EventHandler
|
||||
public static void onBigBoom(final EntityExplodeEvent event) {
|
||||
// TODO allow tnt explosion within some plots
|
||||
// TODO prevent entity velocity from explosion in plotworld
|
||||
final World world = event.getLocation().getWorld();
|
||||
if (!isPlotWorld(world)) {
|
||||
return;
|
||||
|
@ -27,6 +27,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotMain;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.flag.FlagManager;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -59,6 +60,9 @@ import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
if (id != null) {
|
||||
final Plot plot = PlotMain.getPlots(l.getWorld()).get(id);
|
||||
if (plot != null) {
|
||||
if (FlagManager.isPlotFlagTrue(plot, "no-worldedit")) {
|
||||
return;
|
||||
}
|
||||
boolean r;
|
||||
r = ((plot.getOwner() != null) && plot.getOwner().equals(UUIDHandler.getUUID(p))) || plot.helpers.contains(DBFunc.everyone) || plot.helpers.contains(UUIDHandler.getUUID(p));
|
||||
if (!r) {
|
||||
|
Loading…
Reference in New Issue
Block a user