Package net.minecraft.util.thread
Interface MessageListener<Msg>
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
IntegratedServer,MinecraftClient,MinecraftDedicatedServer,MinecraftServer,ReentrantThreadExecutor,ServerChunkManager.MainThreadExecutor,SoundExecutor,TaskExecutor,TestServer,ThreadExecutor
- Mappings:
Namespace Name named net/minecraft/util/thread/MessageListenerintermediary net/minecraft/class_3906official bpj
-
Method Summary
Modifier and TypeMethodDescriptiondefault <Source> CompletableFuture<Source> ask(Function<? super MessageListener<Source>, ? extends Msg> messageProvider) Asks a message provider for a message.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.default voidclose()static <Msg> MessageListener<Msg> getName()void
-
Method Details
-
getName
String getName()- Mappings:
Namespace Name Mixin selector named getNameLnet/minecraft/util/thread/MessageListener;getName()Ljava/lang/String;intermediary method_16898Lnet/minecraft/class_3906;method_16898()Ljava/lang/String;official bzLbpj;bz()Ljava/lang/String;
-
send
- Mappings:
Namespace Name Mixin selector named sendLnet/minecraft/util/thread/MessageListener;send(Ljava/lang/Object;)Vintermediary method_16901Lnet/minecraft/class_3906;method_16901(Ljava/lang/Object;)Vofficial aLbpj;a(Ljava/lang/Object;)V
-
close
default void close()- Specified by:
closein interfaceAutoCloseable
-
ask
default <Source> CompletableFuture<Source> ask(Function<? super MessageListener<Source>, ? extends Msg> messageProvider) Asks a message provider for a message. TheCompletableFuturereturned from this function will never complete exceptionally.- Returns:
- CompletableFuture future that completes with the received message
- Mappings:
Namespace Name Mixin selector named askLnet/minecraft/util/thread/MessageListener;ask(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;intermediary method_17345Lnet/minecraft/class_3906;method_17345(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;official bLbpj;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 aEitherrepresenting 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 askFallibleLnet/minecraft/util/thread/MessageListener;askFallible(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;intermediary method_27918Lnet/minecraft/class_3906;method_27918(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;official cLbpj;c(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;
-
create
- Mappings:
Namespace Name Mixin selector named createLnet/minecraft/util/thread/MessageListener;create(Ljava/lang/String;Ljava/util/function/Consumer;)Lnet/minecraft/util/thread/MessageListener;intermediary method_17344Lnet/minecraft/class_3906;method_17344(Ljava/lang/String;Ljava/util/function/Consumer;)Lnet/minecraft/class_3906;official aLbpj;a(Ljava/lang/String;Ljava/util/function/Consumer;)Lbpj;
-