Class CompatModule<T>

java.lang.Object
com.hammy275.immersivemc.common.compat.util.CompatModule<T>
Type Parameters:
T - Object type for compatibility module.
All Implemented Interfaces:
InvocationHandler

public class CompatModule<T> extends Object implements InvocationHandler
Compatibility module to allow us to easily add mod integration that fails gracefully.
  • Method Details

    • create

      public static <T extends I, I> I create(T module, Class<I> interfaceClass, CompatData compatData)
      Creates a compatibility module.
      Type Parameters:
      T - Object type for compatibility module.
      Parameters:
      module - The module to wrap.
      interfaceClass - The interface that module implements.
      compatData - Compatibility data.
      Returns:
      The module wrapped in compatibility.
    • create

      public static <S extends NetworkStorage> ImmersiveHandler<S> create(ImmersiveHandler<S> handler, CompatData compatData)
      Creates a compatibility module for an ImmersiveHandler.
      Type Parameters:
      S - The NetworkStorage type of the ImmersiveHandler.
      Parameters:
      handler - ImmersiveHandler to wrap.
      compatData - Compatibility data.
      Returns:
      The ImmersiveHandler wrapped in compatibility.
    • invoke

      public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
      Specified by:
      invoke in interface InvocationHandler
      Throws:
      Throwable
    • handleDisableServer

      public static void handleDisableServer(CompatData compatData, net.minecraft.server.MinecraftServer server)
    • getErrorMessage

      public static net.minecraft.network.chat.Component getErrorMessage(String friendlyName)