Package org.getspout.spoutapi.player

Examples of org.getspout.spoutapi.player.SpoutPlayer


 
 
 
  @EventHandler(priority = EventPriority.HIGH)
  public void onPlayerArmorEvent(InventoryClickEvent event) {
    SpoutPlayer sp = (SpoutPlayer)event.getWhoClicked();
   
 
   
    if(event.getSlotType().name().equals("ARMOR")){
      if(event.getSlot() == 37){ //Hose
        if(event.getCursor().getTypeId() == 308  || event.getCursor().getTypeId() == 312 || event.getCursor().getTypeId() == 316){
          ConflictPlugin.armorLeggins.put(sp.getName(), 1);
        }else{
          ConflictPlugin.armorLeggins.put(sp.getName(), 0);
        }
      }
      if(event.getSlot() == 38){ //Brust
        if(event.getCursor().getTypeId() == 307  || event.getCursor().getTypeId() == 311 || event.getCursor().getTypeId() == 315){
          ConflictPlugin.armorPlate.put(sp.getName(), 1);
        }else{
          ConflictPlugin.armorPlate.put(sp.getName(), 0);
        }
      }
      ConflictPlugin.setPlayerWalkingSpeed(sp);
     
    }
View Full Code Here


  @EventHandler(priority = EventPriority.HIGH)
  public void onPlayerFightEvent(EntityDamageByEntityEvent event) {

    if (event.getEntity() instanceof SpoutPlayer) {
      SpoutPlayer player = (SpoutPlayer) event.getEntity();
     
   
      if (ConflictPlugin.skillFightArmor.get(player.getName()) > 1) { // Attack 2
        event.setDamage(event.getDamage() - 2);
      } else if (ConflictPlugin.skillFightArmor.get(player.getName()) > 0) { // Attack 1
        event.setDamage(event.getDamage() - 1);
      }
    } else {
      return;
    }

    if (event.getDamager() instanceof SpoutPlayer) {
      SpoutPlayer damagePlayer = (SpoutPlayer) event.getDamager();
     
      if(damagePlayer.getItemInHand().getTypeId() == 267 || damagePlayer.getItemInHand().getTypeId() == 268
         || damagePlayer.getItemInHand().getTypeId() == 272|| damagePlayer.getItemInHand().getTypeId() == 283) {  //Holz-, Stein, Gold, Eisenschwert
        event.setDamage(event.getDamage() - 2);
      }
     
      if(damagePlayer.getItemInHand().getTypeId() == 276) {  //Diamandschwert
        event.setDamage(event.getDamage() - 1);
      }
     
      if(damagePlayer.getItemInHand().getTypeId() == 258 || damagePlayer.getItemInHand().getTypeId() == 271
           || damagePlayer.getItemInHand().getTypeId() == 275|| damagePlayer.getItemInHand().getTypeId() == 279
           || damagePlayer.getItemInHand().getTypeId() == 286) {  //alle �xte
          event.setDamage(event.getDamage() - 1);
      }
     
      if(damagePlayer.getItemInHand().getTypeId() == 270 || damagePlayer.getItemInHand().getTypeId() == 274
           || damagePlayer.getItemInHand().getTypeId() == 285 ) {  //Holz- Gold- Steinhacke
          event.setDamage(event.getDamage() - 1);
      }
      if(damagePlayer.getItemInHand().getTypeId() == 257 || damagePlayer.getItemInHand().getTypeId() == 278) {//Eisen-Diamandhacke
          event.setDamage(event.getDamage() - 2);
      }
     
      if(damagePlayer.getItemInHand().getTypeId() == 256 || damagePlayer.getItemInHand().getTypeId() == 273) {//Stein-,Eisenschaufel
        event.setDamage(event.getDamage() - 1);
        }
      if(damagePlayer.getItemInHand().getTypeId() == 277 ) {//Diamandschaufel
        event.setDamage(event.getDamage() - 2);
        }
      if(damagePlayer.getItemInHand().getTypeId() == 261) {//Bogen
        event.setDamage(event.getDamage() - 1);
        }
     
     
      if (ConflictPlugin.skillFightDamage.get(damagePlayer.getName()) > 1) { // Damage 2
        event.setDamage(event.getDamage() + 2);
      } else if (ConflictPlugin.skillFightDamage.get(damagePlayer.getName()) > 0) { // Damage 1
        event.setDamage(event.getDamage() + 1);
      }

      if (event.getEntityType().equals(EntityType.CREEPER)
          || event.getEntityType().equals(EntityType.CAVE_SPIDER)
          || event.getEntityType().equals(EntityType.ENDERMAN)
          || event.getEntityType().equals(EntityType.SLIME)
          || event.getEntityType().equals(EntityType.SKELETON)
          || event.getEntityType().equals(EntityType.SPIDER) || event.getEntityType().equals(EntityType.WOLF)
          || event.getEntityType().equals(EntityType.ZOMBIE)) {

        if (ConflictPlugin.skillFightMonsters.get(damagePlayer.getName()) > 1) { // Damage vs Monsters 2
          event.setDamage(event.getDamage() + 2);
        } else if (ConflictPlugin.skillFightMonsters.get(damagePlayer.getName()) > 0) { // Damage vs Monsters 1
          event.setDamage(event.getDamage() + 1);
        }
      }

    }
View Full Code Here

  }

  @EventHandler(priority = EventPriority.HIGH)
  public void onCraftEvent(CraftItemEvent event) {

    SpoutPlayer player = (SpoutPlayer) event.getWhoClicked();
   
   
    //********** skillFoodBone ****************
    if ((event.getCurrentItem().getTypeId() == 351 && event.getCurrentItem().getData().getData() == 0xf)){ //Knochenmehl
      if(ConflictPlugin.skillFoodBone.get(player.getName())>0){
       
        event.getCurrentItem().setAmount(event.getCurrentItem().getAmount() +1);
        //player.getWorld().dropItem(player.getLocation(), new ItemStack(351));
      }
    }
    // falls Bogen/Waffen/R�stungen/Werkzeuge gecraftet
    int id = event.getCurrentItem().getTypeId();
   
    if ((id >= 256 && id <= 259) || id == 261 || (id >= 267 && id <= 279||
      (id >= 283 && id <= 286) || (id >= 290 && id <= 294|| (id >= 298 && id <= 317)) {

     
      //Shift-Click verbieten
      if(event.isShiftClick()){
        event.setCancelled(true);
        return;
      }

      // Daten holen
      //int id = event.getCurrentItem().getTypeId();
      Material mat = Material.getMaterial(id);
      short max = mat.getMaxDurability();

      if (ConflictPlugin.skillCraftQual.get(player.getName()) >= 2) {
        // voll
      } else if (ConflictPlugin.skillCraftQual.get(player.getName()) >= 1) {
        event.getCurrentItem().setDurability((short) (max / 4)); // 3/4 voll
      } else {
        event.getCurrentItem().setDurability((short) (max / 2)); // halb voll
      }

      // ****************** Werkzeuge Metall, Gold, Diamant ********************
      if (event.getCurrentItem().getTypeId() == 256 || event.getCurrentItem().getTypeId() == 257
          || event.getCurrentItem().getTypeId() == 258 || event.getCurrentItem().getTypeId() == 277
          || event.getCurrentItem().getTypeId() == 278 || event.getCurrentItem().getTypeId() == 279
          || event.getCurrentItem().getTypeId() == 284 || event.getCurrentItem().getTypeId() == 285
          || event.getCurrentItem().getTypeId() == 286 || event.getCurrentItem().getTypeId() == 292
          || event.getCurrentItem().getTypeId() == 293 || event.getCurrentItem().getTypeId() == 294) {

        switch (ConflictPlugin.skillCraftTool.get(player.getName())) {
        // nichts
        case 0:
          break;
        // 1x Lvl 1
        case 1:
          int n = generator.nextInt(3);
          switch (n) {
          case 0:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 1); // efficiency
            break;
          case 1:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 1); // unbreaking
            break;
          case 2:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 1); // fortune
            break;
          }
          break;
        // 2x Lvl 1
        case 2:
          n = generator.nextInt(3);
          switch (n) {
          case 0:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 1);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 1);
            break;
          case 1:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 1);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 1);
            break;
          case 2:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 1);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 1);
            break;
          }
          break;
        // 1x 2, 1x 1
        case 3:
          n = generator.nextInt(3);
          switch (n) {
          case 0:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 2);
            n = generator.nextInt(2);
            if (n == 0) {
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 1);
            } else {
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 1);
            }
            break;
          case 1:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 2);
            n = generator.nextInt(2);
            if (n == 0) {
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 1);
            } else {
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 1);
            }
            break;
          case 2:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 2);
            n = generator.nextInt(2);
            if (n == 0) {
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 1);
            } else {
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 1);
            }
            break;

          }
          break;

        // 2x 2, 1x 1
        case 4:
          n = generator.nextInt(3);
          switch (n) {
          case 0:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 1);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 2);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 2);
            break;
          case 1:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 2);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 1);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 2);
            break;
          case 2:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 2);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 2);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 1);
            break;

          }
          break;

        // 1x 3, 2x 1
        case 5:
          n = generator.nextInt(3);
          switch (n) {
          case 0:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 3);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 1);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 1);

            break;
          case 1:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 3);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 1);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 1);

            break;
          case 2:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 3);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 1);
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 1);

            break;

          }
          break;
        // 1x 3, 1x 2, 1x 1
        case 6:
          n = generator.nextInt(3);
          switch (n) {
          case 0:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 2);
            n = generator.nextInt(2);
            if (n == 0) {
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 2);
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 1);
            } else {
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 2);
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 1);
            }
            break;
          case 1:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 3);
            n = generator.nextInt(2);
            if (n == 0) {
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 2);
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 1);
            } else {
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 2);
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 1);
            }
            break;
          case 2:
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(35), 3);
            n = generator.nextInt(2);
            if (n == 0) {
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 2);
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 1);
            } else {
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(32), 2);
              event.getCurrentItem().addEnchantment(new EnchantmentWrapper(34), 1);
            }
            break;

          }
          break;
        }

      }

      // ****************** Bogen ********************

      if (event.getCurrentItem().getTypeId() == 261) {

        switch (ConflictPlugin.skillCraftBow.get(player.getName())) {

        case 1:
          int n = generator.nextInt(2);
          event.getCurrentItem().addEnchantment(new EnchantmentWrapper(48), 1); // Damage 1
          break;
        case 2:
          n = generator.nextInt(2);
          if (n == 0) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(48), 2); // Damage 2
          } else {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(49), 1); // Punch 1
          }
          break;
        case 3:
          n = generator.nextInt(2);
          event.getCurrentItem().addEnchantment(new EnchantmentWrapper(48), 2); // Damage 2
          if (n == 0) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(50), 1); // Flame
          } else {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(49), 1); // Punch 1
          }
          break;
        case 4:
          n = generator.nextInt(2);
          event.getCurrentItem().addEnchantment(new EnchantmentWrapper(48), 1); // Damage 1
          event.getCurrentItem().addEnchantment(new EnchantmentWrapper(50), 1); // Flame
          event.getCurrentItem().addEnchantment(new EnchantmentWrapper(49), 1); // Punch 1
          break;
        case 5:
          n = generator.nextInt(2);
          event.getCurrentItem().addEnchantment(new EnchantmentWrapper(48), 2); // Damage 2
          event.getCurrentItem().addEnchantment(new EnchantmentWrapper(50), 1); // Flame
          event.getCurrentItem().addEnchantment(new EnchantmentWrapper(49), 1); // Punch 1
          break;
        case 6:
          n = generator.nextInt(2);
          event.getCurrentItem().addEnchantment(new EnchantmentWrapper(48), 3); // Damage 3
          event.getCurrentItem().addEnchantment(new EnchantmentWrapper(50), 1); // Flame
          event.getCurrentItem().addEnchantment(new EnchantmentWrapper(49), 1); // Punch 1
          break;
        }
      }

      // ****************** Sword ********************

      if (event.getCurrentItem().getTypeId() == 267 || event.getCurrentItem().getTypeId() == 276
          || event.getCurrentItem().getTypeId() == 283) {

        switch (ConflictPlugin.skillCraftSword.get(player.getName())) {

        case 1:
          int n = generator.nextInt(4);
          if (n == 0) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(16), 1); // Damage 1
          } else if (n == 1) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(17), 1); // Undead 1
          } else if (n == 2) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(18), 1); // Arthropod 1
          } else {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(19), 1); // Punch 1
          }
          break;

        case 2:
          n = generator.nextInt(5);
          if (n == 0) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(16), 2); // Damage 2
          } else if (n == 1) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(17), 2); // Undead
          } else if (n == 2) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(18), 2); // Arth
          } else if (n == 3) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(19), 1); // Punch
          } else {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(20), 1); // fire
          }
          break;

        case 3:
          n = generator.nextInt(3);
          if (n == 0) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(16), 2); // Damage 2
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(19), 1); // Punch 1
          } else if (n == 1) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(16), 2); // Dam 2
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(20), 1); // Fire
          } else {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(19), 2); // Knock 2
          }
          break;

        case 4:
          n = generator.nextInt(3);
          if (n == 0) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(16), 3); // Damage 2

          } else if (n == 1) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(16), 2); // Dam 2
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(20), 1); // Fire
          } else {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(16), 2); // Damage 2
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(19), 1); // Knock 2
          }
          break;

        case 5:
          n = generator.nextInt(3);
          if (n == 0) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(16), 3); // Damage 2

          } else if (n == 1) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(16), 3); // Dam 2
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(20), 1); // Fire
          } else {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(16), 3); // Damage 2
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(19), 1); // Knock 2
          }
          break;
        case 6:
          n = generator.nextInt(3);
          if (n == 0) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(16), 3); // Damage 2

          } else if (n == 1) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(16), 3); // Dam 2
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(19), 1); // Knock
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(20), 1); // Fire
          } else {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(16), 3); // Damage 2
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(19), 1); // Knock
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(20), 1); // Fire
          }
          break;

        }

      }

      // ****************** Armor ********************

      if (event.getCurrentItem().getTypeId() >= 306 && event.getCurrentItem().getTypeId() <= 317) {

        switch (ConflictPlugin.skillCraftArmor.get(player.getName())) {
        case 1:
          int n = generator.nextInt(3);
          if (n == 0) {
            event.getCurrentItem().addEnchantment(new EnchantmentWrapper(0), 1);
          } else if (n == 1) {
View Full Code Here

  @EventHandler(priority = EventPriority.HIGH)
  public void onPlayerMoveEvent(PlayerMoveEvent event){
   
   
   
    SpoutPlayer player = (SpoutPlayer) event.getPlayer()
   
   
    //player.sendMessage(Double.toString(player.getJumpingMultiplier()));
    //player.sendMessage(Integer.toString(player.getBuildVersion()));
    //Rennen -> moved to...
    if (ConflictPlugin.skillFightSpeedLand.get(player.getName()) > 0){ //Rennen 1
      //player.setWalkingMultiplier(1.2);
    }
    if (ConflictPlugin.skillFightSpeedLand.get(player.getName()) > 1){ //Rennen 2
      //player.setWalkingMultiplier(1.4);
    }
   
    //Springen
    if (ConflictPlugin.skillFightJump.get(player.getName()) > 0){ //Springen
      //player.setJumpingMultiplier(1.5);
    }
   
   
    //Schwimmen
//    if (playerLocation.getBlock().getType().equals(Material.STATIONARY_WATER))
//    {
//     
      if (ConflictPlugin.skillFightSpeedWater.get(player.getName()) > 0){  //Schwimmen 1
//        Vector dir = player.getLocation().getDirection().normalize().multiply(1.5 - 1.6D);
//        Vector vec = new Vector(dir.getX(), dir.getY(), dir.getZ());
//        player.setVelocity(vec);
        player.setSwimmingMultiplier(0.1);
      }
      if (ConflictPlugin.skillFightSpeedWater.get(player.getName()) > 1){//Schwimmen 2
//        Vector dir = player.getLocation().getDirection().normalize().multiply(2.0 - 1.6D);
//        Vector vec = new Vector(dir.getX(), dir.getY(), dir.getZ());
//        player.setVelocity(vec);
        player.setSwimmingMultiplier(0.1);
      }
//    }
   
   
   
View Full Code Here

        Block b = (a.getLocation().add(0, -1, 0)).getBlock(); // block
                                    // drunter
        // wenn einer davon die untere H�lfte einer T�r ist
        if (a.getTypeId() == 64 || b.getTypeId() == 64 || a.getTypeId() == 71 || b.getTypeId() == 71) {

          SpoutPlayer p = (SpoutPlayer) event.getPlayer();
          BlockLocation aLoc = new BlockLocation(a.getLocation());
          BlockLocation bLoc = new BlockLocation(b.getLocation());

          for (BlockLocation bl : ConflictPlugin.doorsRed) {
            if (bl.equals(aLoc) || bl.equals(bLoc)) { // doors is red
              if (ConflictPlugin.playerIsInTeam(p).equals("red")) {
                p.sendMessage("Herzlich willkommen");
              } else {
                p.sendMessage("Du kommst da net rein!");

                if (DoorListener.isDoor(b.getType())) { // b = t�r -> b = untere H�lfte
                                    // ?
                  b.setData((byte) (b.getData() | 0x4)); // set data im unteren Teil
                } else {
                  a.setData((byte) (a.getData() | 0x4)); // (a ist untere H�lfte) set data im unteren Teil
                }
              }
            }
          }

          for (BlockLocation bl : ConflictPlugin.doorsBlue) {
            if (bl.equals(aLoc) || bl.equals(bLoc)) { // doors is blue
              if (ConflictPlugin.playerIsInTeam(p).equals("blue")) {
                p.sendMessage("Herzlich willkommen");
              } else {
                p.sendMessage("Du kommst da net rein!");
                if (DoorListener.isDoor(b.getType())) {
                  b.setData((byte) (b.getData() | 0x4));
                } else {
                  a.setData((byte) (a.getData() | 0x4));
                }
View Full Code Here

  }
 
  @EventHandler(priority = EventPriority.HIGH)
  public void onCraftEvent(CraftItemEvent event) {

    SpoutPlayer player = (SpoutPlayer) event.getWhoClicked();
   
   
    // falls Bogen/Waffen/R�stungen/Werkzeuge gecraftet
    int id = event.getCurrentItem().getTypeId();
   
    if ((id >= 256 && id <= 259) || id == 261 || id == 264 || id == 266 || (id >= 267 && id <= 279||
      (id >= 283 && id <= 286) || (id >= 290 && id <= 294|| (id >= 298 && id <= 317)) {     
     
      int ep=0;
     
      if (id == 264  || id==266 ){ //Gold oder Diamand
        ep = generator.nextInt(6)+5;
      }
     
      if (id == 268  || id==269 || id ==270 || id==271 || id==290){ //HOLZ
        ep = 1;
      }
      if (id == 298  || id==299 || id ==300 || id==301 ){ //Lederrr�stung
        ep = generator.nextInt(3)+2;
      }
      if (id == 272  || id==273 || id ==274 || id==275 || id==291){ //STEIN
        ep = generator.nextInt(3)+1;
      }
     
      if (id==261){ //Bogen
        ep = generator.nextInt(3)+2;
      }
     
      if (id == 267  || id==256 || id ==257 || id==258 || id==292){ //EISEN
        ep = generator.nextInt(4)+2;
      }
      if (id == 306  || id==307 || id ==308 || id==309){ //EISENR�stung
        ep = generator.nextInt(5)+4;
      }
     
      if (id == 283  || id==284 || id ==285 || id==286 || id==294){ //GOLD
        ep = generator.nextInt(4)+3;
      }
      if (id == 314  || id==315 || id ==316 || id==317){ //GOLDR�stung
        ep = generator.nextInt(6)+5;
      }
     
      if (id == 276  || id==277 || id ==278 || id==279 || id==293){ //Diamant
        ep = generator.nextInt(7)+6;
      }
      if (id == 310  || id==311 || id ==312 || id==313){ //DiamantR�stung
        ep = generator.nextInt(9)+8;
      }
     
      //Location l = player.getLocation().add(player.getLocation().getDirection().normalize().multiply(2));
      //((ExperienceOrb)player.getWorld().spawn( l, ExperienceOrb.class)).setExperience( ep );
     
      player.giveExp(ep);
     
      ConflictPlugin.totalCrafted.put(player.getName(), 1+ ConflictPlugin.totalCrafted.get(player.getName()));
    }
  }
View Full Code Here

     
  }
 
  @EventHandler(priority = EventPriority.HIGH)
  public void onPlayerKillEnderEvent(EntityDeathEvent event) {
    SpoutPlayer sp;

    if (null != event.getEntity().getKiller() && event.getEntity().getKiller() instanceof SpoutPlayer) {
      sp = (SpoutPlayer) event.getEntity().getKiller();
     
      if (event.getEntity().getType() == EntityType.ENDERMAN) {
        sp.giveExp(10);
      }
      if (event.getEntity().getType() == EntityType.ZOMBIE) {
        sp.giveExp(5);
      }
      if (event.getEntity().getType() == EntityType.SKELETON) {
        sp.giveExp(5);
      }
      if (event.getEntity().getType() == EntityType.SPIDER) {
        sp.giveExp(5);
      }
      if (event.getEntity().getType() == EntityType.CAVE_SPIDER) {
        sp.giveExp(5);
      }
      if (event.getEntity().getType() == EntityType.CREEPER) {
        sp.giveExp(5);
      }
      if (event.getEntity().getType() == EntityType.PIG_ZOMBIE) {
        sp.giveExp(5);
      }
      if (event.getEntity().getType() == EntityType.SLIME) {
        sp.giveExp(5);
      }
      if (event.getEntity().getType() == EntityType.WOLF) {
        sp.giveExp(5);
      }

    }

  }
View Full Code Here

    }
    @EventHandler(priority = EventPriority.HIGH)
    public void onButtonClick(ButtonClickEvent event){
  
        SpoutPlayer player = event.getPlayer();
       
        if(event.getButton().getText().equals("Team RED")){
            ConflictPlugin.playersRed.add(player);
            ConflictPlugin.playersBlue.remove(player);
            player.getMainScreen().closePopup();
            ConflictPlugin.updateTeamNames();
        }
        else if(event.getButton().getText().equals("Team BLUE")){
            ConflictPlugin.playersBlue.add(player);
            ConflictPlugin.playersRed.remove(player);
            player.getMainScreen().closePopup();
            ConflictPlugin.updateTeamNames();
        }
        //erst hier, da beim Join der Spoutplayer noch nciht korrekt initialisiert ist
        SkillScreenListener.updatePlayerValues(player);
       
View Full Code Here

   */
  @EventHandler(priority = EventPriority.HIGH)
    public void PlayerLogIn(PlayerJoinEvent event){
   
   
    SpoutPlayer sp = SpoutManager.getPlayer(event.getPlayer());
   
   
    ConflictPlugin.players.add(sp);
    plugin.initBaseLabels(sp);
    plugin.initAlarmLabels(sp);
    plugin.initEnemyBaseLabels(sp);
    plugin.initOwnBaseLabels(sp);
    plugin.initRedArrows(sp);
    plugin.initBlueArrows(sp);
    plugin.initDamageLabel(sp);
    plugin.initArtNumberLabel(sp);
   
 
   
   
     //beim reconnecten nicht skills und andere Container �berschreiben
    
    if(!ConflictPlugin.skillCraftQual.containsKey(sp.getName())){
     
      ConflictPlugin.damageTresholdForPlayer.put(sp.getName(), ConflictPlugin.damageTreshold);
     
      ConflictPlugin.skillCraftQual.put(sp.getName(), 0);
      ConflictPlugin.skillCraftArmor.put(sp.getName(), 0);
      ConflictPlugin.skillCraftBow.put(sp.getName(), 0);
      ConflictPlugin.skillCraftSword.put(sp.getName(), 0);
      ConflictPlugin.skillCraftTool.put(sp.getName(), 0);
     
      ConflictPlugin.skillMineClay.put(sp.getName(), 0);
      ConflictPlugin.skillMineDiamond.put(sp.getName(), 0);
      ConflictPlugin.skillMineDurab.put(sp.getName(), 0);
      ConflictPlugin.skillMineGold.put(sp.getName(), 0);
      ConflictPlugin.skillMineIron.put(sp.getName(), 0);
      ConflictPlugin.skillMineRedstone.put(sp.getName(), 0);
      ConflictPlugin.skillMineLapis.put(sp.getName(), 0);
     
      ConflictPlugin.skillFightMonsters.put(sp.getName(), 0);
      ConflictPlugin.skillFightCamp.put(sp.getName(), 0);
      ConflictPlugin.skillFightArmor.put(sp.getName(), 0);
      ConflictPlugin.skillFightDrop.put(sp.getName(), 0);
      ConflictPlugin.skillFightDamage.put(sp.getName(), 0);
      ConflictPlugin.skillFightJump.put(sp.getName(), 0);
      ConflictPlugin.skillFightRegeneration.put(sp.getName(), 0);
      ConflictPlugin.skillFightSpeedLand.put(sp.getName(), 0);
      ConflictPlugin.skillFightSpeedWater.put(sp.getName(), 0);
     
      ConflictPlugin.skillFoodBone.put(sp.getName(), 0);
      ConflictPlugin.skillFoodChicken.put(sp.getName(), 0);
      ConflictPlugin.skillFoodCow.put(sp.getName(), 0);
      ConflictPlugin.skillFoodFish.put(sp.getName(), 0);
      ConflictPlugin.skillFoodHarvest.put(sp.getName(), 0);
      ConflictPlugin.skillFoodPork.put(sp.getName(), 0);
      ConflictPlugin.skillFoodSeed.put(sp.getName(), 0);
     
      ConflictPlugin.armorPlate.put(sp.getName(), ConflictPlugin.playerHasHeavyArmorPlate(sp) ? 1:0);
      ConflictPlugin.armorLeggins.put(sp.getName(), ConflictPlugin.playerHasHeavyArmorLeggins(sp) ? 1:0);
     
     
      ConflictPlugin.totalXP.put(sp.getName(), 0);
     
      ConflictPlugin.totalSkills.put(sp.getName(), "");
     
      ConflictPlugin.totalAnimal.put(sp.getName(), 0);
      ConflictPlugin.totalArt1.put(sp.getName(), 0);
      ConflictPlugin.totalArt2.put(sp.getName(), 0);
      ConflictPlugin.totalCoal.put(sp.getName(), 0);
      ConflictPlugin.totalCrafted.put(sp.getName(), 0);
      ConflictPlugin.totalDiamond.put(sp.getName(), 0);
      ConflictPlugin.totalFish.put(sp.getName(), 0);
      ConflictPlugin.totalGiantMushroom.put(sp.getName(), 0);
      ConflictPlugin.totalGold.put(sp.getName(), 0);
      ConflictPlugin.totalIron.put(sp.getName(), 0);
      ConflictPlugin.totalLapis.put(sp.getName(), 0);
      ConflictPlugin.totalMobs.put(sp.getName(), 0);
      ConflictPlugin.totalMushroom.put(sp.getName(), 0);
      ConflictPlugin.totalRedstone.put(sp.getName(), 0);
      ConflictPlugin.totalWheat.put(sp.getName(), 0);
     
     
     
     
     
    }else{
     
      //**************moved to TeamChoiceScreenListener aus TimingGr�nden**************
     
     
//      if(ConflictPlugin.skillFightSpeedLand.get(sp.getName())>0){
//       
//        sp.setWalkingMultiplier(ConflictPlugin.skillRun1);
//      }
//      if(ConflictPlugin.skillFightSpeedLand.get(sp.getName())>1){
//       
//        sp.setWalkingMultiplier(ConflictPlugin.skillRun2);
//      }
//      if(ConflictPlugin.skillFightSpeedWater.get(sp.getName())>0){
//        sp.setSwimmingMultiplier(ConflictPlugin.skillSwim1);
//      }
//      if(ConflictPlugin.skillFightSpeedWater.get(sp.getName())>1){
//        sp.setSwimmingMultiplier(ConflictPlugin.skillSwim2);
//      }
//      if(ConflictPlugin.skillFightJump.get(sp.getName())>0){
//        sp.sendMessage(Integer.toString(sp.getBuildVersion()));
//        sp.setJumpingMultiplier(ConflictPlugin.skillJump);
//       
//      }
     
     
    }
   
    //sp.setBedSpawnLocation(new Location(Bukkit.getWorlds().get(0), ConflictPlugin.spawnX, ConflictPlugin.spawnY, ConflictPlugin.spawnZ));
   
    sp.sendMessage("Herzlich willkommen auf unserem Conflict-MC-Mod-Server!");
    sp.sendMessage("Infos zum Spiel gibt es unter &ctossat.de/mcwiki! &fGib");
    sp.sendMessage("&c/help &fein f�r eine Liste verf�gbarer Befehle. Viel Spass!");
   
    createOverlay(sp);
   
   
   
View Full Code Here

    this.plugin = plugin;
  }

  @EventHandler(priority = EventPriority.HIGH)
  public void onPlayerKillEnderEvent(EntityDeathEvent event) {
    SpoutPlayer sp;

    if (null != event.getEntity().getKiller() && event.getEntity().getKiller() instanceof SpoutPlayer) {
      sp = (SpoutPlayer) event.getEntity().getKiller();
     
     
     
      if (event.getEntity().getType() == EntityType.ENDERMAN) {
        if (ConflictPlugin.skillFightDrop.get(sp.getName()) > 0) {
          sp.getWorld().dropItem(sp.getLocation(), new ItemStack(368));
          event.getDrops().clear();
        }
        // Logging
        ConflictPlugin.totalMobs.put(sp.getName(), ConflictPlugin.totalMobs.get(sp.getName()) + 1);

      } else if (event.getEntity().getType() == EntityType.COW
          || event.getEntity().getType() == EntityType.CHICKEN
          || event.getEntity().getType() == EntityType.PIG || event.getEntity().getType() == EntityType.SHEEP) {
     
        // Logging
        ConflictPlugin.totalAnimal.put(sp.getName(), ConflictPlugin.totalAnimal.get(sp.getName()) + 1);
      }else{
        // Logging
        ConflictPlugin.totalMobs.put(sp.getName(), ConflictPlugin.totalMobs.get(sp.getName()) + 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.