Package net.minecraft.network.message
Class CachedDecoratorResult
java.lang.Object
net.minecraft.network.message.CachedDecoratorResult
The cached result of
MessageDecorator
's decorated message.
The result is cached per player, and is consumed when the message is actually sent. Caching allows the decorator's result to be not pure (e.g. uses externally controlled variables), as decorators that produce different results on the second execution at submission time do not affect the verification.
- Mappings:
Namespace Name official rj
intermediary net/minecraft/class_7642
named net/minecraft/network/message/CachedDecoratorResult
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static final record
The cached result. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
setCachedResult
(String query, Text preview) Sets the cached result topreview
forquery
.tryConsume
(String query) Consumes the cached result if possible.
-
Field Details
-
cachedResult
- Mappings:
Namespace Name Mixin selector official a
Lrj;a:Lrj$a;
intermediary field_39909
Lnet/minecraft/class_7642;field_39909:Lnet/minecraft/class_7642$class_7643;
named cachedResult
Lnet/minecraft/network/message/CachedDecoratorResult;cachedResult:Lnet/minecraft/network/message/CachedDecoratorResult$Cache;
-
-
Constructor Details
-
CachedDecoratorResult
public CachedDecoratorResult()
-
-
Method Details
-
setCachedResult
Sets the cached result topreview
forquery
.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lrj;a(Ljava/lang/String;Lrq;)V
intermediary method_45036
Lnet/minecraft/class_7642;method_45036(Ljava/lang/String;Lnet/minecraft/class_2561;)V
named setCachedResult
Lnet/minecraft/network/message/CachedDecoratorResult;setCachedResult(Ljava/lang/String;Lnet/minecraft/text/Text;)V
-
tryConsume
Consumes the cached result if possible.The result can only be consumed if it exists and the cached query equals
query
. After consuming, the cached result is set tonull
.- Returns:
- the cached result, or
null
if it cannot be consumed - Mappings:
Namespace Name Mixin selector official a
Lrj;a(Ljava/lang/String;)Lrq;
intermediary method_45035
Lnet/minecraft/class_7642;method_45035(Ljava/lang/String;)Lnet/minecraft/class_2561;
named tryConsume
Lnet/minecraft/network/message/CachedDecoratorResult;tryConsume(Ljava/lang/String;)Lnet/minecraft/text/Text;
-