IFacing
The IFacing Interface allows you to get an IBlockPos’s possible directions.
Importing the package
It might be required for you to import the package if you encounter any issues, so better be safe than sorry and add the import.
import crafttweaker.world.IFacing;
Enumerations
The Facing interface has 6 static methods that return the said direction.
It also has one more that takes the direction as String input (e.g. "NORTH"
)
ZenGetters/ZenMethods without parameters
ZenGetter | ZenMethod | Return Type |
---|---|---|
ZenGetter name | ZenMethod getName() | Return Type string |
ZenGetter rotateY | ZenMethod rotateY() | Return Type IFacing |
ZenGetter opposite | ZenMethod opposite() | Return Type IFacing |
Other methods
Comparing two Facings
You can compare two facings using the standart comparing Operators == != < > <= >=
Alternatively, you can use the function, though the function returns an int that is 0 if they are equal.
Getting from Entities
IFacing.getDirectionFromEntityLiving(IBlockPos pos, IEntityLivingBase placer);
The static method returns an IFacing from IEntityLivingBase. The method is often used to determine the facing of some blocks when placed by players, like piston, observer, command block, etc. Unlike the horizontalFacing
getter of IEntity
, the method can return UP
and DOWN
. And it always returns the opposite value of the getter.