Class ZoneFileContext

java.lang.Object
com.hypixel.hytale.server.worldgen.loader.context.FileContext<FileLoadingContext>
com.hypixel.hytale.server.worldgen.loader.context.ZoneFileContext

public class ZoneFileContext extends FileContext<FileLoadingContext>
Holds contextual information relating to a Zone folder (including its id, name, and path) and the Biomes that it contains.
  • Constructor Details

  • Method Details

    • getTileBiomes

      @Nonnull public FileContext.Registry<BiomeFileContext> getTileBiomes()
      Get the Zone's Tile Biome registry.
      Returns:
      A registry containing all the Tile Biomes present in this Zone.
    • getCustomBiomes

      @Nonnull public FileContext.Registry<BiomeFileContext> getCustomBiomes()
      Get the Zone's Custom Biome registry.
      Returns:
      A registry containing all the Custom Biomes present in this Zone.
    • getBiomes

      @Nonnull public FileContext.Registry<BiomeFileContext> getBiomes(@Nonnull BiomeFileContext.Type type)
      Get the Zone's Biome registry for a given Type.
      Parameters:
      type - The Biome Type to retrieved the registry for (Tile or Custom).
      Returns:
      The Biome registry for the Biome Type.
    • matchContext

      @Nonnull public ZoneFileContext matchContext(@Nullable com.google.gson.JsonElement json, String key)
      Returns the appropriate ZoneContext for the data stored under the given 'key' in the provided 'json' element. If the data points to a file inside a zone-folder then the context for that zone is returned, otherwise the current instance ('this') will be returned.
      Parameters:
      json - The JsonElement that may or may not be holding the keyed element.
      key - The key of the element being looked up
      Returns:
      The best-matching ZoneContext for the keyed element
    • matchContext

      @Nonnull public ZoneFileContext matchContext(@Nonnull String filePath)
      Returns the appropriate ZoneContext for the file with the given path. If the path points to a file inside a zone-folder then the context for that zone is returned, otherwise the current instance ('this') will be returned.
      Parameters:
      filePath - The path of the file to match the ZoneContext for.
      Returns:
      The best-matching ZoneContext for the file.