mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
fixes #131
This commit is contained in:
parent
bcc530ba6e
commit
88357a261b
@ -1073,7 +1073,6 @@ public class PlotMain extends JavaPlugin implements Listener {
|
||||
FlagManager.addFlag(new AbstractFlag("break", new FlagValue.PlotBlockListValue()));
|
||||
FlagManager.addFlag(new AbstractFlag("use", new FlagValue.PlotBlockListValue()));
|
||||
|
||||
|
||||
FlagManager.addFlag(new AbstractFlag("gamemode") {
|
||||
@Override
|
||||
public String parseValueRaw(final String value) {
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user