mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-25 03:55:27 +01:00
Hopefully Fixed an NPE...
This commit is contained in:
parent
4053937019
commit
130c51c366
@ -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);
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user