diff --git a/src/com/onarandombox/MultiVerseCore/MVEntityListener.java b/src/com/onarandombox/MultiVerseCore/MVEntityListener.java index 6aa2a8a1..f0b6c196 100644 --- a/src/com/onarandombox/MultiVerseCore/MVEntityListener.java +++ b/src/com/onarandombox/MultiVerseCore/MVEntityListener.java @@ -62,7 +62,7 @@ public class MVEntityListener extends EntityListener { return; } - if (defender instanceof Player){ + if (defender instanceof Player && attacker instanceof Player){ if (!(this.plugin.worlds.get(w.getName()).pvp)) { this.plugin.playerSessions.get(((Player) attacker)).message(ChatColor.RED + "PVP is disabled in this World."); event.setCancelled(true); diff --git a/src/com/onarandombox/MultiVerseCore/MVTeleport.java b/src/com/onarandombox/MultiVerseCore/MVTeleport.java index 6b6ef798..367a9806 100644 --- a/src/com/onarandombox/MultiVerseCore/MVTeleport.java +++ b/src/com/onarandombox/MultiVerseCore/MVTeleport.java @@ -32,7 +32,7 @@ public class MVTeleport { double x, y, z; if(location==null){ location = player.getLocation(); - + double srcComp = plugin.worlds.get(player.getWorld().getName()).compression; double trgComp = plugin.worlds.get(world.getName()).compression; @@ -40,9 +40,9 @@ public class MVTeleport { // If the Targets Compression is 0 then we teleport them to the Spawn of the World. if(trgComp==0.0){ - x = world.getSpawnLocation().getX(); + x = world.getSpawnLocation().getX()+0.5; y = world.getSpawnLocation().getY(); - z = world.getSpawnLocation().getZ(); + z = world.getSpawnLocation().getZ()+0.5; } else { x = location.getX() / (srcComp != 0 ? srcComp : 1) * trgComp + 0.5; y = location.getY(); @@ -80,7 +80,7 @@ public class MVTeleport { if (aux == -1) return null; MultiVerseCore.log.info("Target location (safe): " + x + ", " + aux + ", " + z); - + return new Location(world, x, aux, z, location.getYaw(),location.getPitch()); }