Package org.getspout.spoutapi.player

Examples of org.getspout.spoutapi.player.SpoutPlayer


      Monument monument = warzone.getMonumentFromCenterBlock(block);
      if (monument.hasOwner()) {
        Team ownerTeam = monument.getOwnerTeam();
        if (War.war.isSpoutServer()) {
          for (Player p : team.getPlayers()) {
            SpoutPlayer sp = SpoutManager.getPlayer(p);
            if (sp.isSpoutCraftEnabled()) {
                      sp.sendNotification(
                          SpoutDisplayer.cleanForNotification("Monument " + ChatColor.WHITE + monument.getName()),
                          SpoutDisplayer.cleanForNotification(ChatColor.YELLOW + "freed by " + team.getKind().getColor() + player.getName() + ChatColor.YELLOW + "!"),
                          ownerTeam.getKind().getMaterial(),
                          ownerTeam.getKind().getData(),
                          10000);
            }
          }
        }
        warzone.broadcast("zone.monument.lose", ownerTeam.getName(), monument.getName());
        monument.uncapture();
      }
      event.setCancelled(false);
      return;
    }
    // changes in parts of important areas
    if (warzone != null && warzone.isImportantBlock(block) && (!isZoneMaker || (isZoneMaker && team != null))) {
      // breakage of spawn
      if (team != null && team.isSpawnLocation(block.getLocation())) {
        // let team members loot one block the spawn for monument captures
        if (player.getInventory().containsAtLeast(team.getKind().getBlockHead(), 1)) {
          War.war.badMsg(player, "build.denied.zone.multteam", team.getName());
          event.setCancelled(true);
          return;
        } else {
          event.setCancelled(false); // very important, otherwise could get cancelled but unbreakableZoneBlocks further down
          return;
        }
      }
      // stealing of flag
      if (team != null && warzone.isEnemyTeamFlagBlock(team, block)) {
        if (warzone.isFlagThief(player.getName())) {
          // detect audacious thieves
          War.war.badMsg(player, "zone.stealextra.flag");
        } else if (warzone.isBombThief(player.getName()) || warzone.isCakeThief(player.getName())) {
          War.war.badMsg(player, "zone.stealextra.other");
        } else {
          Team lostFlagTeam = warzone.getTeamForFlagBlock(block);
          if (lostFlagTeam.getPlayers().size() != 0) {
            // player just broke the flag block of other team: cancel to avoid drop, give player the block, set block to air
            ItemStack teamKindBlock = lostFlagTeam.getKind().getBlockHead();
            player.getInventory().clear();
            player.getInventory().addItem(teamKindBlock);
            warzone.addFlagThief(lostFlagTeam, player.getName());
            block.setType(Material.AIR);
            for (Team t : warzone.getTeams()) {
              t.teamcast("zone.steal.flag.broadcast", team.getKind().getColor() + player.getName() + ChatColor.WHITE, lostFlagTeam.getName());
              if (t.getName().equals(lostFlagTeam.getName())) {
                if (War.war.isSpoutServer()) {
                  for (Player p : t.getPlayers()) {
                    SpoutPlayer sp = SpoutManager.getPlayer(p);
                    if (sp.isSpoutCraftEnabled()) {
                              sp.sendNotification(
                                  SpoutDisplayer.cleanForNotification(team.getKind().getColor() + player.getName() + ChatColor.YELLOW + " stole"),
                                  SpoutDisplayer.cleanForNotification(ChatColor.YELLOW + "your flag!"),
                                  lostFlagTeam.getKind().getMaterial(),
                                  lostFlagTeam.getKind().getData(),
                                  5000);
                    }
                  }
                }
                t.teamcast("zone.steal.flag.prevent", team.getKind().getColor() + player.getName() + ChatColor.WHITE, team.getName());
              }
            }
            War.war.msg(player, "zone.steal.flag.notice", lostFlagTeam.getName());
          } else {
            War.war.msg(player, "zone.steal.flag.empty", lostFlagTeam.getName());
          }
        }
        event.setCancelled(true);
        return;
      } else if (team != null && warzone.isBombBlock(block)) {
        if (warzone.isBombThief(player.getName())) {
          // detect audacious thieves
          War.war.badMsg(player, "zone.stealextra.bomb");
        } else if (warzone.isFlagThief(player.getName()) || warzone.isCakeThief(player.getName())) {
          War.war.badMsg(player, "zone.stealextra.other");
        } else {
          Bomb bomb = warzone.getBombForBlock(block);
          // player just broke the bomb block: cancel to avoid drop, give player the block, set block to air
          ItemStack tntBlock = new ItemStack(Material.TNT);
          tntBlock.setDurability((short)8);
          player.getInventory().clear();
          player.getInventory().addItem(tntBlock);
          warzone.addBombThief(bomb, player.getName());
          block.setType(Material.AIR);
          for (Team t : warzone.getTeams()) {
            t.teamcast("zone.steal.bomb.broadcast", team.getKind().getColor() + player.getName() + ChatColor.WHITE, ChatColor.GREEN + bomb.getName() + ChatColor.WHITE);
            if (War.war.isSpoutServer()) {
              for (Player p : t.getPlayers()) {
                SpoutPlayer sp = SpoutManager.getPlayer(p);
                if (sp.isSpoutCraftEnabled()) {
                          sp.sendNotification(
                              SpoutDisplayer.cleanForNotification(team.getKind().getColor() + player.getName() + ChatColor.YELLOW + " has "),
                              SpoutDisplayer.cleanForNotification(ChatColor.YELLOW + "bomb " + ChatColor.GREEN + bomb.getName() + ChatColor.YELLOW + "!"),
                              Material.TNT,
                              (short)0,
                              5000);
                }
              }
            }
            t.teamcast("zone.steal.bomb.prevent", team.getKind().getColor() + player.getName() + ChatColor.WHITE);
          }
          War.war.msg(player, "zone.steal.bomb.notice", bomb.getName());
        }
        event.setCancelled(true);
        return;
      } else if (team != null && warzone.isCakeBlock(block)) {
        if (warzone.isCakeThief(player.getName())) {
          // detect audacious thieves
          War.war.badMsg(player, "zone.stealextra.cake");
        } else if (warzone.isFlagThief(player.getName()) || warzone.isBombThief(player.getName())) {
          War.war.badMsg(player, "zone.stealextra.other");
        } else {
          Cake cake = warzone.getCakeForBlock(block);
          // player just broke the cake block: cancel to avoid drop, give player the block, set block to air
          ItemStack cakeBlock = new ItemStack(Material.CAKE);
          cakeBlock.setDurability((short)8);
          player.getInventory().clear();
          player.getInventory().addItem(cakeBlock);
          warzone.addCakeThief(cake, player.getName());
          block.setType(Material.AIR);
          for (Team t : warzone.getTeams()) {
            t.teamcast("zone.steal.cake.broadcast", team.getKind().getColor() + player.getName() + ChatColor.WHITE, ChatColor.GREEN + cake.getName() + ChatColor.WHITE);
            if (War.war.isSpoutServer()) {
              for (Player p : t.getPlayers()) {
                SpoutPlayer sp = SpoutManager.getPlayer(p);
                if (sp.isSpoutCraftEnabled()) {
                          sp.sendNotification(
                              SpoutDisplayer.cleanForNotification(team.getKind().getColor() + player.getName() + ChatColor.YELLOW + " has "),
                              SpoutDisplayer.cleanForNotification(ChatColor.YELLOW + "cake " + ChatColor.GREEN + cake.getName() + ChatColor.YELLOW + "!"),
                              Material.CAKE,
                              (short)0,
                              5000);
View Full Code Here


            if (cp != null && cp.getClan().isVerified())
            {
                Clan clan = cp.getClan();

                SpoutPlayer sp = getPlayer(player);

                if (plugin.getSettingsManager().isClanCapes())
                {
                    if (!clan.getCapeUrl().isEmpty())
                    {
                        if (clan.getCapeUrl().toLowerCase().contains(".png"))
                        {
                            sp.setCape(clan.getCapeUrl());
                        }
                    }
                    else
                    {
                        if (plugin.getSettingsManager().getDefaultCapeUrl().toLowerCase().contains(".png"))
                        {
                            sp.setCape(plugin.getSettingsManager().getDefaultCapeUrl());
                        }
                    }
                }

                if (plugin.getSettingsManager().isInGameTags())
                {
                    if (player.isSneaking())
                    {
                        sp.setTitle(player.getName());
                    }
                    else
                    {
                        String tag = plugin.getSettingsManager().isInGameTagsColored() ? (plugin.getSettingsManager().getTagBracketColor() + plugin.getSettingsManager().getTagBracketLeft() + clan.getColorTag() + plugin.getSettingsManager().getTagBracketColor() + plugin.getSettingsManager().getTagBracketRight() + plugin.getSettingsManager().getTagSeparatorColor() + plugin.getSettingsManager().getTagSeparator()) : ChatColor.DARK_GRAY + plugin.getSettingsManager().getTagBracketLeft() + clan.getTag() + plugin.getSettingsManager().getTagBracketRight() + plugin.getSettingsManager().getTagSeparator();
                        sp.setTitle(tag + ChatColor.WHITE + player.getName());
                    }
                }
            }
        }
    }
View Full Code Here

        {
            ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);

            if (cp != null && cp.getClan().isVerified())
            {
                SpoutPlayer sp = getPlayer(player);
                sp.setCape("");
            }
        }
    }
View Full Code Here

     */
    public void playAlert(Player player)
    {
        if (isHasSpout())
        {
            SpoutPlayer sp = getPlayerFromId(player.getEntityId());
            getSoundManager().playCustomSoundEffect(plugin, sp, plugin.getSettingsManager().getAlertUrl(), true);
        }
    }
View Full Code Here

  @EventHandler(priority=EventPriority.HIGH)
  public void onSpoutcraftEnable(SpoutCraftEnableEvent e)
  {
    if ((e.getPlayer() instanceof SpoutPlayer)) {
      SpoutPlayer sp = e.getPlayer();
      this._instance.updateLivePermissionPlayer(sp);
      this._instance.updateLivePlayer(sp);
    }
  }
View Full Code Here

  @EventHandler(priority=EventPriority.HIGH, ignoreCancelled=true)
  public void onPlayerTeleport(PlayerTeleportEvent e)
  {
    if ((e.getPlayer() instanceof SpoutPlayer)) {
      SpoutPlayer sp = (SpoutPlayer)e.getPlayer();
      this._instance.updateLivePermissionPlayer(sp);
      this._instance.updateLivePlayer(sp);
    }
  }
View Full Code Here

  @EventHandler(priority=EventPriority.HIGH)
  public void onPlayerRespawn(PlayerRespawnEvent e)
  {
    if ((e.getPlayer() instanceof SpoutPlayer)) {
      SpoutPlayer sp = (SpoutPlayer)e.getPlayer();
      this._instance.updateLivePermissionPlayer(sp);
      this._instance.updateLivePlayer(sp);
    }
  }
View Full Code Here

        this._SimpleSkins._playerCapes.put(name, url);
        sendMessage(sender, "Player " + name + "'s cape has been set and saved.", true);
      }
    }

    SpoutPlayer sp = getSpoutPlayer(name);
    if (sp != null) {
      this._SimpleSkins.updateLivePlayer(sp);
    }

    this._SimpleSkins.saveDataToFiles();
View Full Code Here

  public SpoutPlayer getSpoutPlayer(String name)
  {
    Player p = Bukkit.getPlayer(name);
    if (p != null) {
      SpoutPlayer sp = SpoutManager.getPlayer(p);
      if (sp != null) {
        return sp;
      }
    }
    return null;
View Full Code Here

      }
    }
  }

  public void updateLiveCitizen(int id) {
    SpoutPlayer sp = null;
    if (this._citizensVersion == 2) {
      CitizensTwoSupport ctwo = new CitizensTwoSupport(id);
      sp = ctwo._sp;
    }
View Full Code Here

TOP

Related Classes of org.getspout.spoutapi.player.SpoutPlayer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.