Package com.pixelmonmod.pixelmon.items
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BadgeCaseItem.BadgeCase> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, BadgeCaseItem.BadgeCase> -
Constructor Summary
ConstructorsConstructorDescriptionBadgeCase(BadgeCaseColor color) BadgeCase(UUID uuid, net.minecraft.network.chat.Component owner, BadgeCaseColor color, List<net.minecraft.world.item.ItemStack> badges) Creates an instance of aBadgeCaserecord class.BadgeCase(net.minecraft.world.entity.player.Player player, BadgeCaseColor color) -
Method Summary
Modifier and TypeMethodDescriptionList<net.minecraft.world.item.ItemStack> badges()Returns the value of thebadgesrecord component.color()Returns the value of thecolorrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisOwner(net.minecraft.world.entity.player.Player player) booleannet.minecraft.network.chat.Componentowner()Returns the value of theownerrecord component.swapBadges(net.minecraft.world.item.ItemStack item1, net.minecraft.world.item.ItemStack item2) final StringtoString()Returns a string representation of this record class.uuid()Returns the value of theuuidrecord component.withBadges(Collection<net.minecraft.world.item.ItemStack> items) withBadges(net.minecraft.world.item.ItemStack... items) withColor(BadgeCaseColor color) withoutBadges(Collection<net.minecraft.world.item.ItemStack> items) withoutBadges(net.minecraft.world.item.ItemStack... items) withOwner(net.minecraft.world.entity.player.Player player)
-
Field Details
-
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 aBadgeCaserecord class.- Parameters:
uuid- the value for theuuidrecord componentowner- the value for theownerrecord componentcolor- the value for thecolorrecord componentbadges- the value for thebadgesrecord component
-
BadgeCase
-
BadgeCase
-
-
Method Details
-
isOwner
public boolean isOwner(net.minecraft.world.entity.player.Player player) -
isRegistered
public boolean isRegistered() -
withBadges
-
withOwner
-
withBadges
-
withColor
-
withoutBadges
-
withoutBadges
-
swapBadges
public BadgeCaseItem.BadgeCase swapBadges(net.minecraft.world.item.ItemStack item1, net.minecraft.world.item.ItemStack item2) -
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
uuid
Returns the value of theuuidrecord component.- Returns:
- the value of the
uuidrecord component
-
owner
public net.minecraft.network.chat.Component owner()Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-
color
Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord component
-
badges
Returns the value of thebadgesrecord component.- Returns:
- the value of the
badgesrecord component
-