Class Platform
java.lang.Object
net.ixdarklord.coolcatcore.api.platform.Platform
Facts about the running game and loader, the same way on every loader.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic PathTheconfigfolder.static EnvWhich side this game is: a client (which may also run an integrated server) or a dedicated server.static PathThe game's folder (.minecraft, or the server's folder).static Platform.LoadergetModName(String modId) A loaded mod's display name.static @Nullable net.minecraft.server.MinecraftServerThe running server (dedicated or integrated), or null when there's none.static booleanisClient()static booleanstatic booleanisFabric()static booleanisFakePlayer(net.minecraft.world.entity.player.Player player) Whether the player is a mod's fake player (machines, deployers...) rather than a real one.static booleanisForge()static booleanisModLoaded(String modId) static booleanstatic voidrunOnClient(Supplier<Runnable> task) Runs a task only on the client.
-
Method Details
-
getLoader
-
isFabric
public static boolean isFabric() -
isForge
public static boolean isForge() -
isNeoForge
public static boolean isNeoForge() -
isModLoaded
-
getModName
A loaded mod's display name. -
isDevelopmentEnvironment
public static boolean isDevelopmentEnvironment() -
getGameFolder
The game's folder (.minecraft, or the server's folder). -
getConfigFolder
Theconfigfolder. -
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
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.
-