Skip to content

Commit

Permalink
fix: store relative pos for regions
Browse files Browse the repository at this point in the history
  • Loading branch information
andantet committed Oct 21, 2024
1 parent a4d5ef4 commit c4589e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ interface RegionBlock {
fun trySaveRegion(
world: ServerWorld,
pos: BlockPos,
relativePos: BlockPos,
state: BlockState,
regions: MutableMap<String, SerializableRegion>
): Boolean {
if (state.block is PointRegionBlock) {
regions["${regions.size}"] = PointRegion(Vec3d.ofCenter(pos))
regions["${regions.size}"] = PointRegion(Vec3d.ofCenter(relativePos))
return true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ data class Blueprint(

// state
val state = world.getBlockState(pos)
if (!RegionBlock.trySaveRegion(world, pos, state, regions)) {
if (!RegionBlock.trySaveRegion(world, pos, relativePos, state, regions)) {
if (!state.isAir) {
// build palette
if (state !in palette) {
Expand Down

0 comments on commit c4589e4

Please sign in to comment.