java.lang.Object
com.minecolonies.core.compatibility.journeymap.Journeymap

public class Journeymap extends Object
Journeymap interface singleton
  • Constructor Summary

    Constructors
    Constructor
    Description
    Journeymap(journeymap.client.api.IClientAPI jmap)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull journeymap.client.api.IClientAPI
    Gets the Journeymap API instance.
    getDataPath(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension)
    Gets the folder where additional map data should be stored.
    static @NotNull Optional<Journeymap>
    Gets the current instance.
    Gets the Journeymap custom options.
    <T> Optional<T>
    loadData(@NotNull Path filePath, @NotNull String description, @NotNull com.mojang.serialization.Codec<T> codec)
    Loads JSON data from disk via a Codec.
    <T> boolean
    saveData(@NotNull Path filePath, @NotNull String description, @NotNull com.mojang.serialization.Codec<T> codec, T value)
    Saves JSON data to disk via a Codec.
    void
    Sets the Journeymap custom options.
    void
    show(@NotNull journeymap.client.api.display.Displayable displayable)
    Helper method to simplify showing displayables.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Journeymap

      public Journeymap(journeymap.client.api.IClientAPI jmap)
  • Method Details

    • getInstance

      @NotNull public static @NotNull Optional<Journeymap> getInstance()
      Gets the current instance.
    • getApi

      @NotNull public @NotNull journeymap.client.api.IClientAPI getApi()
      Gets the Journeymap API instance.
    • getOptions

      @NotNull public @NotNull Optional<JourneymapOptions> getOptions()
      Gets the Journeymap custom options.
    • setOptions

      public void setOptions(JourneymapOptions options)
      Sets the Journeymap custom options.
      Parameters:
      options - The new options instance.
    • show

      public void show(@NotNull @NotNull journeymap.client.api.display.Displayable displayable)
      Helper method to simplify showing displayables.
      Parameters:
      displayable - The displayable to show.
    • getDataPath

      public Path getDataPath(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension)
      Gets the folder where additional map data should be stored.
      Parameters:
      dimension - The dimension being mapped.
      Returns:
      The path to the data folder (this may not exist yet).
    • loadData

      public <T> Optional<T> loadData(@NotNull @NotNull Path filePath, @NotNull @NotNull String description, @NotNull @NotNull com.mojang.serialization.Codec<T> codec)
      Loads JSON data from disk via a Codec.
      Type Parameters:
      T - The type of the object being loaded.
      Parameters:
      filePath - The path to the json file (need not exist)
      description - What you're trying to load (for error logging).
      codec - The codec for the object being loaded.
      Returns:
      The loaded data, or empty if the file was absent or unloadable.
    • saveData

      public <T> boolean saveData(@NotNull @NotNull Path filePath, @NotNull @NotNull String description, @NotNull @NotNull com.mojang.serialization.Codec<T> codec, @NotNull T value)
      Saves JSON data to disk via a Codec.
      Type Parameters:
      T - The type of the object being saved.
      Parameters:
      filePath - The path to the json file (need not exist)
      description - What you're trying to save (for error logging).
      codec - The codec for the object being saved.
      value - The object being saved.
      Returns:
      True if the object was saved successfully.