public class PlayerBackpack
extends java.lang.Object
SlimefunBackpack
that is ready to
be opened.
It holds an actual Inventory
and represents the backpack on the
level of an individualItemStack
as opposed to the class SlimefunBackpack
.SlimefunBackpack
,
BackpackListener
Constructor and Description |
---|
PlayerBackpack(PlayerProfile profile,
int id)
This constructor loads an existing Backpack
|
PlayerBackpack(PlayerProfile profile,
int id,
int size)
This constructor creates a new Backpack
|
Modifier and Type | Method and Description |
---|---|
int |
getID() |
Inventory |
getInventory() |
int |
getSize() |
void |
markDirty()
This method marks the backpack dirty, it will then be queued for an autosave
using
save() |
void |
open(Player... players)
|
void |
save()
This method will save the contents of this backpack to a
File . |
void |
setSize(int size)
This will change the current size of this Backpack to the specified size.
|
public PlayerBackpack(PlayerProfile profile, int id)
profile
- The PlayerProfile
of this Backpackid
- The id of this Backpackpublic PlayerBackpack(PlayerProfile profile, int id, int size)
profile
- The PlayerProfile
of this Backpackid
- The id of this Backpacksize
- The size of this Backpackpublic int getID()
public int getSize()
public Inventory getInventory()
public void open(Player... players)
players
- The players who this Backpack will be shown topublic void setSize(int size)
size
- The new size for this Backpackpublic void save()
File
.public void markDirty()
save()