コード例 #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"));
      }
    }
  }