Package org.getspout.spoutapi.player

Examples of org.getspout.spoutapi.player.SpoutPlayer


{
  public SpoutPlayer _sp;

  public CitizensTwoSupport(int id)
  {
    SpoutPlayer sp = null;
    NPC npc = CitizensAPI.getNPCRegistry().getById(id);
    if ((npc != null) &&
      (npc.getBukkitEntity() != null) &&
      ((npc.getBukkitEntity() instanceof LivingEntity))) {
      sp = SpoutManager.getPlayer((Player)npc.getBukkitEntity());
View Full Code Here



public class CitizensOneSupport {
 
  public SpoutPlayer getCitizenAsPlayer(int id) {
    SpoutPlayer sp = null;
    HumanNPC npc = CitizensManager.getNPC(id);
    if(npc != null) {
      if(npc.getPlayer() instanceof Player) {
        sp = SpoutManager.getPlayer((Player) npc.getPlayer());
      }
View Full Code Here

        boolean result = false;
        Log.Write("1");
        if (General.SpoutEnabled)
        {
            Log.Write("2");
            SpoutPlayer sp = ezp.getSpoutPlayer();
            Log.Write("3");
            if (sp != null)
            {
                Log.Write("4");
                if (sp.isSpoutCraftEnabled())
                {
                    Log.Write("5");
                    result = true;
                }
            }
View Full Code Here

    public static void UpdatePlayerZone(EpicZonePlayer ezp, EpicZone zone)
    {
        if (General.SpoutEnabled)
        {
            SpoutPlayer sp = ezp.getSpoutPlayer();
            if (sp != null && zone != null)
            {
                if (sp.isSpoutCraftEnabled())
                {
                    if (ezp.UI.getZoneLabel() == null)
                    {
                        ezp.UI.setZoneLabel((GenericLabel) lblZoneName.copy());
                    }
                    if (sp.getMainScreen().containsWidget(ezp.UI.getZoneLabel()))
                    {
                        ezp.UI.getZoneLabel().setText(zone.getName());
                        ezp.UI.getZoneLabel().setAnchor(WidgetAnchor.TOP_RIGHT);
                        ezp.UI.getZoneLabel().setAlign(WidgetAnchor.TOP_RIGHT);
                        ezp.UI.getZoneLabel().setDirty(true);
                    }
                    else if (sp.getMainScreen().canAttachWidget(lblZoneName))
                    {
                        ezp.UI.getZoneLabel().setText(zone.getName());
                        ezp.UI.getZoneLabel().setAnchor(WidgetAnchor.TOP_RIGHT);
                        ezp.UI.getZoneLabel().setAlign(WidgetAnchor.TOP_RIGHT);
                        sp.getMainScreen().attachWidget(General.plugin, ezp.UI.getZoneLabel());
                    }
                }
            }
        }
    }
View Full Code Here

    public static void UpdatePlayerXYZ(Player player)
    {
        if (General.SpoutEnabled)
        {
            EpicZonePlayer ezp = General.getPlayer(player.getName());
            SpoutPlayer sp = ezp.getSpoutPlayer();
            if (sp != null)
            {
                if (sp.isSpoutCraftEnabled())
                {
                    Location loc = player.getLocation();
                    if (ezp.UI.getXYZLabel() == null)
                    {
                        ezp.UI.setXYZLabel((GenericLabel) lblXYZ.copy());
                    }
                    if (sp.getMainScreen().containsWidget(ezp.UI.getXYZLabel()))
                    {
                        ezp.UI.getXYZLabel().setText("X:" + loc.getBlockX() + " Y:" + loc.getBlockY() + " Z:" + loc.getBlockZ());
                        ezp.UI.getXYZLabel().setAnchor(WidgetAnchor.TOP_CENTER);
                        ezp.UI.getXYZLabel().setAlign(WidgetAnchor.TOP_CENTER);
                        ezp.UI.getXYZLabel().setDirty(true);
                    }
                    else if (sp.getMainScreen().canAttachWidget(lblZoneName))
                    {
                        ezp.UI.getXYZLabel().setText("X:" + loc.getBlockX() + " Y:" + loc.getBlockY() + " Z:" + loc.getBlockZ());
                        ezp.UI.getXYZLabel().setAnchor(WidgetAnchor.TOP_CENTER);
                        ezp.UI.getXYZLabel().setAlign(WidgetAnchor.TOP_CENTER);
                        sp.getMainScreen().attachWidget(General.plugin, ezp.UI.getXYZLabel());
                    }
                }
            }
        }
    }
View Full Code Here

    @EventHandler
    public void onSpoutCraftEnable(SpoutCraftEnableEvent event) {
        if (!this.enabled) {
            return;
        }
        final SpoutPlayer newPlayer = event.getPlayer();
        if (!VanishPerms.canSeeAll(newPlayer)) {
            return;
        }
        for (final SpoutPlayer p : SpoutManager.getOnlinePlayers()) {
            if (this.plugin.getManager().isVanished(p.getName())) {
                PlayerData data = this.playerDataMap.get(p.getName());
                if (data == null) {
                    data = this.initPlayer(p);
                }
                this.playerUpdate(p, data, newPlayer);
            }
        }
        if (this.plugin.getManager().isVanished(newPlayer.getName())) {
            this.onVanish(newPlayer);
        }
    }
View Full Code Here

    @Override
    public void onUnvanish(Player revealing) {
        if (!this.enabled) {
            return;
        }
        final SpoutPlayer revealingPlayer = SpoutManager.getPlayer(revealing);
        this.removeStatusBar(revealingPlayer);
        for (final SpoutPlayer player : SpoutManager.getOnlinePlayers()) {
            if ((player != null) && player.hasPermission("vanish.see") && player.isSpoutCraftEnabled()) {
                revealingPlayer.resetSkinFor(player);
                revealingPlayer.resetCapeFor(player);
                revealingPlayer.resetTitleFor(player);
            }
        }
    }
View Full Code Here

  }

  @EventHandler(priority = EventPriority.HIGH)
  public void onButtonClick(ButtonClickEvent event) {

    SpoutPlayer player = event.getPlayer();

    // **********fight**************
    checkButtonClicked("Move. 1", 5, player, ConflictPlugin.skillFightSpeedLand, 1, "updateWalkSpeed", event);
    checkButtonClicked("Jump", 5, player, ConflictPlugin.skillFightJump, 1, "updateJump", event);
    // checkButtonClicked("Swim 1", 5, player, ConflictPlugin.skillFightSpeedWater, 1, "updateSwimSpeed", event);
    // checkButtonClicked("Swim 2", 5, player, ConflictPlugin.skillFightSpeedWater, 2, "updateSwimSpeed", event);
    checkButtonClicked("Move. 2", 10, player, ConflictPlugin.skillFightSpeedLand, 2, "updateWalkSpeed", event);

    checkButtonClicked("Fight 1", 5, player, ConflictPlugin.skillFightMonsters, 1, null, event);
    checkButtonClicked("Fight 2", 5, player, ConflictPlugin.skillFightMonsters, 2, null, event);
    checkButtonClicked("Def. 1", 5, player, ConflictPlugin.skillFightArmor, 1, null, event);
    checkButtonClicked("Dam. 1", 5, player, ConflictPlugin.skillFightDamage, 1, null, event);
    checkButtonClicked("Regen. 1", 10, player, ConflictPlugin.skillFightRegeneration, 1, null, event);
    checkButtonClicked("Camp 1", 10, player, ConflictPlugin.skillFightCamp, 1, "updateCampingTreshold", event);
    checkButtonClicked("Ender", 10, player, ConflictPlugin.skillFightDrop, 1, null, event);

    // **********craft*****************
    checkButtonClicked("Durability 1", 4, player, ConflictPlugin.skillCraftQual, 1, null, event);
    checkButtonClicked("Durability 2", 4, player, ConflictPlugin.skillCraftQual, 2, null, event);
    checkButtonClicked("Bow 1", 5, player, ConflictPlugin.skillCraftBow, 1, null, event);
    checkButtonClicked("Sword 1", 5, player, ConflictPlugin.skillCraftSword, 1, null, event);
    checkButtonClicked("Armor 1", 5, player, ConflictPlugin.skillCraftArmor, 1, null, event);
    checkButtonClicked("Tools 1", 5, player, ConflictPlugin.skillCraftTool, 1, null, event);
    checkButtonClicked("Bow 2", 10, player, ConflictPlugin.skillCraftBow, 2, null, event);
    checkButtonClicked("Sword 2", 10, player, ConflictPlugin.skillCraftSword, 2, null, event);
    checkButtonClicked("Armor 2", 10, player, ConflictPlugin.skillCraftArmor, 2, null, event);
    checkButtonClicked("Tools 2", 10, player, ConflictPlugin.skillCraftTool, 2, null, event);

    // ***************MINE***************

    checkButtonClicked("Durab 1", 5, player, ConflictPlugin.skillMineDurab, 1, null, event);
    checkButtonClicked("Durab 2", 5, player, ConflictPlugin.skillMineDurab, 2, null, event);
    checkButtonClicked("Clay 1", 5, player, ConflictPlugin.skillMineClay, 1, null, event);
    checkButtonClicked("Lapis 1", 5, player, ConflictPlugin.skillMineLapis, 1, null, event);
    checkButtonClicked("Iron 1", 5, player, ConflictPlugin.skillMineIron, 1, null, event);
    // checkButtonClicked("Redstone 1", 5, player, ConflictPlugin.skillMineRedstone, 1, null, event);
    checkButtonClicked("Gold 1", 5, player, ConflictPlugin.skillMineGold, 1, null, event);
    checkButtonClicked("Diam. 1", 10, player, ConflictPlugin.skillMineDiamond, 1, null, event);

    checkButtonClicked("Clay 2", 5, player, ConflictPlugin.skillMineClay, 2, null, event);
    checkButtonClicked("Lapis 2", 5, player, ConflictPlugin.skillMineLapis, 2, null, event);
    checkButtonClicked("Iron 2", 5, player, ConflictPlugin.skillMineIron, 2, null, event);
    // checkButtonClicked("Redstone 1", 5, player, ConflictPlugin.skillMineRedstone, 1, null, event);
    checkButtonClicked("Gold 2", 5, player, ConflictPlugin.skillMineGold, 2, null, event);
    checkButtonClicked("Diam. 2", 10, player, ConflictPlugin.skillMineDiamond, 2, null, event);

    checkButtonClicked("G3d 1", 5, player, ConflictPlugin.skillFoodSeed, 1, null, event);
    checkButtonClicked("G3d 2", 5, player, ConflictPlugin.skillFoodHarvest, 1, null, event);
    checkButtonClicked("G3d 3", 5, player, ConflictPlugin.skillFoodBone, 1, null, event);
    checkButtonClicked("G3d 4", 5, player, ConflictPlugin.skillFoodSeed, 2, null, event);
    checkButtonClicked("Chicken 1", 5, player, ConflictPlugin.skillFoodChicken, 1, null, event);
    checkButtonClicked("Cow 1", 5, player, ConflictPlugin.skillFoodCow, 1, null, event);
    checkButtonClicked("Fish 1", 5, player, ConflictPlugin.skillFoodFish, 1, null, event);
    checkButtonClicked("Pig 1", 5, player, ConflictPlugin.skillFoodPork, 1, null, event);

    if (event.getButton().getText().equals("Fight")) {
      player.getMainScreen().closePopup();
      createOverlayFight(player);
    } else if (event.getButton().getText().equals("Craft")) {
      player.getMainScreen().closePopup();
      createOverlayCraft(player);
    } else if (event.getButton().getText().equals("Mine")) {
      player.getMainScreen().closePopup();
      createOverlayMine(player);
    } else if (event.getButton().getText().equals("Food")) {
      player.getMainScreen().closePopup();
      createOverlayFood(player);
    }

  }
View Full Code Here

   * G3d-Wachstum
   * @param event
   */
  @EventHandler(priority = EventPriority.HIGH)
  public void CheckGrow(PlayerInteractEvent event) {
    SpoutPlayer p = (SpoutPlayer) event.getPlayer();
   

    if (ConflictPlugin.skillFoodSeed.get(p.getName())>1 && event.getAction() == Action.RIGHT_CLICK_BLOCK) {

      Block a = event.getClickedBlock();
     

      if (null != a && a.getTypeId()==59) { //auf Saatgut geklickt
       
       
        if(p.getItemInHand().getTypeId()==295){
         
         
          if(a.getData()!=0x7){
            a.setData((byte)(a.getData()+1));
            p.getItemInHand().setAmount(p.getItemInHand().getAmount()-1);
          }
         
        }
       
     
View Full Code Here

  @EventHandler(priority = EventPriority.HIGH)
  public void onPlayerMineEvent(BlockBreakEvent event) {

   

    SpoutPlayer p = (SpoutPlayer) event.getPlayer();
    Block b = event.getBlock();
    int id = event.getBlock().getTypeId();

   
    //Haltbarkeit
    if (ConflictPlugin.skillMineDurab.get(p.getName()) > 0) {
      int treshold = 3;
      if (ConflictPlugin.skillMineDurab.get(p.getName()) > 1) {
        treshold = 5;
      }

      int i = generator.nextInt(10);

      if (i < treshold) {
        p.getItemInHand().setDurability((short) (event.getPlayer().getItemInHand().getDurability() - 1));
      }

    }

    // 50% Chance ausw�rfeln
    int rand = generator.nextInt(2);

    //Lapis 1,2
    if (id == 21 && ConflictPlugin.skillMineLapis.get(p.getName()) > 1) {
      b.getWorld().dropItem(b.getLocation(), new ItemStack(351, 2, (short)0, (byte)4));
    } else if (id == 21 && ConflictPlugin.skillMineLapis.get(event.getPlayer().getName()) > 0) {
        b.getWorld().dropItem(b.getLocation(), new ItemStack(351, 1, (short)0, (byte)4));
    }

    //Diamand 1,2
    if (id == 56 && ConflictPlugin.skillMineDiamond.get(p.getName()) > 1) {
      b.getWorld().dropItem(b.getLocation(), new ItemStack(264));
    } else if (id == 56 && ConflictPlugin.skillMineDiamond.get(event.getPlayer().getName()) > 0) {
      if (rand == 0)
        b.getWorld().dropItem(b.getLocation(), new ItemStack(264));
    }

    //Iron 1,2
    if (id == 15 && ConflictPlugin.skillMineIron.get(p.getName()) > 1) {
      b.getWorld().dropItem(b.getLocation(), new ItemStack(id));
    } else if (id == 15 && ConflictPlugin.skillMineIron.get(event.getPlayer().getName()) > 0) {
      if (rand == 0)
        b.getWorld().dropItem(b.getLocation(), new ItemStack(id));
    }

    //Redstone 1,2
    if ((id == 73 || id == 74) && ConflictPlugin.skillMineRedstone.get(p.getName()) > 1) {
      b.getWorld().dropItem(b.getLocation(), new ItemStack(331));
    } else if ((id == 73 || id == 74) && ConflictPlugin.skillMineRedstone.get(event.getPlayer().getName()) > 0) {
      if (rand == 0)
        b.getWorld().dropItem(b.getLocation(), new ItemStack(331));
    }

    //Gold 1,2
    if (id == 14 && ConflictPlugin.skillMineGold.get(p.getName()) > 1) {
      b.getWorld().dropItem(b.getLocation(), new ItemStack(id));
    } else if (id == 14 && ConflictPlugin.skillMineGold.get(event.getPlayer().getName()) > 0) {
      if (rand == 0)
        b.getWorld().dropItem(b.getLocation(), new ItemStack(id));
    }

    //Clay 1,2
    if (id == 82 && ConflictPlugin.skillMineClay.get(p.getName()) > 1) {
      b.getWorld().dropItem(b.getLocation(), new ItemStack(337,2));
    } else if (id == 82 && ConflictPlugin.skillMineClay.get(event.getPlayer().getName()) > 0) {
     
        b.getWorld().dropItem(b.getLocation(), new ItemStack(337, 1));
    }
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.