Interface FabricNetwork<N,DIR>

All Superinterfaces:
mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>

public interface FabricNetwork<N,DIR> extends mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
Abusing interfaces to abstract the hell out of fabric network stuff
  • Field Details

    • IMPL_CLIENT

      static final String IMPL_CLIENT
    • IMPL_CLIENT_CLASS

      static final Class<?> IMPL_CLIENT_CLASS
    • IMPL_SERVER

      static final String IMPL_SERVER
    • IMPL_SERVER_CLASS

      static final Class<?> IMPL_SERVER_CLASS
    • CLIENT_LOGIN

      static final Object CLIENT_LOGIN
    • CLIENT_PLAY

      static final Object CLIENT_PLAY
    • PLAY_CLIENT

      static final String PLAY_CLIENT
    • PLAY_CLIENT_CLASS

      static final Class<?> PLAY_CLIENT_CLASS
    • PLAY_CLIENT_HANDLER_CLASS

      static final Class<?> PLAY_CLIENT_HANDLER_CLASS
    • PROXY_MAP

      static final Map<net.minecraft.resources.ResourceLocation, Object> PROXY_MAP
    • PLAY_SERVER

      static final String PLAY_SERVER
    • PLAY_SERVER_CLASS

      static final Class<?> PLAY_SERVER_CLASS
    • PLAY_SERVER_HANDLER_CLASS

      static final Class<?> PLAY_SERVER_HANDLER_CLASS
    • SERVER_LOGIN

      static final Object SERVER_LOGIN
    • SERVER_PLAY

      static final Object SERVER_PLAY
    • UNLIMITED_ACCOUNTER

      static final net.minecraft.nbt.NbtAccounter UNLIMITED_ACCOUNTER
    • WRAPPED_WRAPPER_CLASS

      static final mods.thecomputerizer.theimpossiblelibrary.api.wrappers.MutableWrapped<Class<?>> WRAPPED_WRAPPER_CLASS
  • Method Details

    • atLeastV20_4

      static boolean atLeastV20_4()
    • atLeastV20_6

      static boolean atLeastV20_6()
    • fabricPkg

      static String fabricPkg(String pkg)
    • getClassIfClient

      @Nullable static @Nullable Class<?> getClassIfClient(String className)
    • getHandlerClassIfClient

      @Nullable static @Nullable Class<?> getHandlerClassIfClient(String baseClass, String oldHandler, String newHandler)
    • getStaticField

      @Nullable static @Nullable Object getStaticField(@Nullable @Nullable Class<?> c, String fieldName)
    • getWrapperClass

      static Class<?> getWrapperClass()
    • initWrapperClass

      static Class<?> initWrapperClass(mods.thecomputerizer.theimpossiblelibrary.api.core.CoreAPI core)
    • tryGetClass

      @Nullable static @Nullable Class<?> tryGetClass(String className)
      The class might not exist
    • tryGetHandlerClass

      @Nullable static @Nullable Class<?> tryGetHandlerClass(String baseClass, String oldHandler, String newHandler)
    • unlimitedAccounter

      static net.minecraft.nbt.NbtAccounter unlimitedAccounter()
    • createHandlerProxy

      @Nullable default @Nullable Object createHandlerProxy(DIR dir, boolean newType)
    • createHandlerProxy

      @Nullable default @Nullable Object createHandlerProxy(Object dir, boolean newType, boolean client, @Nullable @Nullable Class<?> c)
    • createInvoker

      default InvocationHandler createInvoker(Object dir, boolean client, Class<?> c)
    • createInvokerCustomPayload

      default InvocationHandler createInvokerCustomPayload(Object dir, boolean client, Class<?> c)
      Network registration stuff is a bit different in 1.20.6+ and needs a different InvocationHandler
    • encodeMessage

      default net.minecraft.network.FriendlyByteBuf encodeMessage(mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageWrapperAPI<?,?> message)
    • getCheckedDir

      @Nullable default DIR getCheckedDir(mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageDirectionInfo<DIR> info)
      Unwraps MessageDirectionInfo with checks to ensure it is able to get unwrapped on the current side
    • getDirFromName

      default DIR getDirFromName(String name)
      Specified by:
      getDirFromName in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • getDirToClient

      @Nullable default DIR getDirToClient()
      Specified by:
      getDirToClient in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • getDirToClientLogin

      @Nullable default DIR getDirToClientLogin()
      Specified by:
      getDirToClientLogin in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • getDirToServer

      default DIR getDirToServer()
      Specified by:
      getDirToServer in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • getDirToServerLogin

      default DIR getDirToServerLogin()
      Specified by:
      getDirToServerLogin in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • getNameFromDir

      default String getNameFromDir(DIR dir)
      Specified by:
      getNameFromDir in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • getNetwork

      @Nullable default N getNetwork()
      Specified by:
      getNetwork in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • getOppositeDir

      @Nullable default DIR getOppositeDir(DIR dir)
      Specified by:
      getOppositeDir in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • getRegistryName

      default net.minecraft.resources.ResourceLocation getRegistryName(mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageWrapperAPI<?,?> message)
    • getRegistryNameFromDir

      default net.minecraft.resources.ResourceLocation getRegistryNameFromDir(Object dir)
    • getWrapper

      default <CTX> mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageWrapperAPI<?,CTX> getWrapper(Object dir)
    • isDirToClient

      default boolean isDirToClient(DIR dir)
      Specified by:
      isDirToClient in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • isDirLogin

      default boolean isDirLogin(DIR dir)
      Specified by:
      isDirLogin in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • readResourceLocation

      default mods.thecomputerizer.theimpossiblelibrary.api.resource.ResourceLocationAPI<?> readResourceLocation(io.netty.buffer.ByteBuf buf)
      Specified by:
      readResourceLocation in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • readTag

      default mods.thecomputerizer.theimpossiblelibrary.api.tag.CompoundTagAPI<?> readTag(io.netty.buffer.ByteBuf buf)
      Specified by:
      readTag in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • receiveAndRespond

      default <P, CTX, M extends mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageWrapperAPI<P,CTX>> void receiveAndRespond(Object dir, Object buf, CTX ctx, @Nullable P player)
    • receiveAndRespond

      default <P, CTX, M extends mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageWrapperAPI<P,CTX>> void receiveAndRespond(M wrapper, CTX ctx, @Nullable P player)
    • registerMessage

      default void registerMessage(mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageDirectionInfo<DIR> directionInfo, int id)
      Specified by:
      registerMessage in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • registerMessageCustomPayload

      default void registerMessageCustomPayload(mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageDirectionInfo<DIR> directionInfo, Function<DIR,Object> codecBuilder)
      Network registration stuff is a bit different in 1.20.6+ and needs to be handled separately
    • registerWithProxy

      default boolean registerWithProxy(boolean client, Object registerAs, Object proxy)
    • sendToPlayer

      default <P, M extends mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageWrapperAPI<?,?>> void sendToPlayer(M message, P player)
      Specified by:
      sendToPlayer in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • sendToPlayer

      default <P, M extends mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageWrapperAPI<?,?>> void sendToPlayer(M message, P player, boolean newType)
    • sendToServer

      default <M extends mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageWrapperAPI<?,?>> void sendToServer(M message)
      Specified by:
      sendToServer in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • sendToServer

      default <M extends mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageWrapperAPI<?,?>> void sendToServer(M message, boolean newType)
    • wrapMessage

      default <CTX> mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageWrapperAPI<?,CTX> wrapMessage(DIR dir, mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageAPI<CTX> message)
      Specified by:
      wrapMessage in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • wrapMessages

      default <CTX> mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageWrapperAPI<?,CTX> wrapMessages(DIR dir, mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageAPI<CTX>... messages)
      Specified by:
      wrapMessages in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • wrapMessages

      default <CTX> mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageWrapperAPI<?,CTX> wrapMessages(DIR dir, Collection<mods.thecomputerizer.theimpossiblelibrary.api.network.message.MessageAPI<CTX>> messages)
      Specified by:
      wrapMessages in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>
    • writeTag

      default void writeTag(io.netty.buffer.ByteBuf buf, mods.thecomputerizer.theimpossiblelibrary.api.tag.CompoundTagAPI<?> tag)
      Specified by:
      writeTag in interface mods.thecomputerizer.theimpossiblelibrary.api.network.NetworkAPI<N,DIR>