This commit is contained in:
Matt 2016-03-04 16:37:38 -05:00
parent 780d4e09d5
commit 5c60d69fd1
5 changed files with 114 additions and 109 deletions

View File

@ -1132,6 +1132,12 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen
return; return;
} }
break; break;
case SPAWNER:
if (!area.MOB_SPAWNER_SPAWNING) {
event.setCancelled(true);
return;
}
break;
} }
final Plot plot = area.getOwnedPlotAbs(loc); final Plot plot = area.getOwnedPlotAbs(loc);
if (plot == null) { if (plot == null) {

View File

@ -20,8 +20,6 @@
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
package com.intellectualcrafters.plot.commands; package com.intellectualcrafters.plot.commands;
import java.util.UUID;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Location;
@ -34,6 +32,8 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
import com.plotsquared.general.commands.Argument; import com.plotsquared.general.commands.Argument;
import com.plotsquared.general.commands.CommandDeclaration; import com.plotsquared.general.commands.CommandDeclaration;
import java.util.UUID;
@CommandDeclaration( @CommandDeclaration(
command = "trust", command = "trust",
aliases = { "t" }, aliases = { "t" },
@ -77,7 +77,6 @@ public class Trust extends SubCommand {
MainUtil.sendMessage(plr, C.ALREADY_OWNER); MainUtil.sendMessage(plr, C.ALREADY_OWNER);
return false; return false;
} }
if (plot.getTrusted().contains(uuid)) { if (plot.getTrusted().contains(uuid)) {
MainUtil.sendMessage(plr, C.ALREADY_ADDED); MainUtil.sendMessage(plr, C.ALREADY_ADDED);
return false; return false;

View File

@ -208,7 +208,7 @@ public class FlagManager {
} }
public static Flag getSettingFlagAbs(final PlotSettings settings, final String flag) { public static Flag getSettingFlagAbs(final PlotSettings settings, final String flag) {
if (settings.flags == null || settings.flags.isEmpty()) { if (settings.flags.isEmpty()) {
return null; return null;
} }
return settings.flags.get(flag); return settings.flags.get(flag);

View File

@ -54,6 +54,7 @@ public abstract class PlotArea {
public boolean AUTO_MERGE = false; public boolean AUTO_MERGE = false;
public boolean ALLOW_SIGNS = true; public boolean ALLOW_SIGNS = true;
public boolean MOB_SPAWNING = false; public boolean MOB_SPAWNING = false;
public boolean MOB_SPAWNER_SPAWNING = false;
public int PLOT_BIOME = 1; public int PLOT_BIOME = 1;
public boolean PLOT_CHAT = false; public boolean PLOT_CHAT = false;
public boolean SCHEMATIC_CLAIM_SPECIFY = false; public boolean SCHEMATIC_CLAIM_SPECIFY = false;
@ -198,6 +199,7 @@ public abstract class PlotArea {
TYPE = config.getInt("generator.type"); TYPE = config.getInt("generator.type");
} }
MOB_SPAWNING = config.getBoolean("natural_mob_spawning"); MOB_SPAWNING = config.getBoolean("natural_mob_spawning");
MOB_SPAWNER_SPAWNING = config.getBoolean("mob_spawner_spawning");
AUTO_MERGE = config.getBoolean("plot.auto_merge"); AUTO_MERGE = config.getBoolean("plot.auto_merge");
MAX_PLOT_MEMBERS = config.getInt("limits.max-members"); MAX_PLOT_MEMBERS = config.getInt("limits.max-members");
ALLOW_SIGNS = config.getBoolean("plot.create_signs"); ALLOW_SIGNS = config.getBoolean("plot.create_signs");
@ -292,6 +294,7 @@ public abstract class PlotArea {
public void saveConfiguration(final ConfigurationSection config) { public void saveConfiguration(final ConfigurationSection config) {
final HashMap<String, Object> options = new HashMap<>(); final HashMap<String, Object> options = new HashMap<>();
options.put("natural_mob_spawning", MOB_SPAWNING); options.put("natural_mob_spawning", MOB_SPAWNING);
options.put("mob_spawner_spawning", MOB_SPAWNER_SPAWNING);
options.put("plot.auto_merge", AUTO_MERGE); options.put("plot.auto_merge", AUTO_MERGE);
options.put("plot.create_signs", ALLOW_SIGNS); options.put("plot.create_signs", ALLOW_SIGNS);
options.put("plot.biome", "FOREST"); options.put("plot.biome", "FOREST");

View File

@ -175,9 +175,7 @@ public class MainListener {
if (plotworld == null) { if (plotworld == null) {
return; return;
} }
event.filterEntities(new Predicate<Entity>() { event.filterEntities((Predicate<Entity>) entity -> {
@Override
public boolean test(Entity entity) {
if (entity instanceof Player) { if (entity instanceof Player) {
return true; return true;
} }
@ -282,7 +280,6 @@ public class MainListener {
entity.setRotation(new Vector3d(MathMan.roundInt(pos.getX()), MathMan.roundInt(pos.getY()), MathMan.roundInt(pos.getZ()))); entity.setRotation(new Vector3d(MathMan.roundInt(pos.getX()), MathMan.roundInt(pos.getY()), MathMan.roundInt(pos.getZ())));
} }
return true; return true;
}
}); });
} }