Package org.getspout.spoutapi.inventory

Examples of org.getspout.spoutapi.inventory.SpoutItemStack


    totalArt1 = new HashMap<String, Integer>();
    totalArt2 = new HashMap<String, Integer>();

    // leerer Drop
   
    drops[0] = new SpoutItemStack(363, 3, (short) 0);
    drops[1] = new SpoutItemStack(365, 3, (short) 0);
    drops[2] = new SpoutItemStack(319, 3, (short) 0);
    drops[3] = new SpoutItemStack(360, 5, (short) 0);
    drops[4] = new SpoutItemStack(297, 3, (short) 0);
    drops[5] = new SpoutItemStack(351, 5, (short) 4);
    drops[6] = new SpoutItemStack(266, 1, (short) 0);
    drops[7] = new SpoutItemStack(357, 3, (short) 0);
    drops[8] = new SpoutItemStack(264, 1, (short) 0);

    damageTresholdForPlayer = new HashMap<String, Integer>();

   
   
View Full Code Here


    if (commandName.equals("bbr")) {
      if (ConflictPlugin.allowBBR) {
        Player player = (Player) sender;

        if (ConflictPlugin.playersRed.contains((SpoutPlayer) player)) {
          player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.baseBlockRed, 1));
          ConflictPlugin.allowBBR = false; // nur 1x
          Bukkit.getServer()
              .broadcastMessage("Spieler &c" + player.getName() + " &fhat den roten BaseBlock!");
        } else {
          sender.sendMessage(ChatColor.RED
              + "Du musst im roten Team sein um diesen Befehl ausf�hren zu k�nnen!");
        }

      } else {
        sender.sendMessage(ChatColor.RED + "Roter BaseBlock wurde bereits verteilt!");
      }
      return true;
    }

    // BaseBlockBlue
    if (commandName.equals("bbb")) {
      if (ConflictPlugin.allowBBB) {
        Player player = (Player) sender;
        if (ConflictPlugin.playersBlue.contains((SpoutPlayer) player)) {
          player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.baseBlockBlue, 1));
          ConflictPlugin.allowBBB = false; // nur 1x
          Bukkit.getServer().broadcastMessage(
              "Spieler &1" + player.getName() + " &fhat den blauen BaseBlock!");
        } else {
          sender.sendMessage(ChatColor.RED
              + "Du musst im blauen Team sein um diesen Befehl ausf�hren zu k�nnen!");
        }

      } else {
        sender.sendMessage(ChatColor.RED + "Blauer BaseBlock wurde bereits verteilt!");
      }
      return true;
    }

    // Artefakt Stufe 1
    if (commandName.equals("art")) {
      try {
        Player player = (Player) sender;
        int a = Integer.parseInt(args[0]);
        int b = Integer.parseInt(args[1]);
        int amount = Integer.parseInt(args[2]);
        switch (a) {
        case 1:
          player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.artifact1Grow.get(b), amount));
          Bukkit.getServer().broadcastMessage(
              "Spieler &c" + player.getName() + " &fhat sich einen ArtefaktBlock ercheatet!");
          break;
        case 2:
          player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.artifact2Grow.get(b), amount));
          Bukkit.getServer().broadcastMessage(
              "Spieler &c" + player.getName() + " &fhat sich einen ArtefaktBlock ercheatet!");
          break;
        case 3:
          player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.artifact3Grow.get(b), amount));
          Bukkit.getServer().broadcastMessage(
              "Spieler &c" + player.getName() + " &fhat sich einen ArtefaktBlock ercheatet!");
          break;
        }

      } catch (Exception e) {
        sender.sendMessage(ChatColor.RED + "Invalid arguments");
      }
    }

    // basedef Bl�cke generieren
    if (commandName.equals("basedef")) {
      try {
        Player player = (Player) sender;
        int a = Integer.parseInt(args[0]);
        int amount = Integer.parseInt(args[1]);
        switch (a) {
        case 1:
          player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.defenseTower, amount));
          Bukkit.getServer().broadcastMessage(
              "Spieler &c" + player.getName() + " &fhat sich einen DefenseTower ercheatet!");
          break;
        case 2:
          player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.damageTower, amount));
          Bukkit.getServer().broadcastMessage(
              "Spieler &c" + player.getName() + " &fhat sich einen DamageTower ercheatet!");
          break;
        case 3:
          player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.radarTower, amount));
          Bukkit.getServer().broadcastMessage(
              "Spieler &c" + player.getName() + " &fhat sich einen RadarTower ercheatet!");
          break;
        }

      } catch (Exception e) {
        sender.sendMessage(ChatColor.RED + "Invalid arguments");
      }
    }

    // generiere VuduBrick
    if (commandName.equals("vb")) {
      try {
        Player player = (Player) sender;
        int amount = Integer.parseInt(args[0]);
        player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.vuduBrick, amount));

      } catch (Exception e) {
        sender.sendMessage(ChatColor.RED + "Invalid arguments");
      }
    }
View Full Code Here

        this.timeForGrow=1000*ConflictPlugin.blockGrowTime;
        ConflictPlugin.allArtifacts.add(this);
        this.timestamps = new ConcurrentHashMap<BlockLocation, Long>(20);
        //dropt Blume, wenn vor Level 5 abgebaut
        if(this.grow<5){
          this.setItemDrop(new SpoutItemStack(37, 0, (short) 0));
        }
       
    }
View Full Code Here

        ConflictPlugin.timestampOverflows.remove(bll);
       
        if(null!= this.dontPlace){
          BlockLocation bl = new BlockLocation(world.getName(),x,y,z);
          if(this.dontPlace.equals(bl)){
            SpoutItemStack temp = new SpoutItemStack(new SpoutItemStack(37, 0, (short) 0));
            if(this.stage==1){
              temp = new SpoutItemStack(ConflictPlugin.art_1_5);
            }
            if(this.stage==2){
              temp = new SpoutItemStack(ConflictPlugin.art_2_5);
            }
            if(this.stage==3){
              temp = new SpoutItemStack(ConflictPlugin.art_3_5);
            }
           
            world.getBlockAt(x, y, z).breakNaturally(ConflictPlugin.drops[0]);
            world.dropItem(world.getBlockAt(x, y, z).getLocation(), temp);
            onBlockDestroyed(world, x, y, z);
View Full Code Here

     */
    public static void addRecipes(){
     
     
      //Artefakt Stufe 1
      ItemStack result_1_1 = new SpoutItemStack(ConflictPlugin.art_1_1, 1);
        SpoutShapedRecipe recipe_1_1 = new SpoutShapedRecipe(result_1_1);
        recipe_1_1.shape("TFT", "RSB", "III");
        recipe_1_1.setIngredient('I', MaterialData.ironIngot);
        recipe_1_1.setIngredient('R', MaterialData.rottenFlesh);
        recipe_1_1.setIngredient('S', MaterialData.spiderEye);
        recipe_1_1.setIngredient('B', MaterialData.bone);
        recipe_1_1.setIngredient('F', MaterialData.rawFish);
        recipe_1_1.setIngredient('T', MaterialData.inkSac);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_1_1);
       
        //Artefakt Stufe 2
      ItemStack result_2_1 = new SpoutItemStack(ConflictPlugin.art_2_1, 1);
        SpoutShapedRecipe recipe_2_1 = new SpoutShapedRecipe(result_2_1);
        recipe_2_1.shape("   ", "GTC", "A A");
        recipe_2_1.setIngredient('C', MaterialData.cake);
        recipe_2_1.setIngredient('T', MaterialData.tnt);
        recipe_2_1.setIngredient('G', MaterialData.goldenApple);
        recipe_2_1.setIngredient('A', ConflictPlugin.art_1_5);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_2_1);
       
       //Artefakt Stufe 3
      ItemStack result_3_1 = new SpoutItemStack(ConflictPlugin.art_3_1, 1);
        SpoutShapedRecipe recipe_3_1 = new SpoutShapedRecipe(result_3_1);
        recipe_3_1.shape("LGL", "ODO", "A A");
        recipe_3_1.setIngredient('G', MaterialData.ghastTear);
        recipe_3_1.setIngredient('L', MaterialData.lapisBlock);
        recipe_3_1.setIngredient('D', MaterialData.diamondBlock);
        recipe_3_1.setIngredient('O', MaterialData.goldBlock);
        recipe_3_1.setIngredient('A', ConflictPlugin.art_2_5);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_3_1);
       
        //VuduBrick
        ItemStack result_VuduBrick = new SpoutItemStack(ConflictPlugin.vuduBrick, 4);
        SpoutShapedRecipe recipe_VB = new SpoutShapedRecipe(result_VuduBrick);
        recipe_VB.shape("S S", " I ", "S S");
        recipe_VB.setIngredient('S', MaterialData.stone);
        recipe_VB.setIngredient('I', MaterialData.brick);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_VB);
       
        //DamageTowerBlock
        ItemStack result_DamageTower = new SpoutItemStack(ConflictPlugin.damageTower, 1);
        SpoutShapedRecipe recipe_DT = new SpoutShapedRecipe(result_DamageTower);
        recipe_DT.shape("GGG", "DED", " A ");
        recipe_DT.setIngredient('G', MaterialData.goldSword);
        recipe_DT.setIngredient('D', MaterialData.dispenser);
        recipe_DT.setIngredient('E', MaterialData.enderPearl);
        recipe_DT.setIngredient('A', ConflictPlugin.art_1_5);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_DT);
       
        //DefenseTowerBlock
        ItemStack result_DefenseTower = new SpoutItemStack(ConflictPlugin.defenseTower, 1);
        SpoutShapedRecipe recipe_DeT = new SpoutShapedRecipe(result_DefenseTower);
        recipe_DeT.shape(" G ", "RER", " A ");
        recipe_DeT.setIngredient('G', MaterialData.goldHelmet);
        recipe_DeT.setIngredient('R', MaterialData.redstoneRepeater);
        recipe_DeT.setIngredient('E', MaterialData.enderPearl);
        recipe_DeT.setIngredient('A', ConflictPlugin.art_1_5);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_DeT);
     
        //RadarTowerBlock
        ItemStack result_RadarTower = new SpoutItemStack(ConflictPlugin.radarTower, 1);
        SpoutShapedRecipe recipe_RT = new SpoutShapedRecipe(result_RadarTower);
        recipe_RT.shape(" C ", " E ", " A ");
        recipe_RT.setIngredient('C', MaterialData.compass);
        recipe_RT.setIngredient('E', MaterialData.enderPearl);
        recipe_RT.setIngredient('A', ConflictPlugin.art_1_5);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_RT);
       
       
        //ChainMail
        //Helm
        ItemStack result_chainHelm = new SpoutItemStack(302);
        SpoutShapedRecipe recipe_chainHelm = new SpoutShapedRecipe(result_chainHelm);
        recipe_chainHelm.shape("RRR", "RLR", "   ");
        recipe_chainHelm.setIngredient('R', MaterialData.redstone);
        recipe_chainHelm.setIngredient('L', MaterialData.lavaBucket);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_chainHelm);
       
        //Plate
        ItemStack result_chainPlate = new SpoutItemStack(303);
        SpoutShapedRecipe recipe_chainPlate= new SpoutShapedRecipe(result_chainPlate);
        recipe_chainPlate.shape("RLR", "RLR", "RRR");
        recipe_chainPlate.setIngredient('R', MaterialData.redstone);
        recipe_chainPlate.setIngredient('L', MaterialData.lavaBucket);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_chainPlate);

       
        //Leggins
        ItemStack result_chainLeggins = new SpoutItemStack(304);
        SpoutShapedRecipe recipe_chainLeggins = new SpoutShapedRecipe(result_chainLeggins);
        recipe_chainLeggins.shape("RRR", "RLR", "R R");
        recipe_chainLeggins.setIngredient('R', MaterialData.redstone);
        recipe_chainLeggins.setIngredient('L', MaterialData.lavaBucket);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_chainLeggins);

       
        //Shoes
        ItemStack result_chainShoes = new SpoutItemStack(305);
        SpoutShapedRecipe recipe_chainShoes = new SpoutShapedRecipe(result_chainShoes);
        recipe_chainShoes.shape("   ", "RLR", "R R");
        recipe_chainShoes.setIngredient('R', MaterialData.redstone);
        recipe_chainShoes.setIngredient('L', MaterialData.lavaBucket);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_chainShoes);

       
       
       
        //Converter ERZ+Redstone -> Diamant
        SpoutShapedRecipe recipe_diam1 = new SpoutShapedRecipe(new SpoutItemStack(MaterialData.diamond, 1));
        recipe_diam1.shape(" I ", "RRR", "RRR");
        recipe_diam1.setIngredient('R', MaterialData.redstone);
        recipe_diam1.setIngredient('I', MaterialData.ironBlock);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_diam1);
       
        SpoutShapedRecipe recipe_diam2 = new SpoutShapedRecipe(new SpoutItemStack(MaterialData.diamond, 1));
        recipe_diam2.shape(" L ", "RRR", "RRR");
        recipe_diam2.setIngredient('R', MaterialData.redstone);
        recipe_diam2.setIngredient('L', MaterialData.lapisBlock);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_diam2);
       
        SpoutShapedRecipe recipe_diam3 = new SpoutShapedRecipe(new SpoutItemStack(MaterialData.diamond, 1));
        recipe_diam3.shape(" I ", " L ", "   ");
        recipe_diam3.setIngredient('I', MaterialData.ironBlock);
        recipe_diam3.setIngredient('L', MaterialData.lapisBlock);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_diam3);
       
        //Converter ERZ+Redstone -> Gold
        SpoutShapedRecipe recipe_gold1 = new SpoutShapedRecipe(new SpoutItemStack(MaterialData.goldIngot, 1));
        recipe_gold1.shape("III", "III", "RRR");
        recipe_gold1.setIngredient('R', MaterialData.redstone);
        recipe_gold1.setIngredient('I', MaterialData.ironIngot);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_gold1);
       
        SpoutShapedRecipe recipe_gold2 = new SpoutShapedRecipe(new SpoutItemStack(MaterialData.goldIngot, 1));
        recipe_gold2.shape("LLL", "LLL", "RRR");
        recipe_gold2.setIngredient('R', MaterialData.redstone);
        recipe_gold2.setIngredient('L', MaterialData.lapisLazuli);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_gold2);
       
        SpoutShapedRecipe recipe_gold3 = new SpoutShapedRecipe(new SpoutItemStack(MaterialData.goldIngot, 1));
        recipe_gold3.shape("III", "LIL", "LLL");
        recipe_gold3.setIngredient('I', MaterialData.ironIngot);
        recipe_gold3.setIngredient('L', MaterialData.lapisLazuli);
        SpoutManager.getMaterialManager().registerSpoutRecipe(recipe_gold3);
    }
View Full Code Here

    }
  }

  @EventHandler(priority = EventPriority.LOWEST)
  public void onPlayerDrop(PlayerDropItemEvent e) {
    SpoutItemStack sis = new SpoutItemStack(e.getItemDrop().getItemStack());
    if (!sis.containsEnchantment(SpoutEnchantment.UNSTACKABLE) && sis.isCustomItem()) {
      CustomItem ci = (CustomItem)sis.getMaterial();
      if (!ci.isStackable()) {
        sis.addEnchantment(SpoutEnchantment.UNSTACKABLE, 1000);
      }
    }
    e.getItemDrop().setItemStack(sis);
  }
View Full Code Here

      org.getspout.spoutapi.material.CustomBlock block = getCustomBlock(world, x, y, z);
      if (block != null) {
        if (block instanceof org.getspout.spoutapi.material.CustomBlock) {
          SpoutPlayer player = (SpoutPlayer) human.getBukkitEntity();
          float def;
          SpoutItemStack inHand = player.getItemInHand() == null ? null : new SpoutItemStack(player.getItemInHand());
          org.getspout.spoutapi.material.Material item = inHand.getMaterial();

          float hardness = block.getHardness();
          if (hardness <= 0F) {
            return m.invoke(wrapped, args);
          }
View Full Code Here

    e.getItemDrop().setItemStack(sis);
  }

  @EventHandler(priority = EventPriority.LOWEST)
  public void onPlayerPickupItem(PlayerPickupItemEvent e) {
    SpoutItemStack sis = new SpoutItemStack(e.getItem().getItemStack());
    if (!sis.containsEnchantment(SpoutEnchantment.UNSTACKABLE) && sis.isCustomItem()) {
      CustomItem ci = (CustomItem)sis.getMaterial();
      if (!ci.isStackable()) {
        sis.addEnchantment(SpoutEnchantment.UNSTACKABLE, 1000);
      }
    }
    e.getItem().setItemStack(sis);
  }
View Full Code Here

    if (m instanceof CustomItem) {
      if (!((CustomItem) m).isStackable() && e.isShiftClick()) {
        e.setCancelled(true); // Shift clicking causes... issues with unstackable Spout items.
      }
    }
    e.setCurrentItem(new SpoutItemStack(res)); // Handle enchantments and stuff.
  }
View Full Code Here

  @Override
  public SpoutItemStack toItemStack(int amount) {
    int type = getTypeId();
    int data = getBlockType().hasSubtypes() ? getData() : 0;
    return new SpoutItemStack(type, amount, (short) data, null);
  }
View Full Code Here

TOP

Related Classes of org.getspout.spoutapi.inventory.SpoutItemStack

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.