ICTBlockState
Link to ictblockstate
An ICTBlockState object represents a block's current state.
Импорт пакета
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 mods.contenttweaker.BlockState;
Calling an ICTBlockState
Link to calling-an-ictblockstate
You can get an ICTBlockState either as a parameter in an IBlockAction function or from the Block Bracket Handler
<block:minecraft:dirt>
ZenMethods and ZenGetters
Link to zenmethods-and-zengetters
ZenMethod | ZenGetter | Возвращаемый тип | Описание |
---|---|---|---|
ZenMethod getBlock() | ZenGetter block | Возвращаемый тип IBlock | Описание Returns the refered block |
ZenMethod getMeta() | ZenGetter meta | Возвращаемый тип int | Описание Returns the refered block's metadata |
ZenMethod canProvidePower() | ZenGetter | Возвращаемый тип boolean | Описание Returns if the refered block can provide Redstone Power |
ZenMethod getMobilityFlag() | ZenGetter | Возвращаемый тип PushReaction | Описание Returns the push reaction flag |
ZenMethods
Link to zenmethods
isReplacable
Link to isreplacable
boolean isReplaceable(IWorld world, IBlockPos pos);
Parameters:
Returns a boolean that sais whether the block can be replaced or not.
getLightValue
Link to getlightvalue
int getLightValue(IWorld world, IBlockPos blockPos);
Parameters:
Returns an int representing the current light value at the given location.
getWeakPower
Link to getweakpower
int getWeakPower(IWorld world, IBlockPos blockPos, Facing facing);
Parameters:
- IWorld world → The world to be checked in
- IBlockPos pos → The Block's position
- Facing facing → The side to be checked
Returns an int representing the current redstone power on this side.
getComparatorInputOverride
Link to getcomparatorinputoverride
int getComparatorInputOverride(IWorld world, IBlockPos blockPos);
Parameters:
Returns an int representing the block's redstone comparator input override type.
Comparing two ICTBlockState objects
Link to comparing-two-ictblockstate-objects
You can either use int compare(ICTBlockState other);
or the ZenCompare Tokens ==
!=
.
The return different types though:
state.compare(other)
returns an int that is 0 if they are equalstate == other
returns a bool that is true of they are equal