Interface FabricBlockState
public interface FabricBlockState
General-purpose Fabric-provided extensions for
BlockState, matching the functionality provided in FabricBlock.
Note: This interface is automatically implemented on all block states via Mixin and interface injection.
-
Method Summary
Modifier and TypeMethodDescriptiondefault net.minecraft.world.level.block.state.BlockStategetAppearance(net.minecraft.world.level.BlockAndLightGetter level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, @Nullable net.minecraft.world.level.block.state.BlockState sourceState, @Nullable net.minecraft.core.BlockPos sourcePos) Return the current appearance of the block, i.e.default floatgetProvidedEnchantmentPower(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos) Return a for custom enchantment power level.
-
Method Details
-
getAppearance
default net.minecraft.world.level.block.state.BlockState getAppearance(net.minecraft.world.level.BlockAndLightGetter level, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction side, @Nullable net.minecraft.world.level.block.state.BlockState sourceState, @Nullable net.minecraft.core.BlockPos sourcePos) Return the current appearance of the block, i.e. which block state this block reports to look like on a given side.- Parameters:
level- the level this block is inpos- position of this block, whose appearance is being queriedside- the side for which the appearance is being queriedsourceState- (optional) state of the block that is querying the appearance, or null if unknownsourcePos- (optional) position of the block that is querying the appearance, or null if unknown- Returns:
- the appearance of the block on the given side; the original
statecan be returned if there is no better option - See Also:
-
getProvidedEnchantmentPower
default float getProvidedEnchantmentPower(net.minecraft.world.level.BlockGetter level, net.minecraft.core.BlockPos pos) Return a for custom enchantment power level. A value of1.0fmeans that the state is equivalent to one bookshelf.Important: Your block must be in
BlockTags.ENCHANTMENT_POWER_PROVIDERto affect enchanting.Returning negative values is allowed and will decrease the enchantment power
Note: Fractional powers are summed and then rounded to the nearest integer, with 0.5 rounding down.
- Parameters:
level- the level this block is inpos- position of this block, whose power is being queried- Returns:
- the bookshelf equivalent for this state
-