@Override public void onPlayerInteract(final PlayerInteractEvent event) { if (event.isCancelled()) { return; } if (event.getAction() != Action.RIGHT_CLICK_BLOCK) { return; } if (ess.getSettings().getBedSetsHome() && event.getClickedBlock().getType() == Material.BED_BLOCK) { try { final User user = ess.getUser(event.getPlayer()); user.setHome(); user.sendMessage(Util.i18n("homeSetToBed")); } catch (Throwable ex) { } } }
public void setHome(final String name) { setHome(name, getLocation()); }
/** * Set a home at the given location, with the given name for the specified player * * @param playername The player * @param home The name of the home * @param loc The location of the home * @throws CommandException user is null */ public void setHome(String playername, String home, Location loc) throws CommandException { User u = getEssentialsUser(playername); u.setHome(home, loc); }
public void setHome() { setHome("home", getLocation()); }