Interface IPlatformHelper

All Known Implementing Classes:
FabricPlatformHelper

public interface IPlatformHelper
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the name of the current platform
    boolean
    Check if the game is currently in a development environment.
    boolean
    Checks if a mod with the given id is loaded.
    <T extends PacketBase, B extends net.minecraft.network.FriendlyByteBuf>
    void
    registerClientboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, Class<T> clazz, net.minecraft.network.codec.StreamCodec<B,T> codec, BiConsumer<T,net.minecraft.world.entity.player.Player> handler, Object... args)
     
    void
     
    <T extends PacketBase, B extends net.minecraft.network.FriendlyByteBuf>
    void
    registerServerboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, Class<T> clazz, net.minecraft.network.codec.StreamCodec<B,T> codec, BiConsumer<T,net.minecraft.world.entity.player.Player> handler, Object... args)
     
    void
    sendPacketToPlayer(net.minecraft.resources.ResourceLocation id, PacketBase packet, net.minecraft.server.level.ServerPlayer player)
     
    void
    sendPacketToServer(net.minecraft.resources.ResourceLocation id, PacketBase packet)
     
  • Method Details

    • getPlatformName

      String getPlatformName()
      Gets the name of the current platform
      Returns:
      The name of the current platform.
    • isModLoaded

      boolean isModLoaded(String modId)
      Checks if a mod with the given id is loaded.
      Parameters:
      modId - The mod to check if it is loaded.
      Returns:
      True if the mod is loaded, false otherwise.
    • isDevelopmentEnvironment

      boolean isDevelopmentEnvironment()
      Check if the game is currently in a development environment.
      Returns:
      True if in a development environment, false otherwise.
    • registerConfig

      void registerConfig(BuiltConfig cfg)
    • registerServerboundPacket

      <T extends PacketBase, B extends net.minecraft.network.FriendlyByteBuf> void registerServerboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, Class<T> clazz, net.minecraft.network.codec.StreamCodec<B,T> codec, BiConsumer<T,net.minecraft.world.entity.player.Player> handler, Object... args)
    • registerClientboundPacket

      <T extends PacketBase, B extends net.minecraft.network.FriendlyByteBuf> void registerClientboundPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, Class<T> clazz, net.minecraft.network.codec.StreamCodec<B,T> codec, BiConsumer<T,net.minecraft.world.entity.player.Player> handler, Object... args)
    • sendPacketToServer

      void sendPacketToServer(net.minecraft.resources.ResourceLocation id, PacketBase packet)
    • sendPacketToPlayer

      void sendPacketToPlayer(net.minecraft.resources.ResourceLocation id, PacketBase packet, net.minecraft.server.level.ServerPlayer player)