Record Class BadgeCaseItem.BadgeCase

java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.items.BadgeCaseItem.BadgeCase
Enclosing class:
BadgeCaseItem

public static record BadgeCaseItem.BadgeCase(UUID uuid, net.minecraft.network.chat.Component owner, BadgeCaseColor color, List<net.minecraft.world.item.ItemStack> badges) extends Record
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<BadgeCaseItem.BadgeCase> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,BadgeCaseItem.BadgeCase> STREAM_CODEC
  • Constructor Details

    • BadgeCase

      public BadgeCase(UUID uuid, net.minecraft.network.chat.Component owner, BadgeCaseColor color, List<net.minecraft.world.item.ItemStack> badges)
      Creates an instance of a BadgeCase record class.
      Parameters:
      uuid - the value for the uuid record component
      owner - the value for the owner record component
      color - the value for the color record component
      badges - the value for the badges record component
    • BadgeCase

      public BadgeCase(net.minecraft.world.entity.player.Player player, BadgeCaseColor color)
    • BadgeCase

      public BadgeCase(BadgeCaseColor color)
  • Method Details

    • isOwner

      public boolean isOwner(net.minecraft.world.entity.player.Player player)
    • isRegistered

      public boolean isRegistered()
    • withBadges

      public BadgeCaseItem.BadgeCase withBadges(net.minecraft.world.item.ItemStack... items)
    • withOwner

      public BadgeCaseItem.BadgeCase withOwner(net.minecraft.world.entity.player.Player player)
    • withBadges

      public BadgeCaseItem.BadgeCase withBadges(Collection<net.minecraft.world.item.ItemStack> items)
    • withColor

      public BadgeCaseItem.BadgeCase withColor(BadgeCaseColor color)
    • withoutBadges

      public BadgeCaseItem.BadgeCase withoutBadges(net.minecraft.world.item.ItemStack... items)
    • withoutBadges

      public BadgeCaseItem.BadgeCase withoutBadges(Collection<net.minecraft.world.item.ItemStack> items)
    • swapBadges

      public BadgeCaseItem.BadgeCase swapBadges(net.minecraft.world.item.ItemStack item1, net.minecraft.world.item.ItemStack item2)
    • 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 o)
      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:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • uuid

      public UUID uuid()
      Returns the value of the uuid record component.
      Returns:
      the value of the uuid record component
    • owner

      public net.minecraft.network.chat.Component owner()
      Returns the value of the owner record component.
      Returns:
      the value of the owner record component
    • color

      public BadgeCaseColor color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • badges

      public List<net.minecraft.world.item.ItemStack> badges()
      Returns the value of the badges record component.
      Returns:
      the value of the badges record component