Search in sources :

Example 1 with SlimefunGuide

use of io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide in project Slimefun4 by Slimefun.

the class SlimefunRegistry method getSlimefunGuide.

/**
 * This returns the corresponding {@link SlimefunGuideImplementation} for a certain
 * {@link SlimefunGuideMode}.
 * <p>
 * This mainly only exists for internal purposes, if you want to open a certain section
 * using the {@link SlimefunGuide}, then please use the static methods provided in the
 * {@link SlimefunGuide} class.
 *
 * @param mode
 *            The {@link SlimefunGuideMode}
 *
 * @return The corresponding {@link SlimefunGuideImplementation}
 */
@Nonnull
public SlimefunGuideImplementation getSlimefunGuide(@Nonnull SlimefunGuideMode mode) {
    Validate.notNull(mode, "The Guide mode cannot be null");
    SlimefunGuideImplementation guide = guides.get(mode);
    if (guide == null) {
        throw new IllegalStateException("Slimefun Guide '" + mode + "' has no registered implementation.");
    }
    return guide;
}
Also used : SlimefunGuideImplementation(io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideImplementation) Nonnull(javax.annotation.Nonnull)

Aggregations

SlimefunGuideImplementation (io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideImplementation)1 Nonnull (javax.annotation.Nonnull)1