Package org.spout.vanilla.component.entity.inventory

Examples of org.spout.vanilla.component.entity.inventory.PlayerInventory


  public void onTick(float dt) {
    for (Entity entity : getNearbyEntities()) {
      Item item = entity.get(Item.class);
      if (item != null && item.canBeCollected()) {
        getOwner().getNetwork().callProtocolEvent(new EntityCollectItemEvent(getOwner(), entity));
        PlayerInventory inv = getOwner().get(PlayerInventory.class);
        if (inv != null) {
          inv.add(item.getItemStack());
        }
        entity.remove();
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.spout.vanilla.component.entity.inventory.PlayerInventory

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.