Interface IPlatformHelper

All Known Implementing Classes:
NeoForgePlatformHelper

public interface IPlatformHelper
  • Method Details

    • getPlatformName

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

      boolean isModLoaded(String modId)
      Checks if a mod with the given id is loaded.
    • isDevelopmentEnvironment

      boolean isDevelopmentEnvironment()
      Check if the game is currently in a development environment.
    • 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)
    • 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)
    • sendPacketToServer

      void sendPacketToServer(PacketBase packet)
    • sendPacketToPlayer

      void sendPacketToPlayer(PacketBase packet, net.minecraft.server.level.ServerPlayer player)
    • sendPacketToPlayersTracking

      void sendPacketToPlayersTracking(PacketBase packet, net.minecraft.world.entity.Entity entity)
    • getOwnerData

      HorseOwnerData getOwnerData(net.minecraft.world.entity.player.Player player)
      Per-player horse ownership data. Backed by data attachments on Fabric/NeoForge and by a capability on Forge.
    • setOwnerData

      void setOwnerData(net.minecraft.world.entity.player.Player player, HorseOwnerData data)
    • getHorseData

      @Nullable @Nullable StoredHorseData getHorseData(net.minecraft.world.entity.Entity horse)
      Must never attach data as a side effect: the presence of data is what tells the rest of the mod that a mount is bound, and this is called for arbitrary entities.
    • getOrCreateHorseData

      @Nullable @Nullable StoredHorseData getOrCreateHorseData(net.minecraft.world.entity.Entity horse)
      Only for the paths about to write a binding. Still null on Forge for an entity constructed without the capability.
    • setHorseData

      void setHorseData(net.minecraft.world.entity.Entity horse, StoredHorseData data)
    • isAreaProtected

      boolean isAreaProtected(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.Entity probe)
      Asks any installed protection mod whether player may interact with probe at its current position. Used to stop horses being called into, or bound inside, claimed regions.
      Parameters:
      probe - a horse entity positioned where the interaction would happen