Class ChunkMigrations

java.lang.Object
com.hypixel.hytale.server.core.modules.migrations.ChunkMigrations

public final class ChunkMigrations extends Object
Runs registered migration systems against a chunk holder loaded outside of the normal world loading pipeline (e.g. converting between storage backends or migrating instance worlds).
  • Method Details

    • migrate

      public static boolean migrate(@Nonnull Holder<ChunkStore> holder, @Nonnull ComponentRegistry.Data<ChunkStore> chunkData, @Nonnull Store<ChunkStore> chunkStore, @Nullable ComponentRegistry.Data<EntityStore> entityData, @Nullable Store<EntityStore> entityStore)
      Runs the chunk column, block, section, and (if available) entity migration systems against the given chunk holder. The pre-fetched registry data is captured by the caller so the migration can run on threads other than the store thread.
      Parameters:
      holder - The chunk column holder to migrate.
      chunkData - A snapshot of the chunk component registry data.
      chunkStore - The chunk Store migration systems should run against.
      entityData - A snapshot of the entity component registry data, or null to skip entity migrations.
      entityStore - The entity Store entity migration systems should run against, or null to skip entity migrations.
      Returns:
      true if any migration system ran on the holder, indicating the holder should be re-saved.
    • migrateSections

      public static boolean migrateSections(@Nonnull Iterable<Holder<ChunkStore>> sections, @Nonnull ComponentRegistry.Data<ChunkStore> chunkData, @Nonnull Store<ChunkStore> chunkStore, @Nullable ComponentRegistry.Data<EntityStore> entityData, @Nullable Store<EntityStore> entityStore)
      Runs the block, section, and (if available) entity migration systems against section holders. migrate(Holder, ComponentRegistry.Data, Store, ComponentRegistry.Data, Store) calls this for a column's sections; cubic sections loaded on their own pass through it directly.
      Returns:
      true if any migration system ran, indicating the sections should be re-saved.