mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-09-06 13:08:04 +02:00
Patch null error in /home after recent update.
This commit is contained in:
parent
faa3a5e027
commit
56fccb9645
@ -277,14 +277,9 @@ public class Teleport implements Runnable, ITeleport
|
||||
{
|
||||
now(new Target(user.getLastLocation()), TeleportCause.COMMAND);
|
||||
}
|
||||
|
||||
public void home(IUser user, String home, Trade chargeFor) throws Exception
|
||||
|
||||
public void home(Location loc, Trade chargeFor) throws Exception
|
||||
{
|
||||
final Location loc = user.getHome(home);
|
||||
if (loc == null)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
teleport(new Target(loc), chargeFor, TeleportCause.COMMAND);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.Teleport;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
@ -96,11 +97,16 @@ public class Commandhome extends EssentialsCommand
|
||||
|
||||
private void goHome(final User user, final User player, final String home, final Trade charge) throws Exception
|
||||
{
|
||||
if (user.getWorld() != player.getHome(home).getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + player.getHome(home).getWorld().getName()))
|
||||
final Location loc = player.getHome(home);
|
||||
if (loc == null)
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + player.getHome(home).getWorld().getName()));
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
user.getTeleport().home(player, home, charge);
|
||||
if (user.getWorld() != loc.getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + loc.getWorld().getName()))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + loc.getWorld().getName()));
|
||||
}
|
||||
user.getTeleport().home(loc, charge);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user