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 aBadgeCase
record 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 thebadges
record component.color()
Returns the value of thecolor
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
isOwner
(net.minecraft.world.entity.player.Player player) boolean
net.minecraft.network.chat.Component
owner()
Returns the value of theowner
record component.swapBadges
(net.minecraft.world.item.ItemStack item1, net.minecraft.world.item.ItemStack item2) final String
toString()
Returns a string representation of this record class.uuid()
Returns the value of theuuid
record 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 aBadgeCase
record class.- Parameters:
uuid
- the value for theuuid
record componentowner
- the value for theowner
record componentcolor
- the value for thecolor
record componentbadges
- the value for thebadges
record 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 theuuid
record component.- Returns:
- the value of the
uuid
record component
-
owner
public net.minecraft.network.chat.Component owner()Returns the value of theowner
record component.- Returns:
- the value of the
owner
record component
-
color
Returns the value of thecolor
record component.- Returns:
- the value of the
color
record component
-
badges
Returns the value of thebadges
record component.- Returns:
- the value of the
badges
record component
-