Container
Link to container
Импорт класса
Link to импорт-класса
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.world.Container;
Implemented Interfaces
Link to implemented-interfaces
Container implements the following interfaces. That means all methods defined in these interfaces are also available in Container
Методы
Link to методы
Name: canPlaceItem
Return Type: boolean
ZenScript CopyContainer.canPlaceItem(index as int, stack as ItemStack) as boolean
Параметр | Тип |
---|---|
Параметр index | Тип int |
Параметр stack | Тип ItemStack |
Name: countItem
Return Type: int
ZenScript CopyContainer.countItem(item as ItemDefinition) as int
Параметр | Тип |
---|---|
Параметр item | Тип ItemDefinition |
Name: countStack
Return Type: int
ZenScript CopyContainer.countStack(item as IItemStack) as int
Параметр | Тип |
---|---|
Параметр item | Тип IItemStack |
Name: getContainerSize
Gets the size (how many slots) of this Container
Returns: The amount of slots this Container has.
Return Type: int
ZenScript Copy// Container.getContainerSize() as int
myContainer.getContainerSize();
Name: getItem
Gets the ItemStack in the given slot.
Returns: the ItemStack in the given slot.
Return Type: ItemStack
ZenScript CopyContainer.getItem(index as int) as ItemStack
Параметр | Тип | Описание |
---|---|---|
Параметр index | Тип int | Описание The slot index to get. |
Name: getMaxStackSize
Return Type: int
ZenScript Copy// Container.getMaxStackSize() as int
myContainer.getMaxStackSize();
Name: hasAnyOf
Return Type: boolean
ZenScript CopyContainer.hasAnyOf(items as Set<ItemDefinition>) as boolean
Параметр | Тип |
---|---|
Параметр items | Тип Set<ItemDefinition> |
Name: isEmpty
Checks if this Container is empty.
Returns: True if empty. False otherwise.
Return Type: boolean
ZenScript Copy// Container.isEmpty() as boolean
myContainer.isEmpty();
Name: removeItem
Return Type: ItemStack
ZenScript CopyContainer.removeItem(var1 as int, var2 as int) as ItemStack
Параметр | Тип |
---|---|
Параметр var1 | Тип int |
Параметр var2 | Тип int |
Name: removeItemNoUpdate
Return Type: ItemStack
ZenScript CopyContainer.removeItemNoUpdate(index as int) as ItemStack
Параметр | Тип |
---|---|
Параметр index | Тип int |
Name: setChanged
ZenScript Copy// Container.setChanged()
myContainer.setChanged();
Name: setItem
ZenScript CopyContainer.setItem(index as int, stack as ItemStack)
Параметр | Тип |
---|---|
Параметр index | Тип int |
Параметр stack | Тип ItemStack |
Name: startOpen
ZenScript CopyContainer.startOpen(player as Player)
Параметр | Тип |
---|---|
Параметр player | Тип Player |
Name: stillValid
Return Type: boolean
ZenScript CopyContainer.stillValid(player as Player) as boolean
Параметр | Тип |
---|---|
Параметр player | Тип Player |
Name: stopOpen
ZenScript CopyContainer.stopOpen(player as Player)
Параметр | Тип |
---|---|
Параметр player | Тип Player |
Свойства
Link to свойства
Название | Тип | Имеет Getter | Имеет Setter | Описание |
---|---|---|---|---|
Название changed | Тип void | Имеет Getter true | Имеет Setter false | Описание |
Название containerSize | Тип int | Имеет Getter true | Имеет Setter false | Описание Gets the size (how many slots) of this Container |
Название isEmpty | Тип boolean | Имеет Getter true | Имеет Setter false | Описание Checks if this Container is empty. |
Название maxStackSize | Тип int | Имеет Getter true | Имеет Setter false | Описание |