Interface MessageListener<Msg>

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
IntegratedServer, MinecraftClient, MinecraftDedicatedServer, MinecraftServer, ReentrantThreadExecutor, ServerChunkManager.MainThreadExecutor, SoundExecutor, TaskExecutor, TestServer, ThreadExecutor

public interface MessageListener<Msg> extends AutoCloseable
Mappings:
Namespace Name
official bcp
intermediary net/minecraft/class_3906
named net/minecraft/util/thread/MessageListener
  • Method Details

    • getName

      String getName()
      Mappings:
      Namespace Name Mixin selector
      official bn Lbcp;bn()Ljava/lang/String;
      intermediary method_16898 Lnet/minecraft/class_3906;method_16898()Ljava/lang/String;
      named getName Lnet/minecraft/util/thread/MessageListener;getName()Ljava/lang/String;
    • send

      void send(Msg message)
      Mappings:
      Namespace Name Mixin selector
      official a Lbcp;a(Ljava/lang/Object;)V
      intermediary method_16901 Lnet/minecraft/class_3906;method_16901(Ljava/lang/Object;)V
      named send Lnet/minecraft/util/thread/MessageListener;send(Ljava/lang/Object;)V
    • close

      default void close()
      Specified by:
      close in interface AutoCloseable
    • ask

      default <Source> CompletableFuture<Source> ask(Function<? super MessageListener<Source>,? extends Msg> messageProvider)
      Asks a message provider for a message. The CompletableFuture returned from this function will never complete exceptionally.
      Returns:
      CompletableFuture future that completes with the received message
      Mappings:
      Namespace Name Mixin selector
      official b Lbcp;b(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;
      intermediary method_17345 Lnet/minecraft/class_3906;method_17345(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;
      named ask Lnet/minecraft/util/thread/MessageListener;ask(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;
    • askFallible

      default <Source> CompletableFuture<Source> askFallible(Function<? super MessageListener<com.mojang.datafixers.util.Either<Source,Exception>>,? extends Msg> messageProvider)
      Asks a fallible message provider for a message. The provider is given a MessageListener that accepts a Either representing either a valid response (generic parameter Source) or an Exception, which decides whether the future completes successfully or exceptionally.
      Returns:
      CompletableFuture that may either complete successfully or exceptionally
      Mappings:
      Namespace Name Mixin selector
      official c Lbcp;c(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;
      intermediary method_27918 Lnet/minecraft/class_3906;method_27918(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;
      named askFallible Lnet/minecraft/util/thread/MessageListener;askFallible(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;
    • create

      static <Msg> MessageListener<Msg> create(String name, Consumer<Msg> action)
      Mappings:
      Namespace Name Mixin selector
      official a Lbcp;a(Ljava/lang/String;Ljava/util/function/Consumer;)Lbcp;
      intermediary method_17344 Lnet/minecraft/class_3906;method_17344(Ljava/lang/String;Ljava/util/function/Consumer;)Lnet/minecraft/class_3906;
      named create Lnet/minecraft/util/thread/MessageListener;create(Ljava/lang/String;Ljava/util/function/Consumer;)Lnet/minecraft/util/thread/MessageListener;