Class ModloaderValidator

  • All Implemented Interfaces:

    
    public final class ModloaderValidator
    
                        

    Validator for the modloader-concern of a server pack configuration: whether a supported modloader was specified and whether the modloader-version exists for the given Minecraft-version, verified against the version-meta. Extracted from ConfigurationHandler (refactor Phase 1c); ConfigurationHandler remains the facade through which consumers access these checks.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final ConfigCheck checkModloader(String modloader, ConfigCheck configCheck) Checks whether either Forge or Fabric were specified as the modloader.
      final ConfigCheck checkModloaderVersion(String modloader, String modloaderVersion, String minecraftVersion, ConfigCheck configCheck) Check the given Minecraft and modloader versions for the specified modloader.
      • Methods inherited from class java.lang.Object

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

      • ModloaderValidator

        ModloaderValidator(VersionMeta versionMeta)
    • Method Detail

      • checkModloader

         final ConfigCheck checkModloader(String modloader, ConfigCheck configCheck)

        Checks whether either Forge or Fabric were specified as the modloader.

        Parameters:
        modloader - Check as case-insensitive for Forge or Fabric.
        Returns:

        true if the specified modloader is either Forge or Fabric. False if neither.

      • checkModloaderVersion

         final ConfigCheck checkModloaderVersion(String modloader, String modloaderVersion, String minecraftVersion, ConfigCheck configCheck)

        Check the given Minecraft and modloader versions for the specified modloader.

        Parameters:
        modloader - The passed modloader which determines whether the check for Forge or Fabric is called.
        modloaderVersion - The version of the modloader which is checked against the corresponding modloader's manifest.
        minecraftVersion - The version of Minecraft used for checking the Forge version.
        Returns:

        true if the specified modloader version was found in the corresponding manifest.