Class ModPlatform
java.lang.Object
net.dillon.dillonlib.platform.ModPlatform
- All Implemented Interfaces:
Loadable
- Direct Known Subclasses:
FabricModImpl
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 StringmodId()abstract Stringabstract Platformplatform()voidregisterCommonCommands(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.abstract Releaserelease()
-
Constructor Details
-
ModPlatform
public ModPlatform()
-
-
Method Details
-
modId
-
modVersion
- Returns:
- your mod version.
- See Also:
-
release
-
platform
-
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.
-