Импорт класса

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
Copy
import 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

Name: canPlaceItem

Return Type: boolean

ZenScript
Copy
Container.canPlaceItem(index as int, stack as ItemStack) as boolean
ПараметрТипОписание
Параметр
index
Тип
int
Описание
No Description Provided
Параметр
stack
Тип
ItemStack
Описание
No Description Provided

Name: countItem

Return Type: int

ZenScript
Copy
Container.countItem(item as ItemDefinition) as int
ПараметрТипОписание
Параметр
item
Тип
ItemDefinition
Описание
No Description Provided

Name: countStack

Return Type: int

ZenScript
Copy
Container.countStack(item as IItemStack) as int
ПараметрТипОписание
Параметр
item
Тип
IItemStack
Описание
No Description Provided

Link to getContainerSize

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
Copy
Container.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
Copy
Container.hasAnyOf(items as Set<ItemDefinition>) as boolean
ПараметрТипОписание
Параметр
items
Тип
Set<ItemDefinition>
Описание
No Description Provided

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
Copy
Container.removeItem(var1 as int, var2 as int) as ItemStack
ПараметрТипОписание
Параметр
var1
Тип
int
Описание
No Description Provided
Параметр
var2
Тип
int
Описание
No Description Provided

Link to removeItemNoUpdate

Name: removeItemNoUpdate

Return Type: ItemStack

ZenScript
Copy
Container.removeItemNoUpdate(index as int) as ItemStack
ПараметрТипОписание
Параметр
index
Тип
int
Описание
No Description Provided

Name: setChanged

Return Type: void

ZenScript
Copy
// Container.setChanged() as void

myContainer.setChanged();

Name: setItem

Return Type: void

ZenScript
Copy
Container.setItem(index as int, stack as ItemStack) as void
ПараметрТипОписание
Параметр
index
Тип
int
Описание
No Description Provided
Параметр
stack
Тип
ItemStack
Описание
No Description Provided

Name: startOpen

Return Type: void

ZenScript
Copy
Container.startOpen(player as Player) as void
ПараметрТипОписание
Параметр
player
Тип
Player
Описание
No Description Provided

Name: stillValid

Return Type: boolean

ZenScript
Copy
Container.stillValid(player as Player) as boolean
ПараметрТипОписание
Параметр
player
Тип
Player
Описание
No Description Provided

Name: stopOpen

Return Type: void

ZenScript
Copy
Container.stopOpen(player as Player) as void
ПараметрТипОписание
Параметр
player
Тип
Player
Описание
No Description Provided

Свойства

Link to свойства

НазваниеТипИмеет GetterИмеет SetterОписание
Название
changed
Тип
void
Имеет Getter
true
Имеет Setter
false
Описание
No Description Provided
Название
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
Описание
No Description Provided