Class PlayerBackpack
- java.lang.Object
-
- io.github.thebusybiscuit.slimefun4.api.player.PlayerBackpack
-
public class PlayerBackpack extends Object
This class represents the instance of aSlimefunBackpack
that is ready to be opened. It holds an actualInventory
and represents the backpack on the level of an individualItemStack
as opposed to the classSlimefunBackpack
.- Author:
- TheBusyBiscuit
- See Also:
SlimefunBackpack
,BackpackListener
-
-
Constructor Summary
Constructors Constructor Description PlayerBackpack(PlayerProfile profile, int id)
This constructor loads an existing BackpackPlayerBackpack(PlayerProfile profile, int id, int size)
This constructor creates a new Backpack
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getID()
Inventory
getInventory()
int
getSize()
void
markDirty()
This method marks the backpack dirty, it will then be queued for an autosave usingsave()
void
open(Player... players)
void
save()
This method will save the contents of this backpack to aFile
.void
setSize(int size)
This will change the current size of this Backpack to the specified size.
-
-
-
Constructor Detail
-
PlayerBackpack
public PlayerBackpack(PlayerProfile profile, int id)
This constructor loads an existing Backpack- Parameters:
profile
- ThePlayerProfile
of this Backpackid
- The id of this Backpack
-
PlayerBackpack
public PlayerBackpack(PlayerProfile profile, int id, int size)
This constructor creates a new Backpack- Parameters:
profile
- ThePlayerProfile
of this Backpackid
- The id of this Backpacksize
- The size of this Backpack
-
-
Method Detail
-
getID
public int getID()
-
getSize
public int getSize()
-
getInventory
public Inventory getInventory()
-
open
public void open(Player... players)
- Parameters:
players
- The players who this Backpack will be shown to
-
setSize
public void setSize(int size)
This will change the current size of this Backpack to the specified size.- Parameters:
size
- The new size for this Backpack
-
save
public void save()
This method will save the contents of this backpack to aFile
.
-
markDirty
public void markDirty()
This method marks the backpack dirty, it will then be queued for an autosave usingsave()
-
-