mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 10:14:42 +02:00
Merge branch '3.4.5' of https://github.com/IntellectualSites/PlotSquared into 3.5.0
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
package com.plotsquared.bukkit.listeners;
|
||||
|
||||
import com.intellectualcrafters.plot.config.Settings;
|
||||
import com.intellectualcrafters.plot.flag.Flags;
|
||||
import com.intellectualcrafters.plot.object.Location;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
import com.intellectualcrafters.plot.object.PlotArea;
|
||||
@ -14,14 +16,14 @@ public class EntitySpawnListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void creatureSpawnEvent(EntitySpawnEvent event) {
|
||||
Entity entity = event.getEntity();
|
||||
Location location = BukkitUtil.getLocation(entity.getLocation());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
Plot plot = area.getOwnedPlotAbs(location);
|
||||
switch (entity.getType()) {
|
||||
case ENDER_CRYSTAL:
|
||||
Location location = BukkitUtil.getLocation(entity.getLocation());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
Plot plot = area.getOwnedPlotAbs(location);
|
||||
if (plot == null) {
|
||||
if (!area.MOB_SPAWNING) {
|
||||
event.setCancelled(true);
|
||||
@ -32,5 +34,8 @@ public class EntitySpawnListener implements Listener {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
if (Settings.Done.RESTRICT_BUILDING && plot.hasFlag(Flags.DONE)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -534,6 +534,7 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
case PAINTING:
|
||||
case ARMOR_STAND:
|
||||
count[5]++;
|
||||
break;
|
||||
// misc
|
||||
case MINECART:
|
||||
case MINECART_CHEST:
|
||||
|
@ -164,7 +164,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
||||
ByteSource is = com.google.common.io.Files.asByteSource(file);
|
||||
NbtFactory.NbtCompound compound = NbtFactory.fromStream(is, NbtFactory.StreamOptions.GZIP_COMPRESSION);
|
||||
if (!compound.containsKey("bukkit")) {
|
||||
PS.debug("ERROR: Player data does not contain the the key \"bukkit\"");
|
||||
PS.debug("ERROR: Player data (" + uuid.toString() + ".dat) does not contain the the key \"bukkit\"");
|
||||
} else {
|
||||
NbtFactory.NbtCompound bukkit = (NbtFactory.NbtCompound) compound.get("bukkit");
|
||||
String name = (String) bukkit.get("lastKnownName");
|
||||
|
Reference in New Issue
Block a user