mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-12 10:24:07 +01:00
fixes #131
This commit is contained in:
parent
bcc530ba6e
commit
88357a261b
@ -1072,7 +1072,6 @@ public class PlotMain extends JavaPlugin implements Listener {
|
|||||||
FlagManager.addFlag(new AbstractFlag("place", new FlagValue.PlotBlockListValue()));
|
FlagManager.addFlag(new AbstractFlag("place", new FlagValue.PlotBlockListValue()));
|
||||||
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
|
||||||
|
@ -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);
|
||||||
|
@ -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); }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user