Container
Link to container
Importare la Classe
Link to importare-la-classe
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;
Interfacce Implementate
Link to interfacce-implementate
Container implements the following interfaces. That means all methods defined in these interfaces are also available in Container
Metodi
Link to metodi
Name: canPlaceItem
Return Type: boolean
ZenScript CopyContainer.canPlaceItem(index as int, stack as ItemStack) as boolean
Parametro | Tipo | Descrizione |
---|---|---|
Parametro indice | Tipo int | Descrizione No Description Provided |
Parametro stack | Tipo ItemStack | Descrizione No Description Provided |
Name: countItem
Return Type: int
ZenScript CopyContainer.countItem(item as ItemDefinition) as int
Parametro | Tipo | Descrizione |
---|---|---|
Parametro item | Tipo ItemDefinition | Descrizione No Description Provided |
Name: countStack
Return Type: int
ZenScript CopyContainer.countStack(item as IItemStack) as int
Parametro | Tipo | Descrizione |
---|---|---|
Parametro item | Tipo IItemStack | Descrizione No Description Provided |
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
Parametro | Tipo | Descrizione |
---|---|---|
Parametro indice | Tipo int | Descrizione 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
Parametro | Tipo | Descrizione |
---|---|---|
Parametro items | Tipo Set<ItemDefinition> | Descrizione 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 CopyContainer.removeItem(var1 as int, var2 as int) as ItemStack
Parametro | Tipo | Descrizione |
---|---|---|
Parametro var1 | Tipo int | Descrizione No Description Provided |
Parametro var2 | Tipo int | Descrizione No Description Provided |
Name: removeItemNoUpdate
Return Type: ItemStack
ZenScript CopyContainer.removeItemNoUpdate(index as int) as ItemStack
Parametro | Tipo | Descrizione |
---|---|---|
Parametro indice | Tipo int | Descrizione No Description Provided |
Name: setChanged
Return Type: void
ZenScript Copy// Container.setChanged() as void
myContainer.setChanged();
Name: setItem
Return Type: void
ZenScript CopyContainer.setItem(index as int, stack as ItemStack) as void
Parametro | Tipo | Descrizione |
---|---|---|
Parametro indice | Tipo int | Descrizione No Description Provided |
Parametro stack | Tipo ItemStack | Descrizione No Description Provided |
Name: startOpen
Return Type: void
ZenScript CopyContainer.startOpen(player as Player) as void
Parametro | Tipo | Descrizione |
---|---|---|
Parametro player | Tipo Player | Descrizione No Description Provided |
Name: stillValid
Return Type: boolean
ZenScript CopyContainer.stillValid(player as Player) as boolean
Parametro | Tipo | Descrizione |
---|---|---|
Parametro player | Tipo Player | Descrizione No Description Provided |
Name: stopOpen
Return Type: void
ZenScript CopyContainer.stopOpen(player as Player) as void
Parametro | Tipo | Descrizione |
---|---|---|
Parametro player | Tipo Player | Descrizione No Description Provided |
Proprietà
Link to proprietà
Nome | Tipo | Ha Getter | Ha Setter | Descrizione |
---|---|---|---|---|
Nome changed | Tipo void | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |
Nome containerSize | Tipo int | Ha Getter sì | Ha Setter no | Descrizione Gets the size (how many slots) of this Container |
Nome isEmpty | Tipo boolean | Ha Getter sì | Ha Setter no | Descrizione Checks if this Container is empty. |
Nome maxStackSize | Tipo int | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |