Package guideme

Class GuideBuilder

java.lang.Object
guideme.GuideBuilder

public class GuideBuilder extends Object
Constructs new guides.

Use Guide.builder(ResourceLocation) to obtain a new builder.

  • Method Details

    • register

      public GuideBuilder register(boolean enable)
      Allows the automated registration in the global Guide registry to be disabled. This is mostly useful for testing purposes.

      Disabling registration of the guide will disable several features for this guide:

      • Automatically showing the guide on startup
      • The open hotkey
      • Automatically reloading pages on resource reload
    • defaultNamespace

      public GuideBuilder defaultNamespace(String defaultNamespace)
      Sets the default resource namespace for this guide. This namespace is used for resources loaded from a plain folder during development and defaults to the namespace of the guide id.
    • folder

      public GuideBuilder folder(String folder)
      Sets the folder within the resource pack, from which pages for this guide will be loaded. Please note that this name must be unique across all namespaces, since it would otherwise cause pages from guides added by other mods to show up in yours.

      This defaults to guides/<namespace>/<path> with namespace and path coming from the guide id, which should implicitly make it unique.

    • disableDefaultExtensions

      public GuideBuilder disableDefaultExtensions()
      Stops the builder from adding any of the default extensions. Use disableDefaultExtensions(ExtensionPoint) to disable the default extensions only for one of the extension points.
    • disableOpenHotkey

      public GuideBuilder disableOpenHotkey()
      Disables the global open hotkey from using this guide.
    • disableDefaultExtensions

      public GuideBuilder disableDefaultExtensions(ExtensionPoint<?> extensionPoint)
      Stops the builder from adding any of the default extensions to the given extension point. disableDefaultExtensions() takes precedence and will disable all extension points.
    • startPage

      public GuideBuilder startPage(net.minecraft.resources.ResourceLocation pageId)
      Set the page to show when this guide is being opened without any previous page or target page. Defaults to index.md in the default namespace.
    • developmentSources

      public GuideBuilder developmentSources(@Nullable @Nullable Path folder)
      See developmentSources(Path, String). Uses the default namespace of the guide as the namespace for the pages and resources in the folder.
    • developmentSources

      public GuideBuilder developmentSources(Path folder, String namespace)
      Load additional page resources and assets from the given folder. Useful during development in conjunction with watchDevelopmentSources to automatically reload pages during development.

      All resources in the given folder are treated as if they were in the given namespace and the folder given to Guide.builder(net.minecraft.resources.ResourceLocation).

      The default values for folder and namespace will be taken from the system properties:

      • guideDev.<FOLDER>.sources
      • guideDev.<FOLDER>.sourcesNamespace
    • watchDevelopmentSources

      public GuideBuilder watchDevelopmentSources(boolean enable)
      If development sources are used (developmentSources(Path, String), the given folder will automatically be watched for change. This method can be used to disable this behavior.
    • index

      public GuideBuilder index(PageIndex index)
      Adds a page index to this guide, to be updated whenever the pages in the guide change.
    • index

      public <T extends PageIndex> GuideBuilder index(Class<? super T> clazz, T index)
      Adds a page index to this guide, to be updated whenever the pages in the guide change. Allows the class token under which the index can be retrieved to be specified.
    • extension

      public <T extends Extension> GuideBuilder extension(ExtensionPoint<T> extensionPoint, T extension)
      Adds an extension to the given extension point for this guide.
    • itemSettings

      public GuideBuilder itemSettings(GuideItemSettings settings)
      Configure the generic guide item provided by GuideME. If you are using this code API to register your guide, you are encouraged to register your own guide item instead of using the generic one.
    • build

      public guideme.internal.MutableGuide build()
      Creates the guide.