Record Class FilteredMessage<T>

java.lang.Object
java.lang.Record
net.minecraft.server.filter.FilteredMessage<T>
Record Components:
raw - the raw (or "original") message
filtered - the filtered message, or null if everything was filtered ("censored")

public record FilteredMessage<T>(T raw, T filtered) extends Record
A message from the TextFilterer.
Mappings:
Namespace Name
official agd
intermediary net/minecraft/class_5837
named net/minecraft/server/filter/FilteredMessage
official b
intermediary comp_841
named raw
official c
intermediary comp_842
named filtered
  • Field Details

    • raw

      private final T raw
      The field for the raw record component.
    • filtered

      @Nullable private final T filtered
      The field for the filtered record component.
    • EMPTY

      public static final FilteredMessage<String> EMPTY
      Mappings:
      Namespace Name Mixin selector
      official a Lagd;a:Lagd;
      intermediary field_28863 Lnet/minecraft/class_5837;field_28863:Lnet/minecraft/class_5837;
      named EMPTY Lnet/minecraft/server/filter/FilteredMessage;EMPTY:Lnet/minecraft/server/filter/FilteredMessage;
  • Constructor Details

    • FilteredMessage

      public FilteredMessage(T t, @Nullable T t2)
  • Method Details

    • permitted

      public static <T> FilteredMessage<T> permitted(T filterable)
      Returns the message with nothing filtered.
      Returns:
      the message with nothing filtered
      Mappings:
      Namespace Name Mixin selector
      official a Lagd;a(Ljava/lang/Object;)Lagd;
      intermediary method_33802 Lnet/minecraft/class_5837;method_33802(Ljava/lang/Object;)Lnet/minecraft/class_5837;
      named permitted Lnet/minecraft/server/filter/FilteredMessage;permitted(Ljava/lang/Object;)Lnet/minecraft/server/filter/FilteredMessage;
    • censored

      public static <T> FilteredMessage<T> censored(T filterable)
      Returns the message with everything filtered.
      Returns:
      the message with everything filtered
      Mappings:
      Namespace Name Mixin selector
      official b Lagd;b(Ljava/lang/Object;)Lagd;
      intermediary method_33804 Lnet/minecraft/class_5837;method_33804(Ljava/lang/Object;)Lnet/minecraft/class_5837;
      named censored Lnet/minecraft/server/filter/FilteredMessage;censored(Ljava/lang/Object;)Lnet/minecraft/server/filter/FilteredMessage;
    • map

      public <U> FilteredMessage<U> map(Function<T,U> mapper)
      Mappings:
      Namespace Name Mixin selector
      official a Lagd;a(Ljava/util/function/Function;)Lagd;
      intermediary method_44151 Lnet/minecraft/class_5837;method_44151(Ljava/util/function/Function;)Lnet/minecraft/class_5837;
      named map Lnet/minecraft/server/filter/FilteredMessage;map(Ljava/util/function/Function;)Lnet/minecraft/server/filter/FilteredMessage;
    • isFiltered

      public boolean isFiltered()
      Returns if some of the messages are filtered.
      Returns:
      if some of the messages are filtered
      Mappings:
      Namespace Name Mixin selector
      official a Lagd;a()Z
      intermediary method_43933 Lnet/minecraft/class_5837;method_43933()Z
      named isFiltered Lnet/minecraft/server/filter/FilteredMessage;isFiltered()Z
    • isCensored

      public boolean isCensored()
      Returns if all of the messages are filtered, e.g. by using censored(T).
      Returns:
      if all of the messages are filtered, e.g. by using censored(T)
      Mappings:
      Namespace Name Mixin selector
      official b Lagd;b()Z
      intermediary method_44152 Lnet/minecraft/class_5837;method_44152()Z
      named isCensored Lnet/minecraft/server/filter/FilteredMessage;isCensored()Z
    • filteredOrElse

      public T filteredOrElse(T filterable)
      Mappings:
      Namespace Name Mixin selector
      official c Lagd;c(Ljava/lang/Object;)Ljava/lang/Object;
      intermediary method_44153 Lnet/minecraft/class_5837;method_44153(Ljava/lang/Object;)Ljava/lang/Object;
      named filteredOrElse Lnet/minecraft/server/filter/FilteredMessage;filteredOrElse(Ljava/lang/Object;)Ljava/lang/Object;
    • getFilterableFor

      @Nullable public T getFilterableFor(ServerPlayerEntity sender, ServerPlayerEntity receiver)
      Mappings:
      Namespace Name Mixin selector
      official a Lagd;a(Lafp;Lafp;)Ljava/lang/Object;
      intermediary method_44149 Lnet/minecraft/class_5837;method_44149(Lnet/minecraft/class_3222;Lnet/minecraft/class_3222;)Ljava/lang/Object;
      named getFilterableFor Lnet/minecraft/server/filter/FilteredMessage;getFilterableFor(Lnet/minecraft/server/network/ServerPlayerEntity;Lnet/minecraft/server/network/ServerPlayerEntity;)Ljava/lang/Object;
    • getFilterableFor

      @Nullable public T getFilterableFor(ServerCommandSource source, ServerPlayerEntity receiver)
      Mappings:
      Namespace Name Mixin selector
      official a Lagd;a(Ldr;Lafp;)Ljava/lang/Object;
      intermediary method_44150 Lnet/minecraft/class_5837;method_44150(Lnet/minecraft/class_2168;Lnet/minecraft/class_3222;)Ljava/lang/Object;
      named getFilterableFor Lnet/minecraft/server/filter/FilteredMessage;getFilterableFor(Lnet/minecraft/server/command/ServerCommandSource;Lnet/minecraft/server/network/ServerPlayerEntity;)Ljava/lang/Object;
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • raw

      public T raw()
      Returns the value of the raw record component.
      Returns:
      the value of the raw record component
    • filtered

      @Nullable public T filtered()
      Returns the value of the filtered record component.
      Returns:
      the value of the filtered record component