Class CachedDecoratorResult

java.lang.Object
net.minecraft.network.message.CachedDecoratorResult

public class CachedDecoratorResult extends Object
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
  • 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

      public void setCachedResult(String query, Text preview)
      Sets the cached result to preview for query.
      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

      @Nullable public @Nullable Text tryConsume(String query)
      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 to null.

      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;