Class Platform

java.lang.Object
net.ixdarklord.coolcatcore.api.platform.Platform

public final class Platform extends Object
Facts about the running game and loader, the same way on every loader.
  • Method Details

    • getLoader

      public static Platform.Loader getLoader()
    • isFabric

      public static boolean isFabric()
    • isNeoForge

      public static boolean isNeoForge()
    • isModLoaded

      public static boolean isModLoaded(String modId)
    • getModName

      public static Optional<String> getModName(String modId)
      A loaded mod's display name.
    • isDevelopmentEnvironment

      public static boolean isDevelopmentEnvironment()
    • getGameFolder

      public static Path getGameFolder()
      The game's folder (.minecraft, or the server's folder).
    • getConfigFolder

      public static Path getConfigFolder()
      The config folder.
    • getEnvironment

      public static Env getEnvironment()
      Which side this game is: a client (which may also run an integrated server) or a dedicated server.
    • isClient

      public static boolean isClient()
    • runOnClient

      public static void runOnClient(Supplier<Runnable> task)
      Runs a task only on the client. The supplier keeps the task's (client-only) class from loading on a dedicated server: Platform.runOnClient(() -> ClientSetup::init).
    • getServer

      @Nullable public static @Nullable net.minecraft.server.MinecraftServer getServer()
      The running server (dedicated or integrated), or null when there's none.
    • isFakePlayer

      public static boolean isFakePlayer(net.minecraft.world.entity.player.Player player)
      Whether the player is a mod's fake player (machines, deployers...) rather than a real one.