コード例 #1
0
ファイル: FirstRun.java プロジェクト: 20zinnm/SuperSkyBros
  @EventHandler(priority = EventPriority.LOWEST)
  public void preLogin(PlayerLoginEvent e) {

    if (!modeset && !e.getPlayer().isOp()) {
      e.setKickMessage(
          ChatColor.stripColor(
              SkyApi.getMessageManager().getErrorMessage("system.kickJoinNoPerm")));
      e.disallow(PlayerLoginEvent.Result.KICK_OTHER, e.getKickMessage());
      e.setResult(PlayerLoginEvent.Result.KICK_OTHER);

    } else e.allow();
  }
コード例 #2
0
  /**
   * Lobby break.
   *
   * @param BlockBreakEvent the event
   */
  @EventHandler(priority = EventPriority.LOW)
  public void lobbyBreak(BlockBreakEvent e) {
    if (this.blacklist.contains(e.getPlayer().getWorld().getName())) return;
    if (!this.protectionSet) return;

    Player player = e.getPlayer();
    String wo = player.getWorld().getName();

    if (!VaultManager.getInstance().perms.has(player, "ssba.admin.breakblocks")) {
      if (SkyApi.getLobbyManager().getLobbyRg().isAABB(e.getBlock().getLocation().toVector())) {
        e.setCancelled(true);
        player.sendMessage(
            SkyApi.getMessageManager().getErrorMessage("listeners.blockbreak.lobbyBreak"));
      }
    }
  }