类 RedstoneSidedConnectivityTest.EastRedstoneBlock

java.lang.Object
net.minecraft.world.level.block.state.BlockBehaviour
net.minecraft.world.level.block.Block
net.neoforged.neoforge.oldtest.block.RedstoneSidedConnectivityTest.EastRedstoneBlock
所有已实现的接口:
FeatureElement, ItemLike, IBlockExtension
封闭类:
RedstoneSidedConnectivityTest

private static class RedstoneSidedConnectivityTest.EastRedstoneBlock extends Block
  • 构造器详细资料

  • 方法详细资料

    • canConnectRedstone

      public boolean canConnectRedstone(BlockState state, BlockGetter level, BlockPos pos, @Nullable @Nullable Direction direction)
      从接口复制的说明: IBlockExtension
      Whether redstone dust should visually connect to this block on a given side

      The default implementation is identical to RedStoneWireBlock#shouldConnectTo(BlockState, Direction)

      RedStoneWireBlock updates its visual connection when

      引用无效
      BlockState#updateShape(Direction, BlockState, LevelAccessor, BlockPos, BlockPos)
      is called, this callback is used during the evaluation of its new shape.
      参数:
      state - The current state
      level - The level
      pos - The block position in level
      direction - The coming direction of the redstone dust connection (with respect to the block at pos)
      返回:
      True if redstone dust should visually connect on the side passed

      If the return value is evaluated based on level and pos (e.g. from BlockEntity), then the implementation of this block should notify its neighbors to update their shapes when necessary. Consider using BlockBehaviour.BlockStateBase.updateNeighbourShapes(LevelAccessor, BlockPos, int, int) or

      引用无效
      BlockState#updateShape(Direction, BlockState, LevelAccessor, BlockPos, BlockPos)
      .

      Example:

      1. yourBlockState.updateNeighbourShapes(level, yourBlockPos, UPDATE_ALL);

      2. neighborState.updateShape(fromDirection, stateOfYourBlock, level, neighborBlockPos, yourBlockPos), where fromDirection is defined from the neighbor block's point of view.

    • neighborChanged

      public void neighborChanged(BlockState state, Level world, BlockPos pos, Block block, @Nullable @Nullable Orientation orientation, boolean isMoving)
      覆盖:
      neighborChanged 在类中 BlockBehaviour