Class SimpleContainer
java.lang.Object
fr.fidorial.inventory.SimpleContainer
- All Implemented Interfaces:
Container
- Direct Known Subclasses:
EnderChestInventory, PlayerInventory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Empties every slot.contents()Returns a copy of every slot, in index order.get(int slot) Gets the contents of a slot.booleanisEmpty()Returnstrueif every slot is empty.voidReplaces the contents of a slot.final intsize()Returns the number of slots exposed by this container.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Container
firstEmpty, setContents
-
Constructor Details
-
SimpleContainer
protected SimpleContainer(int size) Creates an empty container.- Parameters:
size- the number of slots- Throws:
IllegalArgumentException- ifsizeis negative- Since:
- 0.1.0
-
-
Method Details
-
size
-
get
Description copied from interface:ContainerGets the contents of a slot.- Specified by:
getin interfaceContainer- Parameters:
slot- the slot index, from0tosize() - 1- Returns:
- the stack in the slot,
ItemStack.EMPTYwhen it is empty
-
set
-
clear
-
isEmpty
-
contents
-