Record Class TransportItemsBetweenContainers.TransportItemTarget
java.lang.Object
java.lang.Record
net.minecraft.world.entity.ai.behavior.TransportItemsBetweenContainers.TransportItemTarget
- Enclosing class:
TransportItemsBetweenContainers
public static record TransportItemsBetweenContainers.TransportItemTarget(BlockPos pos, Container container, BlockEntity blockEntity, BlockState state)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockEntityThe field for theblockEntityrecord component.private final ContainerThe field for thecontainerrecord component.private final BlockPosThe field for theposrecord component.private final BlockStateThe field for thestaterecord component. -
Constructor Summary
ConstructorsConstructorDescriptionTransportItemTarget(BlockPos pos, Container container, BlockEntity blockEntity, BlockState state) Creates an instance of aTransportItemTargetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theblockEntityrecord component.Returns the value of thecontainerrecord component.final booleanIndicates whether some other object is "equal to" this one.private static @Nullable ContainergetBlockEntityContainer(BlockEntity pBlockEntity, BlockState pState, Level pLevel, BlockPos pPos) final inthashCode()Returns a hash code value for this object.pos()Returns the value of theposrecord component.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.static @Nullable TransportItemsBetweenContainers.TransportItemTargettryCreatePossibleTarget(BlockPos pPos, Level pLevel) static @Nullable TransportItemsBetweenContainers.TransportItemTargettryCreatePossibleTarget(BlockEntity pBlockEntity, Level pLevel)
-
Field Details
-
pos
The field for theposrecord component. -
container
The field for thecontainerrecord component. -
blockEntity
The field for theblockEntityrecord component. -
state
The field for thestaterecord component.
-
-
Constructor Details
-
TransportItemTarget
public TransportItemTarget(BlockPos pos, Container container, BlockEntity blockEntity, BlockState state) Creates an instance of aTransportItemTargetrecord class.- Parameters:
pos- the value for theposrecord componentcontainer- the value for thecontainerrecord componentblockEntity- the value for theblockEntityrecord componentstate- the value for thestaterecord component
-
-
Method Details
-
tryCreatePossibleTarget
public static @Nullable TransportItemsBetweenContainers.TransportItemTarget tryCreatePossibleTarget(BlockEntity pBlockEntity, Level pLevel) -
tryCreatePossibleTarget
public static @Nullable TransportItemsBetweenContainers.TransportItemTarget tryCreatePossibleTarget(BlockPos pPos, Level pLevel) -
getBlockEntityContainer
private static @Nullable Container getBlockEntityContainer(BlockEntity pBlockEntity, BlockState pState, Level pLevel, BlockPos pPos) -
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). -
pos
Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
container
Returns the value of thecontainerrecord component.- Returns:
- the value of the
containerrecord component
-
blockEntity
Returns the value of theblockEntityrecord component.- Returns:
- the value of the
blockEntityrecord component
-
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-