001package net.tnemc.plugincore.core.component;
002/*
003 * The New Plugin Core
004 * Copyright (C) 2022 - 2025 Daniel "creatorfromhell" Vidmar
005 *
006 * This program is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU Affero General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * This program is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU Affero General Public License for more details.
015 *
016 * You should have received a copy of the GNU Affero General Public License
017 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
018 */
019
020import net.tnemc.plugincore.core.Platform;
021
022/**
023 * Component
024 *
025 * @author creatorfromhell
026 * @since 1.0.0.2
027 */
028public interface Component {
029
030  /**
031   * Returns the identifier associated with this Component.
032   *
033   * @return the identifier string
034   */
035  String identifier();
036
037  /**
038   * Checks if this method supports the given platform and version.
039   *
040   * @param platform the Platform to check for support
041   * @param version the version string to check for support
042   * @return true if the platform and version are supported, false otherwise
043   */
044  boolean supports(final Platform platform, final String version);
045
046  /**
047   * Retrieves the array of dependencies required by this component.
048   *
049   * @return an array of strings representing the dependencies needed for this component
050   */
051  String[] dependencies();
052
053  /**
054   * Retrieves an array of library names that this Component requires.
055   *
056   * @return an array of strings representing the required libraries
057   */
058  String[] libraries();
059
060  /**
061   * Initializes the Component with the provided platform and version.
062   *
063   * @param platform the platform to initialize the Component for
064   * @param version the Minecraft version string to initialize the Component with
065   */
066  void initialize(final Platform platform, final String version);
067
068  /**
069   * Initializes the registries for the given platform and version.
070   *
071   * @param platform the platform for which the registries are being initialized
072   * @param version the Minecraft version of the platform
073   */
074  void initRegistries(final Platform platform, final String version);
075
076  /**
077   * Initializes the builders for the given platform and version.
078   *
079   * @see ComponentBuilder
080   *
081   * @param platform the platform to initialize the builders for
082   * @param version the Minecraft version string to initialize the builders with
083   */
084  ComponentBuilder[] initBuilders(final Platform platform, final String version);
085}