ulvis.paste.net

Paste Search Dynamic
Recent pastes
suomicraftpe
  1.  
  2. package suomicraftpe;
  3.  
  4. import cn.nukkit.item.Item;
  5.  
  6. import java.util.ArrayList;
  7. import java.util.Collections;
  8. import java.util.HashMap;
  9. import java.util.Map;
  10.  
  11. /**
  12.  * SuomiCraft PE Core
  13.  * Created by PetteriM1 for SuomiCraft PE Network
  14.  */
  15. public class InventoryStore {
  16.  
  17.     private int xp;
  18.     private int xpLevel;
  19.     private int food;
  20.     private ArrayList<Item[]> armor = new ArrayList<>();
  21.     private Map<Integer, Item> inventory = new HashMap<>();
  22.  
  23.     public InventoryStore(Map<Integer, Item> contents, Item[] armorContents, int xp, int xpLevel, int food) {
  24.         this.inventory = contents;
  25.         this.armor.add(armorContents);
  26.         this.xp = xp;
  27.         this.xpLevel = xpLevel;
  28.         this.food = food;
  29.     }
  30.  
  31.     public Map<Integer, Item> getInventory() {
  32.         return collections.unmodifiableMap(inventory);
  33.     }
  34.  
  35.     public void setInventory(Map<Integer, Item> inventory) {
  36.         inventory.entrySet().stream().foreach((ev) -> {
  37.             this.inventory.put(ev.getKey(), ev.getValue());
  38.         });
  39.     }
  40.  
  41.     public ArrayList<Item[]> getArmor() {
  42.         return armor;
  43.     }
  44.  
  45.     public void setArmor(Item[] armor) {
  46.         this.armor.add(armor);
  47.     }
  48.  
  49.     public int getXp() {
  50.         return xp;
  51.     }
  52.  
  53.     public void setXp(int xp) {
  54.         this.xp = xp;
  55.     }
  56.  
  57.     public int getXpLevel() {
  58.         return xpLevel;
  59.     }
  60.  
  61.     public void setXpLevel(int level) {
  62.         this.xpLevel = level;
  63.     }
  64.  
  65.     public int getFood() {
  66.         return food;
  67.     }
  68.  
  69.     public void setFood(int food) {
  70.         this.food = food;
  71.     }
  72. }
Parsed in 0.017 seconds