Interface LevelWriter

All Known Subinterfaces:
CommonLevelAccessor, LevelAccessor, LevelSimulatedRW, ServerLevelAccessor, WorldGenLevel
All Known Implementing Classes:
ClientLevel, Level, ServerLevel, WorldGenRegion

public interface LevelWriter
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
     
    default boolean
    destroyBlock(BlockPos pPos, boolean pDropBlock)
    Sets a block to air, but also plays the sound and particles and can spawn drops
    default boolean
    destroyBlock(BlockPos pPos, boolean pDropBlock, Entity pEntity)
     
    boolean
    destroyBlock(BlockPos pPos, boolean pDropBlock, Entity pEntity, int pRecursionLeft)
     
    boolean
    removeBlock(BlockPos pPos, boolean pIsMoving)
     
    default boolean
    setBlock(BlockPos pPos, BlockState pNewState, int pFlags)
    Sets a block state into this world.Flags are as follows: 1 will cause a block update. 2 will send the change to clients. 4 will prevent the block from being re-rendered. 8 will force any re-renders to run on the main thread instead 16 will prevent neighbor reactions (e.g. fences connecting, observers pulsing). 32 will prevent neighbor reactions from spawning drops. 64 will signify the block is being moved.
    boolean
    setBlock(BlockPos pPos, BlockState pState, int pFlags, int pRecursionLeft)
     
  • Method Details

    • setBlock

      boolean setBlock(BlockPos pPos, BlockState pState, int pFlags, int pRecursionLeft)
    • setBlock

      default boolean setBlock(BlockPos pPos, BlockState pNewState, int pFlags)
      Sets a block state into this world.Flags are as follows: 1 will cause a block update. 2 will send the change to clients. 4 will prevent the block from being re-rendered. 8 will force any re-renders to run on the main thread instead 16 will prevent neighbor reactions (e.g. fences connecting, observers pulsing). 32 will prevent neighbor reactions from spawning drops. 64 will signify the block is being moved. Flags can be OR-ed
    • removeBlock

      boolean removeBlock(BlockPos pPos, boolean pIsMoving)
    • destroyBlock

      default boolean destroyBlock(BlockPos pPos, boolean pDropBlock)
      Sets a block to air, but also plays the sound and particles and can spawn drops
    • destroyBlock

      default boolean destroyBlock(BlockPos pPos, boolean pDropBlock, @Nullable Entity pEntity)
    • destroyBlock

      boolean destroyBlock(BlockPos pPos, boolean pDropBlock, @Nullable Entity pEntity, int pRecursionLeft)
    • addFreshEntity

      default boolean addFreshEntity(Entity pEntity)