Interface PolarDataConverter


public interface PolarDataConverter
Allows for upgrading world data from one game version to another.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final @NotNull PolarDataConverter
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default Map.Entry<String,net.kyori.adventure.nbt.CompoundBinaryTag>
    convertBlockEntityData(@NotNull String id, @NotNull net.kyori.adventure.nbt.CompoundBinaryTag data, int fromVersion, int toVersion)
     
    default void
    convertBlockPalette(@NotNull String[] palette, int fromVersion, int toVersion)
    Converts the block palette from one version to another.
    default int
    Returns the current data version of the world.
    default int
    Returns the data version to use on worlds lower than PolarWorld.VERSION_DATA_CONVERTER which do not store a data version.
  • Field Details

  • Method Details

    • defaultDataVersion

      default int defaultDataVersion()
      Returns the data version to use on worlds lower than PolarWorld.VERSION_DATA_CONVERTER which do not store a data version. Defaults to the current Minestom data version.
    • dataVersion

      default int dataVersion()
      Returns the current data version of the world.
    • convertBlockPalette

      default void convertBlockPalette(@NotNull @NotNull String[] palette, int fromVersion, int toVersion)

      Converts the block palette from one version to another. Implementations are expected to modify the palette array in place.

      Parameters:
      palette - An array of block namespaces, eg "minecraft:stone_stairs[facing=north]"
      fromVersion - The data version of the palette
      toVersion - The data version to convert the palette to
    • convertBlockEntityData

      @NotNull default Map.Entry<String,net.kyori.adventure.nbt.CompoundBinaryTag> convertBlockEntityData(@NotNull @NotNull String id, @NotNull @NotNull net.kyori.adventure.nbt.CompoundBinaryTag data, int fromVersion, int toVersion)