Package commoble.bagofyurting.api

# Interface BlockDataSerializer<T>

Functional Interface:
  This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface BlockDataSerializer<T>

## Method Summary

Modifier and Type
Method
Description
`void`
`writeWithYurtContext​(T blockEntity, net.minecraft.nbt.CompoundTag nbt, net.minecraft.world.level.block.Rotation rotation, net.minecraft.core.BlockPos minYurt, net.minecraft.core.BlockPos maxYurt, net.minecraft.core.BlockPos origin, net.minecraft.core.BlockPos newOffset)`
Function that writes a blockentity's data into the supplied CompoundTag.

## Method Details

### writeWithYurtContext

void writeWithYurtContext​(T blockEntity, net.minecraft.nbt.CompoundTag nbt, net.minecraft.world.level.block.Rotation rotation, net.minecraft.core.BlockPos minYurt, net.minecraft.core.BlockPos maxYurt, net.minecraft.core.BlockPos origin, net.minecraft.core.BlockPos newOffset)
Function that writes a blockentity's data into the supplied CompoundTag. This is called after what-blocks-to-remove are determined, but before any blocks are actually removed from the Level. Making changes to the Level at this point will not change which blocks are stored in the bag.

Parameters:
  `blockEntity` - The blockentity instance being yurted. Has Level/pos/state context if needed.
  `nbt` - An empty nbt compound that the implementer should write data into. This should be a standard-format blockentity compound; if no BlockDataSerializer is assigned to the relevant tile entity type, then BlockEntity::write is used by default instead. The rotation should be applied to any rotation-sensitive data.
  `rotation` - A rotation that should be applied to any rotation-sensitive data.
  `minYurt` - The minimal corner of the yurt region.
  `maxYurt` - The maximal corner of the yurt region.
  `origin` - The blockpos in absolute Levelspace that the bag of yurting was used on (the bottom center of the yurt region)
  `newOffset` - The position that the translated-and-rotated te position will be stored as in yurt data (as an offset relative to the 0,0,0 origin)