diff --git a/src/PlayerCommands.java b/src/PlayerCommands.java index 3d25c944..4a878725 100644 --- a/src/PlayerCommands.java +++ b/src/PlayerCommands.java @@ -617,13 +617,14 @@ protected void execute(MessageReceiver caller, String[] split) { @Override protected void execute(MessageReceiver caller, String[] args) { - if (!(caller instanceof Player) && args.length < 2) { + boolean callerIsPlayer = caller instanceof Player; + if (!callerIsPlayer && args.length < 2) { return; } Player player; - if (args.length == 2 && (!(caller instanceof Player) || ((Player) caller).isAdmin())) { + if (args.length == 2 && (!callerIsPlayer || ((Player) caller).isAdmin())) { player = etc.getServer().matchPlayer(args[1]); } else { player = (Player) caller; @@ -635,17 +636,20 @@ protected void execute(MessageReceiver caller, String[] args) { } World world = player.getWorld(); if (world.getType() != World.Dimension.NORMAL) { - if (player.canIgnoreRestrictions()) { + if (!callerIsPlayer || ((Player) caller).canIgnoreRestrictions()) { player.switchWorlds(world); } else { - player.notify("You cannot set a home in the " + world.getType().name() + ", mortal."); + caller.notify("You cannot set a home in the " + world.getType().name() + ", mortal."); return; } } Warp home = new Warp(); - home.Location = player.getLocation(); + + + home.Location = callerIsPlayer ? ((Player) caller).getLocation() + : player.getLocation(); home.Group = ""; // no group neccessary, lol. home.Name = player.getName(); etc.getInstance().changeHome(home); diff --git a/src/World.java b/src/World.java index c5d0eb88..97f914c7 100644 --- a/src/World.java +++ b/src/World.java @@ -322,7 +322,7 @@ public Location getSpawnLocation() { spawn.z = info.e() + 0.5D; spawn.rotX = 0.0F; spawn.rotY = 0.0F; - spawn.dimension = this.getType().id; + spawn.dimension = 0; spawn.world = this.getName(); return spawn; }