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
named net/minecraft/util/thread/MessageListener
intermediary net/minecraft/class_3906
official bpj
  • Method Details

    • getName

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

      void send(Msg message)
      Mappings:
      Namespace Name Mixin selector
      named send Lnet/minecraft/util/thread/MessageListener;send(Ljava/lang/Object;)V
      intermediary method_16901 Lnet/minecraft/class_3906;method_16901(Ljava/lang/Object;)V
      official a Lbpj;a(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
      named ask Lnet/minecraft/util/thread/MessageListener;ask(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;
      official b Lbpj;b(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
      named askFallible Lnet/minecraft/util/thread/MessageListener;askFallible(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;
      official c Lbpj;c(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;
    • create

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