@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) {
      }
    }
  }
Пример #2
0
 public void setHome(final String name) {
   setHome(name, getLocation());
 }
Пример #3
0
 /**
  * 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);
 }
Пример #4
0
 public void setHome() {
   setHome("home", getLocation());
 }