Record Class BeehiveBlockEntity.Occupant
java.lang.Object
java.lang.Record
net.minecraft.world.level.block.entity.BeehiveBlockEntity.Occupant
- Enclosing class:
BeehiveBlockEntity
public static record BeehiveBlockEntity.Occupant(CustomData entityData, int ticksInHive, int minTicksInHive)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BeehiveBlockEntity.Occupant> private final CustomDataThe field for theentityDatarecord component.static final com.mojang.serialization.Codec<List<BeehiveBlockEntity.Occupant>> private final intThe field for theminTicksInHiverecord component.static final StreamCodec<io.netty.buffer.ByteBuf, BeehiveBlockEntity.Occupant> private final intThe field for theticksInHiverecord component. -
Constructor Summary
ConstructorsConstructorDescriptionOccupant(CustomData entityData, int ticksInHive, int minTicksInHive) Creates an instance of aOccupantrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic BeehiveBlockEntity.Occupantcreate(int p_331115_) createEntity(Level p_331790_, BlockPos p_330712_) Returns the value of theentityDatarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theminTicksInHiverecord component.static BeehiveBlockEntity.Occupantprivate static voidsetBeeReleaseData(int p_331728_, Bee p_331988_) intReturns the value of theticksInHiverecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
entityData
The field for theentityDatarecord component. -
ticksInHive
private final int ticksInHiveThe field for theticksInHiverecord component. -
minTicksInHive
private final int minTicksInHiveThe field for theminTicksInHiverecord component. -
CODEC
-
LIST_CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
Occupant
Creates an instance of aOccupantrecord class.- Parameters:
entityData- the value for theentityDatarecord componentticksInHive- the value for theticksInHiverecord componentminTicksInHive- the value for theminTicksInHiverecord component
-
-
Method Details
-
of
-
create
-
createEntity
-
setBeeReleaseData
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
entityData
Returns the value of theentityDatarecord component.- Returns:
- the value of the
entityDatarecord component
-
ticksInHive
public int ticksInHive()Returns the value of theticksInHiverecord component.- Returns:
- the value of the
ticksInHiverecord component
-
minTicksInHive
public int minTicksInHive()Returns the value of theminTicksInHiverecord component.- Returns:
- the value of the
minTicksInHiverecord component
-