Class ClientModPlatform
java.lang.Object
net.dillon.dillonlib.platform.client.ClientModPlatform
- All Implemented Interfaces:
Loadable
- Direct Known Subclasses:
ClientFabricPlatformImpl
An instance of
Loadable. Similar to ModPlatform, all methods used inside this class should be client-side only methods, meaning they should not interfere with the common code.- Since:
- 1.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleancanSendPacket(net.minecraft.client.player.LocalPlayer localPlayer) abstract StringmodId()voidregisterClientCommands(com.mojang.brigadier.CommandDispatcher<net.minecraft.commands.CommandSourceStack> dispatcher, net.minecraft.commands.CommandBuildContext commandRegistryAccess) Registers client-side only commands.abstract net.minecraft.client.KeyMappingregisterKeyMapping(String name, com.mojang.blaze3d.platform.InputConstants.Type type, net.minecraft.client.KeyMapping.Category category, int value) Registers aKeyMappinginto the game.
-
Constructor Details
-
ClientModPlatform
public ClientModPlatform()
-
-
Method Details
-
modId
-
registerKeyMapping
public abstract net.minecraft.client.KeyMapping registerKeyMapping(String name, com.mojang.blaze3d.platform.InputConstants.Type type, net.minecraft.client.KeyMapping.Category category, int value) Registers aKeyMappinginto the game. -
canSendPacket
public abstract boolean canSendPacket(net.minecraft.client.player.LocalPlayer localPlayer) - Returns:
- if a packet in your mod can be sent. It's helpful to check if a packet can be sent when joining a server that doesn't have your mod installed, which can inform the user of mod incompatibility. If you don't have a reason to check if a packet can be sent in your mod, you can just return false here.
-
registerClientCommands
public void registerClientCommands(com.mojang.brigadier.CommandDispatcher<net.minecraft.commands.CommandSourceStack> dispatcher, net.minecraft.commands.CommandBuildContext commandRegistryAccess) Registers client-side only commands.
-