This commit is contained in:
boy0001 2015-02-06 15:04:44 +11:00
parent bcc530ba6e
commit 88357a261b
4 changed files with 15 additions and 18 deletions

View File

@ -1073,7 +1073,6 @@ public class PlotMain extends JavaPlugin implements Listener {
FlagManager.addFlag(new AbstractFlag("break", new FlagValue.PlotBlockListValue())); FlagManager.addFlag(new AbstractFlag("break", new FlagValue.PlotBlockListValue()));
FlagManager.addFlag(new AbstractFlag("use", new FlagValue.PlotBlockListValue())); FlagManager.addFlag(new AbstractFlag("use", new FlagValue.PlotBlockListValue()));
FlagManager.addFlag(new AbstractFlag("gamemode") { FlagManager.addFlag(new AbstractFlag("gamemode") {
@Override @Override
public String parseValueRaw(final String value) { public String parseValueRaw(final String value) {

View File

@ -75,11 +75,9 @@ import com.intellectualcrafters.plot.util.SendChunk;
Location top = PlotHelper.getPlotTopLoc(world, plot.id); Location top = PlotHelper.getPlotTopLoc(world, plot.id);
int botx = bottom.getBlockX(); int botx = bottom.getBlockX();
int boty = bottom.getBlockY();
int botz = bottom.getBlockZ(); int botz = bottom.getBlockZ();
int topx = top.getBlockX(); int topx = top.getBlockX();
int topy = top.getBlockY();
int topz = top.getBlockZ(); int topz = top.getBlockZ();
HybridPlotWorld hpw = (HybridPlotWorld) PlotMain.getWorldSettings(world); HybridPlotWorld hpw = (HybridPlotWorld) PlotMain.getWorldSettings(world);

View File

@ -518,25 +518,26 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public static void MobSpawn(final CreatureSpawnEvent event) { public static void MobSpawn(final CreatureSpawnEvent event) {
System.out.print(1);
final World world = event.getLocation().getWorld(); final World world = event.getLocation().getWorld();
if (event.getEntity() instanceof Player) {
return;
}
if (!isPlotWorld(world)) { if (!isPlotWorld(world)) {
return; return;
} }
Location loc = event.getLocation();
if (!isPlotArea(loc)) {
return;
}
final PlotWorld pW = getPlotWorld(world); final PlotWorld pW = getPlotWorld(world);
final CreatureSpawnEvent.SpawnReason reason = event.getSpawnReason(); final CreatureSpawnEvent.SpawnReason reason = event.getSpawnReason();
if ((reason == CreatureSpawnEvent.SpawnReason.SPAWNER_EGG) && pW.SPAWN_EGGS) { if (!(reason == CreatureSpawnEvent.SpawnReason.SPAWNER_EGG) && pW.SPAWN_EGGS) {
return; event.setCancelled(true);
} else if ((reason == CreatureSpawnEvent.SpawnReason.BREEDING) && pW.SPAWN_BREEDING) { } else if (!(reason == CreatureSpawnEvent.SpawnReason.BREEDING) && pW.SPAWN_BREEDING) {
return; event.setCancelled(true);
} else if ((reason == CreatureSpawnEvent.SpawnReason.CUSTOM) && pW.SPAWN_CUSTOM) { } else if (!(reason == CreatureSpawnEvent.SpawnReason.CUSTOM) && pW.SPAWN_CUSTOM) {
return; event.setCancelled(true);
}
if (event.getEntity() instanceof Player) {
return;
}
Location loc = event.getLocation();
if (!isInPlot(loc)) {
if (isPlotArea(loc)) { event.setCancelled(true); }
} }
} }

View File

@ -27,7 +27,7 @@ import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
@SuppressWarnings("unused") public abstract class PlotManager { public abstract class PlotManager {
/* /*
* Plot locations (methods with Abs in them will not need to consider mega * Plot locations (methods with Abs in them will not need to consider mega
@ -49,7 +49,6 @@ import org.bukkit.block.Biome;
/* /*
* Plot clearing (return false if you do not support some method) * Plot clearing (return false if you do not support some method)
*/ */
public abstract boolean clearPlot(final World world, final Plot plot, boolean isDelete); public abstract boolean clearPlot(final World world, final Plot plot, boolean isDelete);
public abstract Location getSignLoc(final World world, final PlotWorld plotworld, final Plot plot); public abstract Location getSignLoc(final World world, final PlotWorld plotworld, final Plot plot);