Interface IPlayerMatcher

All Superinterfaces:
Predicate<net.minecraft.world.entity.player.Player>
All Known Implementing Classes:
BiomeMatcher, DimensionMatcher, GamestagesMatcher

public interface IPlayerMatcher extends Predicate<net.minecraft.world.entity.player.Player>
A player matcher predicate with potential multiple uses - currently used by the Amadron tablet to check if a particular offer is usable by a player.

This matcher should be able to run on both client and server.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addDescription(net.minecraft.world.entity.player.Player player, List<net.minecraft.network.chat.Component> tooltip)
    Add this matcher's information to a tooltip.
    default void
    standardTooltip(net.minecraft.world.entity.player.Player player, List<net.minecraft.network.chat.Component> tooltip, net.minecraft.network.chat.Component header, List<net.minecraft.network.chat.Component> itemList)
    Utility method to add a standardised tooltip for a matcher.
    void
    toBytes(net.minecraft.network.FriendlyByteBuf buffer)
    Serialize this matcher object to a packet buffer, for sync'ing to clients
    com.google.gson.JsonElement
    Serialize this matcher object to JSON, for data generation.

    Methods inherited from interface java.util.function.Predicate

    and, negate, or, test
  • Method Details

    • toBytes

      void toBytes(net.minecraft.network.FriendlyByteBuf buffer)
      Serialize this matcher object to a packet buffer, for sync'ing to clients
      Parameters:
      buffer - a packet buffer
    • toJson

      com.google.gson.JsonElement toJson()
      Serialize this matcher object to JSON, for data generation.
      Returns:
      a JSON element
    • addDescription

      void addDescription(net.minecraft.world.entity.player.Player player, List<net.minecraft.network.chat.Component> tooltip)
      Add this matcher's information to a tooltip. This is used for example by the Amadron Tablet GUI to show information about this matcher.
      Parameters:
      player - the relevant player
      tooltip - a tooltip list
    • standardTooltip

      default void standardTooltip(net.minecraft.world.entity.player.Player player, List<net.minecraft.network.chat.Component> tooltip, net.minecraft.network.chat.Component header, List<net.minecraft.network.chat.Component> itemList)
      Utility method to add a standardised tooltip for a matcher. Don't override this - it is strongly recommended to call it from addDescription(Player, List) for a consistent tooltip for all matchers.
      Parameters:
      player - the player, as received by addDescription(Player, List)
      tooltip - tooltip to add to, as received by addDescription(Player, List)
      header - the header text line
      itemList - a list of items that this matcher matches against