package com.livingworld.integration.minecraft;

import static org.junit.jupiter.api.Assertions.assertEquals;

import com.livingworld.regions.RegionCoordinate;
import org.junit.jupiter.api.Test;

class MinecraftCoordinateMapperTest {

    private final MinecraftCoordinateMapper mapper = new MinecraftCoordinateMapper();

    @Test
    void mapsBlockCoordinatesThroughRegionCoordinate() {
        assertEquals(
                new RegionCoordinate("minecraft:overworld", -2, 1),
                mapper.fromBlockPos("minecraft:overworld", -129, 128, 8));
    }

    @Test
    void mapsChunkCoordinatesThroughRegionCoordinate() {
        assertEquals(
                new RegionCoordinate("minecraft:the_nether", -1, 1),
                mapper.fromChunkPos("minecraft:the_nether", -1, 8, 8));
    }
}
