Package net.minecraft.core.dispenser
Record Class BlockSource
java.lang.Object
java.lang.Record
net.minecraft.core.dispenser.BlockSource
public record BlockSource(ServerLevel level, BlockPos pos, BlockState state, DispenserBlockEntity blockEntity)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DispenserBlockEntityThe field for theblockEntityrecord component.private final ServerLevelThe field for thelevelrecord component.private final BlockPosThe field for theposrecord component.private final BlockStateThe field for thestaterecord component. -
Constructor Summary
ConstructorsConstructorDescriptionBlockSource(ServerLevel level, BlockPos pos, BlockState state, DispenserBlockEntity blockEntity) Creates an instance of aBlockSourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theblockEntityrecord component.center()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.level()Returns the value of thelevelrecord component.pos()Returns the value of theposrecord component.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
level
The field for thelevelrecord component. -
pos
The field for theposrecord component. -
state
The field for thestaterecord component. -
blockEntity
The field for theblockEntityrecord component.
-
-
Constructor Details
-
BlockSource
public BlockSource(ServerLevel level, BlockPos pos, BlockState state, DispenserBlockEntity blockEntity) Creates an instance of aBlockSourcerecord class.- Parameters:
level- the value for thelevelrecord componentpos- the value for theposrecord componentstate- the value for thestaterecord componentblockEntity- the value for theblockEntityrecord component
-
-
Method Details
-
center
-
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). -
level
Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-
pos
Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
blockEntity
Returns the value of theblockEntityrecord component.- Returns:
- the value of the
blockEntityrecord component
-