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(TypedEntityData<EntityType<?>> entityData, int ticksInHive, int minTicksInHive)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BeehiveBlockEntity.Occupant> private final TypedEntityData<EntityType<?>> The field for theentityDatarecord component.static final com.mojang.serialization.Codec<List<BeehiveBlockEntity.Occupant>> private final intThe field for theminTicksInHiverecord component.static final StreamCodec<RegistryFriendlyByteBuf, BeehiveBlockEntity.Occupant> private final intThe field for theticksInHiverecord component. -
Constructor Summary
ConstructorsConstructorDescriptionOccupant(TypedEntityData<EntityType<?>> entityData, int ticksInHive, int minTicksInHive) Creates an instance of aOccupantrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic BeehiveBlockEntity.Occupantcreate(int ticksInHive) @Nullable EntitycreateEntity(Level level, BlockPos hivePos) 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 ticksInHive, Bee bee) 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
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
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
-