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
Modifier and TypeFieldDescriptionprivate final DispenserBlockEntity
The field for theblockEntity
record component.private final ServerLevel
The field for thelevel
record component.private final BlockPos
The field for thepos
record component.private final BlockState
The field for thestate
record component. -
Constructor Summary
ConstructorDescriptionBlockSource
(ServerLevel level, BlockPos pos, BlockState state, DispenserBlockEntity blockEntity) Creates an instance of aBlockSource
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theblockEntity
record component.center()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.level()
Returns the value of thelevel
record component.pos()
Returns the value of thepos
record component.state()
Returns the value of thestate
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
level
The field for thelevel
record component. -
pos
The field for thepos
record component. -
state
The field for thestate
record component. -
blockEntity
The field for theblockEntity
record component.
-
-
Constructor Details
-
BlockSource
public BlockSource(ServerLevel level, BlockPos pos, BlockState state, DispenserBlockEntity blockEntity) Creates an instance of aBlockSource
record class.- Parameters:
level
- the value for thelevel
record componentpos
- the value for thepos
record componentstate
- the value for thestate
record componentblockEntity
- the value for theblockEntity
record 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 thelevel
record component.- Returns:
- the value of the
level
record component
-
pos
Returns the value of thepos
record component.- Returns:
- the value of the
pos
record component
-
state
Returns the value of thestate
record component.- Returns:
- the value of the
state
record component
-
blockEntity
Returns the value of theblockEntity
record component.- Returns:
- the value of the
blockEntity
record component
-