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

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

View File

@ -75,11 +75,9 @@ import com.intellectualcrafters.plot.util.SendChunk;
Location top = PlotHelper.getPlotTopLoc(world, plot.id);
int botx = bottom.getBlockX();
int boty = bottom.getBlockY();
int botz = bottom.getBlockZ();
int topx = top.getBlockX();
int topy = top.getBlockY();
int topz = top.getBlockZ();
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)
public static void MobSpawn(final CreatureSpawnEvent event) {
System.out.print(1);
final World world = event.getLocation().getWorld();
if (event.getEntity() instanceof Player) {
return;
}
if (!isPlotWorld(world)) {
return;
}
Location loc = event.getLocation();
if (!isPlotArea(loc)) {
return;
}
final PlotWorld pW = getPlotWorld(world);
final CreatureSpawnEvent.SpawnReason reason = event.getSpawnReason();
if ((reason == CreatureSpawnEvent.SpawnReason.SPAWNER_EGG) && pW.SPAWN_EGGS) {
return;
} else if ((reason == CreatureSpawnEvent.SpawnReason.BREEDING) && pW.SPAWN_BREEDING) {
return;
} else if ((reason == CreatureSpawnEvent.SpawnReason.CUSTOM) && pW.SPAWN_CUSTOM) {
return;
}
if (event.getEntity() instanceof Player) {
return;
}
Location loc = event.getLocation();
if (!isInPlot(loc)) {
if (isPlotArea(loc)) { event.setCancelled(true); }
if (!(reason == CreatureSpawnEvent.SpawnReason.SPAWNER_EGG) && pW.SPAWN_EGGS) {
event.setCancelled(true);
} else if (!(reason == CreatureSpawnEvent.SpawnReason.BREEDING) && pW.SPAWN_BREEDING) {
event.setCancelled(true);
} else if (!(reason == CreatureSpawnEvent.SpawnReason.CUSTOM) && pW.SPAWN_CUSTOM) {
event.setCancelled(true);
}
}

View File

@ -27,7 +27,7 @@ import org.bukkit.Location;
import org.bukkit.World;
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
@ -49,7 +49,6 @@ import org.bukkit.block.Biome;
/*
* 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 Location getSignLoc(final World world, final PlotWorld plotworld, final Plot plot);