Package org.spout.api.inventory

Examples of org.spout.api.inventory.ItemStack


    if (human.isSurvival()) {
      flags.add(PlayerFlags.SURVIVAL);
    } else {
      flags.add(PlayerFlags.CREATIVE);
    }
    ItemStack heldItem = PlayerUtil.getHeldSlot(session.getPlayer()).get();
    if (heldItem != null) {
      heldItem.getMaterial().getItemFlags(heldItem, flags);
    }
    if (!blockMaterial.destroy(block, flags, new PlayerBreakCause((Player) human.getOwner(), block))) {
      RepositionManager rm = session.getPlayer().getNetwork().getRepositionManager();
      session.send(new BlockChangeMessage(block, rm));
      Sign sign = block.get(Sign.class);
View Full Code Here


    getDrops().EXPLOSION.add(VanillaMaterials.EMERALD);
  }

  @Override
  public ItemStack getResult() {
    return new ItemStack(VanillaMaterials.EMERALD, 1);
  }
View Full Code Here

    getDrops().EXPLOSION.add(VanillaMaterials.REDSTONE_DUST, 4);
  }

  @Override
  public ItemStack getResult() {
    return new ItemStack(VanillaMaterials.REDSTONE_DUST, 1);
  }
View Full Code Here

  @Override
  public WindowSlotMessage decode(ByteBuf buffer) throws IOException {
    int id = buffer.readUnsignedByte();
    int slot = buffer.readUnsignedShort();
    ItemStack item = VanillaByteBufUtils.readItemStack(buffer);
    return new WindowSlotMessage(id, slot, item);
  }
View Full Code Here

    int id = buffer.readUnsignedByte();
    int slot = buffer.readUnsignedShort();
    byte button = buffer.readByte();
    int transaction = buffer.readUnsignedShort();
    byte mode = buffer.readByte();
    ItemStack item = VanillaByteBufUtils.readItemStack(buffer);
    return new WindowClickMessage(id, slot, button, transaction, mode, item);
  }
View Full Code Here

    // Spawn message
    messages.add(new PlayerSpawnMessage(id, human.getName(), x, y, z, r, p, item, getSpawnParameters(entity)));

    // Armor
    EntityInventory inventory = entity.get(EntityInventory.class);
    final ItemStack boots, leggings, chestplate, helmet, held;
    if (inventory == null) {
      boots = leggings = chestplate = helmet = held = null;
    } else {
      final ArmorInventory armor = inventory.getArmor();
      boots = armor.getBoots();
View Full Code Here

  @Override
  public EntityEquipmentMessage decode(ByteBuf buffer) throws IOException {
    int entityId = buffer.readInt();
    int slot = buffer.readUnsignedShort();
    ItemStack item = VanillaByteBufUtils.readItemStack(buffer);
    return new EntityEquipmentMessage(entityId, slot, item);
  }
View Full Code Here

    //TODO Headyaw

    messages.add(new EntityMobMessage(entityId, this.typeId, position, yaw, pitch, 0, (short) 0, (short) 0, (short) 0, parameters, rm));
    EntityInventory inventory = entity.get(EntityInventory.class);
    if (inventory != null) {
      final ItemStack held, boots, legs, chest, helm;
      held = inventory.getHeldItem();
      if (held != null) {
        messages.add(new EntityEquipmentMessage(entityId, EntityEquipmentMessage.HELD_SLOT, held));
      }
      boots = inventory.getArmor().getBoots();
View Full Code Here

    int x = buffer.readInt();
    int y = buffer.readUnsignedByte();
    int z = buffer.readInt();
    BlockFace direction = BlockFaces.BTEWNS.get(buffer.readUnsignedByte(), BlockFace.THIS);

    ItemStack heldItem = VanillaByteBufUtils.readItemStack(buffer);

    float dx = ((float) (buffer.readByte() & 0xFF)) / 16.0F;
    float dy = ((float) (buffer.readByte() & 0xFF)) / 16.0F;
    float dz = ((float) (buffer.readByte() & 0xFF)) / 16.0F;
View Full Code Here

    for (Player player : agent.getEntity().getWorld().getNearbyPlayers(agent.getEntity(), sensorRadius)) {
      QuickbarInventory quickbar = PlayerUtil.getQuickbar(player);
      if (quickbar == null) {
        continue;
      }
      ItemStack selectedItem = quickbar.getSelectedItem();
      if (selectedItem != null && material.equals(selectedItem.getMaterial())) {
        players.add(player);
      }
    }
    boolean found = players.size() > 0;
    state.put("hasNearbyMaterialHolders", found);
View Full Code Here

TOP

Related Classes of org.spout.api.inventory.ItemStack

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.