package com.livingworld.platform;

/**
 * Platform-neutral description of a block broken by a player.
 *
 * <p>The NeoForge adapter constructs this from a {@code BlockEvent.BreakEvent}
 * and passes it to the bootstrap handler so no Minecraft types cross the
 * platform boundary into core simulation code.</p>
 *
 * @param dimensionId       Minecraft dimension key string (e.g. {@code "minecraft:overworld"})
 * @param blockX            world X coordinate of the broken block
 * @param blockZ            world Z coordinate of the broken block
 * @param blockRegistryName registry name of the broken block (e.g. {@code "minecraft:oak_log"})
 */
public record BlockBreakInfo(
        String dimensionId,
        int blockX,
        int blockZ,
        String blockRegistryName) {

    public BlockBreakInfo {
        if (dimensionId == null || dimensionId.isBlank()) {
            throw new IllegalArgumentException("dimensionId must not be null or blank");
        }
        if (blockRegistryName == null || blockRegistryName.isBlank()) {
            throw new IllegalArgumentException("blockRegistryName must not be null or blank");
        }
    }
}
