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 rjintermediary net/minecraft/class_7642named net/minecraft/network/message/CachedDecoratorResult
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordThe cached result. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetCachedResult(String query, Text preview) Sets the cached result topreviewforquery.tryConsume(String query) Consumes the cached result if possible.
-
Field Details
-
cachedResult
- Mappings:
Namespace Name Mixin selector official aLrj;a:Lrj$a;intermediary field_39909Lnet/minecraft/class_7642;field_39909:Lnet/minecraft/class_7642$class_7643;named cachedResultLnet/minecraft/network/message/CachedDecoratorResult;cachedResult:Lnet/minecraft/network/message/CachedDecoratorResult$Cache;
-
-
Constructor Details
-
CachedDecoratorResult
public CachedDecoratorResult()
-
-
Method Details
-
setCachedResult
Sets the cached result topreviewforquery.- See Also:
- Mappings:
Namespace Name Mixin selector official aLrj;a(Ljava/lang/String;Lrq;)Vintermediary method_45036Lnet/minecraft/class_7642;method_45036(Ljava/lang/String;Lnet/minecraft/class_2561;)Vnamed setCachedResultLnet/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
nullif it cannot be consumed - Mappings:
Namespace Name Mixin selector official aLrj;a(Ljava/lang/String;)Lrq;intermediary method_45035Lnet/minecraft/class_7642;method_45035(Ljava/lang/String;)Lnet/minecraft/class_2561;named tryConsumeLnet/minecraft/network/message/CachedDecoratorResult;tryConsume(Ljava/lang/String;)Lnet/minecraft/text/Text;
-