Record Class StyleTable
java.lang.Object
java.lang.Record
cromveil.combatnumbers.styles.StyleTable
public record StyleTable(List<net.minecraft.resources.Identifier> skinIds, List<net.minecraft.resources.Identifier> animationIds)
extends Record
The finite, ordered set of skin and animation ids the server's rules can
emit. The server builds this from the RuleEngine after a styles syncs it to
clients. We then reference entries by index instead of sending full ids,
keeping packets lean.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStyleTable(List<net.minecraft.resources.Identifier> skinIds, List<net.minecraft.resources.Identifier> animationIds) Creates an instance of aStyleTablerecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.IdentifieranimationAt(int index) List<net.minecraft.resources.Identifier> Returns the value of theanimationIdsrecord component.intanimationIndex(net.minecraft.resources.Identifier id) final booleanIndicates whether some other object is "equal to" this one.static StyleTablefrom(RuleEngine engine) final inthashCode()Returns a hash code value for this object.net.minecraft.resources.IdentifierskinAt(int index) List<net.minecraft.resources.Identifier> skinIds()Returns the value of theskinIdsrecord component.intskinIndex(net.minecraft.resources.Identifier id) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
StyleTable
public StyleTable(List<net.minecraft.resources.Identifier> skinIds, List<net.minecraft.resources.Identifier> animationIds) Creates an instance of aStyleTablerecord class.- Parameters:
skinIds- the value for theskinIdsrecord componentanimationIds- the value for theanimationIdsrecord component
-
-
Method Details
-
from
-
skinIndex
public int skinIndex(net.minecraft.resources.Identifier id) - Returns:
- index of the id, or -1 if absent/null (meaning "no opinion").
-
animationIndex
public int animationIndex(net.minecraft.resources.Identifier id) - See Also:
-
skinAt
public net.minecraft.resources.Identifier skinAt(int index) - Returns:
- the id at the index, or null if out of range.
-
animationAt
public net.minecraft.resources.Identifier animationAt(int index) - See Also:
-
toString
-
hashCode
-
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). -
skinIds
Returns the value of theskinIdsrecord component.- Returns:
- the value of the
skinIdsrecord component
-
animationIds
Returns the value of theanimationIdsrecord component.- Returns:
- the value of the
animationIdsrecord component
-