IBlock
Link to iblock
An IBlock Object consists of a IBlockDefinition, a metadata and a TileData.
It refers to a block in the game.
Dieses Paket importieren
Link to dieses-paket-importieren
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.
import crafttweaker.block.IBlock;
Calling an IBlock Object
Link to calling-an-iblock-object
There are multiple ways thet return an IBlock object:
- Casting a IItemStack as IBlock (using the
AS
keyword, or theasBlock()
method) - Using the getBlock(x,y,z) on an IWorld.
- Using getBlock() on ContentTweaker's ICTBlockState
Warnung: Es ist nur mit der zweiten Methode möglich für Daten
ZenGetter eine nonnull IData!
ZenGetter
Link to zengetter
Getter | What does it do | Rückgabetyp |
---|---|---|
Getter definition | What does it do Returns the Block's definition | Rückgabetyp IBlockDefinition |
Getter meta | What does it do Returns the Block's metadata | Rückgabetyp int |
Getter data | What does it do Returns the Block's tileData | Rückgabetyp IData |
Getter fluid | What does it do Returns the Block's fluid | Rückgabetyp ILiquidDefinition |
IBlockPattern
Link to iblockpattern
IBlocks erweitern IBlockPattern Objekte. Das bedeutet, dass alle Funktionen, die IBlockPattern-Objekte zur Verfügung stehen, auch für IBlock-Objekte verwendet werden können:
- Use the
blocks
ZenGetter - OR'ing
- Matching using the
in
keyword - Use the
displayName
ZenGetter