Contents
Class ZoneFileContext
java.lang.Object
com.hypixel.hytale.server.worldgen.loader.context.FileContext<FileLoadingContext>
com.hypixel.hytale.server.worldgen.loader.context.ZoneFileContext
Holds contextual information relating to a Zone folder (including its id, name, and path) and the Biomes that it contains.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class FileContext
FileContext.Registry<T>, FileContext.RootContext -
Constructor Summary
ConstructorsConstructorDescriptionZoneFileContext(int id, String name, Path filepath, FileLoadingContext context) -
Method Summary
Modifier and TypeMethodDescriptionGet the Zone's Biome registry for a given Type.Get the Zone's Custom Biome registry.Get the Zone's Tile Biome registry.matchContext(com.google.gson.JsonElement json, String key) Returns the appropriate ZoneContext for the data stored under the given 'key' in the provided 'json' element.matchContext(String filePath) Returns the appropriate ZoneContext for the file with the given path.Methods inherited from class FileContext
getContentPath, getId, getName, getParentContext, getPath, getRoot, getRootPath
-
Constructor Details
-
ZoneFileContext
public ZoneFileContext(int id, @Nonnull String name, @Nonnull Path filepath, @Nonnull FileLoadingContext context)
-
-
Method Details
-
getTileBiomes
Get the Zone's Tile Biome registry.- Returns:
- A registry containing all the Tile Biomes present in this Zone.
-
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
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.
-