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/MessageListener
intermediary net/minecraft/class_3906
official bpn
-
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 void
close()
static <Msg> MessageListener
<Msg> getName()
void
-
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 by
Lbpn;by()Ljava/lang/String;
-
send
- 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
Lbpn;a(Ljava/lang/Object;)V
-
close
default void close()- Specified by:
close
in interfaceAutoCloseable
-
ask
default <Source> CompletableFuture<Source> ask(Function<? super MessageListener<Source>, ? extends Msg> messageProvider) Asks a message provider for a message. TheCompletableFuture
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
Lbpn;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 aEither
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
Lbpn;c(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;
-
create
- 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
Lbpn;a(Ljava/lang/String;Ljava/util/function/Consumer;)Lbpn;
-