IFacing
Link to ifacing
Интерфейс IFacing позволяет получать возможные направление для IBlockPos.
Импорт пакета
Link to импорт-пакета
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
Link to 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"
)
ZenScript Copycrafttweaker.world.IFacing.north()
crafttweaker.world.IFacing.east()
crafttweaker.world.IFacing.south()
crafttweaker.world.IFacing.west()
crafttweaker.world.IFacing.down()
crafttweaker.world.IFacing.up()
crafttweaker.world.IFacing.fromString(String name);
ZenGetters/ZenMethods without parameters
Link to zengetterszenmethods-without-parameters
ZenGetter | ZenMethod | Возвращаемый тип |
---|---|---|
ZenGetter name | ZenMethod getName() | Возвращаемый тип string |
ZenGetter rotateY | ZenMethod rotateY() | Возвращаемый тип IFacing |
ZenGetter opposite | ZenMethod opposite() | Возвращаемый тип IFacing |
Другие методы
Link to другие-методы
Сравнение двух направлений
Link to сравнение-двух-направлений
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.
ZenScript Copy//Returns true or false
facingOne == facingTwo;
//Returns 0 if they are equal
facingOne.compare(facingTwo);
Getting from Entities
Link to 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.