Пример #1
0
 /**
  * Instantiates a new Lobby block break.
  *
  * @param pl the pl
  */
 public LobbyBlockBreak(JavaPlugin pl) {
   this.plugin = (SCB) pl;
   this.protectionSet = this.plugin.getConfig().getBoolean("enableLobbyProtection");
   this.blacklist = SkyApi.getSm().blackListed();
   this.min = SkyApi.getLobbyManager().getLobbyRg().getMinVector();
   this.max = SkyApi.getLobbyManager().getLobbyRg().getMaxVector();
   this.world = SkyApi.getLobbyManager().getLobbyRg().getWorld().getName();
 }
Пример #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"));
      }
    }
  }
Пример #3
0
  /** Sets . */
  public void setup() {

    this.setCurrent(0);
    this.total = SkyApi.getSm().getArenaConfig().getConfig().getInt("arena.total");
    if (total > 0) {
      ArenaIO Aio = new ArenaIO();
      thearenas = Aio.loadArenas();
      arenaIds = Aio.getArenaKeys();
      for (String k : arenaIds) {
        String na = thearenas.get(Integer.parseInt(k)).getUniqueMap();
        nameToId.put(na, Integer.parseInt(k));
      }

    } else {
      SkyApi.getCMsg().WARNING("No Arenas were loaded, most likely none have been created");
    }
  }
Пример #4
0
  @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();
  }
Пример #5
0
 public Location getLobbySpawn() {
   return ((SerializedLocation) SkyApi.getSm().getLobbyConfig().getConfig().get("lobby.box.spawn"))
       .getLocation();
 }
Пример #6
0
  public LobbyController() {

    this.config = SkyApi.getSm().getLobby2Config();
  }
Пример #7
0
  /**
   * Instantiates a new Arena manager.
   *
   * @param p the p
   */
  public ArenaManager() {

    this.plugin = SkyApi.getSCB();
    setup();
  }
Пример #8
0
  public FirstRun() {

    SkyApi.getSCB().getConfig().getBoolean("modeSet");
  }