Interface IPlatformHelper

All Known Implementing Classes:
NeoForgePlatformHelper

public interface IPlatformHelper
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the directory where the platform stores its configuration files
    Gets the name of the platform this is running on
    boolean
    Gets the version of the platform this is running on
    <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)
    Registers a clientbound packet
    <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)
    Registers a serverbound packet
    void
    sendPacketToPlayer(net.minecraft.resources.ResourceLocation id, PacketBase packet, net.minecraft.server.level.ServerPlayer player)
    Sends a packet to a player
    void
    sendPacketToServer(net.minecraft.resources.ResourceLocation id, PacketBase packet)
    Sends a packet to the server
  • Method Details

    • getPlatformName

      String getPlatformName()
      Gets the name of the platform this is running on
      Returns:
      The name of the platform this is running on
    • getPlatformConfigDir

      Path getPlatformConfigDir()
      Gets the directory where the platform stores its configuration files
      Returns:
      The directory where the platform stores its configuration files
    • isDevelopmentEnvironment

      boolean isDevelopmentEnvironment()
      Gets the version of the platform this is running on
      Returns:
      The version of the platform this is running on
    • 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)
      Registers a serverbound packet
    • 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)
      Registers a clientbound packet
    • sendPacketToServer

      void sendPacketToServer(net.minecraft.resources.ResourceLocation id, PacketBase packet)
      Sends a packet to the server
    • sendPacketToPlayer

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