Class ModPlatform
java.lang.Object
net.dillon.dillonlib.platform.ModPlatform
- All Implemented Interfaces:
Loadable
- Direct Known Subclasses:
NeoForgePlatformImpl
A platform helper class. Can be used for various different calls and functions, and new methods can easily be added in the mod's specified platform.
Each platform for your mod (ex. fabric and neoforge) should contain three service loaders, one for this class, one for ClientModPlatform (for client-side only access code), and one for the MixinModPlatform, which is a mixin-safe class for methods that can be used in conditional mixin plugins.
- Since:
- 1.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract @NotNull org.slf4j.Loggerlogger()abstract @NotNull LogoWidthabstract StringmodId()abstract Stringabstract @NotNull PlatformNameabstract @NotNull PlatformReleasevoidregisterCommonCommands(com.mojang.brigadier.CommandDispatcher<net.minecraft.commands.CommandSourceStack> dispatcher, net.minecraft.commands.CommandBuildContext commandRegistryAccess) Registers commands that should be on all environments.voidRegisters events, that should be on all environments.voidregisterServerCommands(com.mojang.brigadier.CommandDispatcher<net.minecraft.commands.CommandSourceStack> dispatcher, net.minecraft.commands.CommandBuildContext commandRegistryAccess) Registers server-side only commands.
-
Constructor Details
-
ModPlatform
public ModPlatform()
-
-
Method Details
-
modId
-
logger
@NotNull public abstract @NotNull org.slf4j.Logger logger()- Returns:
- the logger for your mod.
-
modVersion
- Returns:
- your mod version.
-
platformName
- Returns:
- the
PlatformName(fabric, neoforge, forge, etc.)
-
platformRelease
- Returns:
- the
PlatformRelease(stable/release, beta, or alpha).
-
logoWidth
-
registerEvents
public void registerEvents()Registers events, that should be on all environments. Be careful with this method, because you don't want to register events in the wrong place. -
registerCommonCommands
public void registerCommonCommands(com.mojang.brigadier.CommandDispatcher<net.minecraft.commands.CommandSourceStack> dispatcher, net.minecraft.commands.CommandBuildContext commandRegistryAccess) Registers commands that should be on all environments. -
registerServerCommands
public void registerServerCommands(com.mojang.brigadier.CommandDispatcher<net.minecraft.commands.CommandSourceStack> dispatcher, net.minecraft.commands.CommandBuildContext commandRegistryAccess) Registers server-side only commands.
-