Package com.sk89q.worldedit.blocks

Examples of com.sk89q.worldedit.blocks.BaseItemStack


    }

    @Override
    public void simulateBlockMine(Vector pt) {
        BaseBlock block = getLazyBlock(pt);
        BaseItemStack stack = BlockType.getBlockDrop(block.getId(), (short) block.getData());

        if (stack != null) {
            final int amount = stack.getAmount();
            if (amount > 1) {
                dropItem(pt, new BaseItemStack(stack.getType(), 1, stack.getData()), amount);
            } else {
                dropItem(pt, stack, amount);
            }
        }
View Full Code Here


      TileEntity tile = world.getBlockTileEntity(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
      if (tile == null) {
         return null;
      }
      if (tile instanceof IInventory) {
         BaseItemStack items[] = new BaseItemStack[((IInventory)tile).getSizeInventory()];
         for (int i = 0; i < items.length; i++) {
            ItemStack item = ((IInventory)tile).getStackInSlot(i);
            if (item != null) {
               items[i] = new BaseItemStack(item.itemID, item.stackSize, (short)item.getItemDamage());
            }
         }
         return items;
      }
      return null;
View Full Code Here

   /**
    * @see com.sk89q.worldedit.LocalPlayer#giveItem(int, int)
    */
   @Override
   public void giveItem(int type, int qty) {
      BaseItemStack item = new BaseItemStack(type, qty);
      getWorld().dropItem(getPosition(), item);
   }
View Full Code Here

TOP

Related Classes of com.sk89q.worldedit.blocks.BaseItemStack

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.