Exemplo n.º 1
0
 @EventHandler(ignoreCancelled = true)
 public void onPlayerEntersBed(PlayerBedEnterEvent event) {
   if (dEntity.isNPC(event.getPlayer())) {
     return;
   }
   location = new dLocation(event.getBed().getLocation());
   cancelled = event.isCancelled();
   this.event = event;
   fire();
   event.setCancelled(cancelled);
 }
Exemplo n.º 2
0
  @EventHandler
  public void onSleep(PlayerBedEnterEvent bee) {

    Player p = bee.getPlayer();

    Game g = Main.getInstance().getGameManager().getGameOfPlayer(p);
    if (g == null) {
      return;
    }

    if (g.getState() == GameState.STOPPED) {
      return;
    }

    bee.setCancelled(true);
  }
Exemplo n.º 3
0
 @Override
 public void onPlayerBedEnter(PlayerBedEnterEvent event) {
   plugin.triggerMessages(event.getPlayer(), "onbedenter");
   if (plugin.triggerMessages(event.getPlayer(), "onbedenter|override")) event.setCancelled(true);
 }