Class ClientModPlatform

java.lang.Object
net.dillon.dillonlib.platform.client.ClientModPlatform
All Implemented Interfaces:
Loadable
Direct Known Subclasses:
ClientFabricPlatformImpl

public abstract class ClientModPlatform extends Object implements Loadable
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract boolean
    canSendPacket(net.minecraft.client.player.LocalPlayer localPlayer)
     
    abstract String
     
    void
    registerClientCommands(com.mojang.brigadier.CommandDispatcher<net.minecraft.commands.CommandSourceStack> dispatcher, net.minecraft.commands.CommandBuildContext commandRegistryAccess)
    Registers client-side only commands.
    abstract net.minecraft.client.KeyMapping
    registerKeyMapping(String name, com.mojang.blaze3d.platform.InputConstants.Type type, net.minecraft.client.KeyMapping.Category category, int value)
    Registers a KeyMapping into the game.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ClientModPlatform

      public ClientModPlatform()
  • Method Details

    • modId

      public abstract String modId()
      Specified by:
      modId in interface Loadable
      Returns:
      the mod id for this client platform. Should return your mod id from your common mod class.
    • 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 a KeyMapping into 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.