Record Class MapDecoration
java.lang.Object
java.lang.Record
net.minecraft.world.level.saveddata.maps.MapDecoration
public record MapDecoration(MapDecoration.Type type, byte x, byte y, byte rot, @Nullable Component name, it.unimi.dsi.fastutil.ints.Int2BooleanFunction shouldRenderForIndex)
extends Record
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final ComponentThe field for thenamerecord component.private final byteThe field for therotrecord component.private final it.unimi.dsi.fastutil.ints.Int2BooleanFunctionThe field for theshouldRenderForIndexrecord component.private final MapDecoration.TypeThe field for thetyperecord component.private final byteThe field for thexrecord component.private final byteThe field for theyrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionMapDecoration(MapDecoration.Type type, byte x, byte y, byte rot, Component name) MapDecoration(MapDecoration.Type type, byte x, byte y, byte rot, Component name, it.unimi.dsi.fastutil.ints.Int2BooleanFunction shouldRenderForIndex) Creates an instance of aMapDecorationrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.bytegetImage()final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.booleanrender(int index) Renders this decoration, useful for custom sprite sheets.booleanbyterot()Returns the value of therotrecord component.it.unimi.dsi.fastutil.ints.Int2BooleanFunctionReturns the value of theshouldRenderForIndexrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.bytex()Returns the value of thexrecord component.bytey()Returns the value of theyrecord component.
- 
Field Details- 
typeThe field for thetyperecord component.
- 
xprivate final byte xThe field for thexrecord component.
- 
yprivate final byte yThe field for theyrecord component.
- 
rotprivate final byte rotThe field for therotrecord component.
- 
nameThe field for thenamerecord component.
- 
shouldRenderForIndexprivate final it.unimi.dsi.fastutil.ints.Int2BooleanFunction shouldRenderForIndexThe field for theshouldRenderForIndexrecord component.
 
- 
- 
Constructor Details- 
MapDecoration
- 
MapDecorationpublic MapDecoration(MapDecoration.Type type, byte x, byte y, byte rot, @Nullable Component name, it.unimi.dsi.fastutil.ints.Int2BooleanFunction shouldRenderForIndex) Creates an instance of aMapDecorationrecord class.- Parameters:
- type- the value for the- typerecord component
- x- the value for the- xrecord component
- y- the value for the- yrecord component
- rot- the value for the- rotrecord component
- name- the value for the- namerecord component
- shouldRenderForIndex- the value for the- shouldRenderForIndexrecord component
 
 
- 
- 
Method Details- 
getImagepublic byte getImage()
- 
renderOnFramepublic boolean renderOnFrame()
- 
renderpublic boolean render(int index) Renders this decoration, useful for custom sprite sheets.- Parameters:
- index- The index of this icon in the MapData's list. Used by vanilla to offset the Z-coordinate to prevent Z-fighting
- Returns:
- false to run vanilla logic for this decoration, true to skip it
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='.
- 
typeReturns the value of thetyperecord component.- Returns:
- the value of the typerecord component
 
- 
xpublic byte x()Returns the value of thexrecord component.- Returns:
- the value of the xrecord component
 
- 
ypublic byte y()Returns the value of theyrecord component.- Returns:
- the value of the yrecord component
 
- 
rotpublic byte rot()Returns the value of therotrecord component.- Returns:
- the value of the rotrecord component
 
- 
nameReturns the value of thenamerecord component.- Returns:
- the value of the namerecord component
 
- 
shouldRenderForIndexpublic it.unimi.dsi.fastutil.ints.Int2BooleanFunction shouldRenderForIndex()Returns the value of theshouldRenderForIndexrecord component.- Returns:
- the value of the shouldRenderForIndexrecord component
 
 
-