Class NeoForgePlatformHelper

java.lang.Object
net.trique.wardentools.platform.NeoForgePlatformHelper
All Implemented Interfaces:
IPlatformHelper

public class NeoForgePlatformHelper extends Object implements IPlatformHelper
  • Constructor Details

    • NeoForgePlatformHelper

      public NeoForgePlatformHelper()
  • Method Details

    • getPlatformName

      public String getPlatformName()
      Description copied from interface: IPlatformHelper
      Gets the name of the current platform
      Specified by:
      getPlatformName in interface IPlatformHelper
      Returns:
      The name of the current platform.
    • isModLoaded

      public boolean isModLoaded(String modId)
      Description copied from interface: IPlatformHelper
      Checks if a mod with the given id is loaded.
      Specified by:
      isModLoaded in interface IPlatformHelper
      Parameters:
      modId - The mod to check if it is loaded.
      Returns:
      True if the mod is loaded, false otherwise.
    • isDevelopmentEnvironment

      public boolean isDevelopmentEnvironment()
      Description copied from interface: IPlatformHelper
      Check if the game is currently in a development environment.
      Specified by:
      isDevelopmentEnvironment in interface IPlatformHelper
      Returns:
      True if in a development environment, false otherwise.
    • setRegistrar

      public static void setRegistrar(net.neoforged.neoforge.network.registration.PayloadRegistrar registrar)
    • isClient

      public boolean isClient()
      Description copied from interface: IPlatformHelper
      Gets the name of the environment type as a string.
      Specified by:
      isClient in interface IPlatformHelper
      Returns:
      The name of the environment type.
    • registerDataAttachment

      public <T> void registerDataAttachment(CommonDataAttachment<T> attachment)
      Specified by:
      registerDataAttachment in interface IPlatformHelper
    • getAttachedValue

      @Nullable public <T> T getAttachedValue(Object object, CommonDataAttachment<T> attachment)
      Specified by:
      getAttachedValue in interface IPlatformHelper
    • setAttachedValue

      public <T> void setAttachedValue(Object object, CommonDataAttachment<T> attachment, @Nullable T value)
      Specified by:
      setAttachedValue in interface IPlatformHelper
    • registerClientPlayPacket

      public <MSG extends S2CModPacket<?>> void registerClientPlayPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<MSG> type, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,MSG> streamCodec)
      Specified by:
      registerClientPlayPacket in interface IPlatformHelper
    • registerServerPlayPacket

      public <MSG extends C2SModPacket<?>> void registerServerPlayPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<MSG> type, net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,MSG> streamCodec)
      Specified by:
      registerServerPlayPacket in interface IPlatformHelper
    • sendToClient

      public void sendToClient(S2CModPacket<?> msg, net.minecraft.server.level.ServerPlayer player)
      Specified by:
      sendToClient in interface IPlatformHelper
    • sendToServer

      public void sendToServer(C2SModPacket<?> msg)
      Specified by:
      sendToServer in interface IPlatformHelper
    • getSimpleParticle

      public net.minecraft.core.particles.SimpleParticleType getSimpleParticle()
      Specified by:
      getSimpleParticle in interface IPlatformHelper