Record Class AutoRequestData
java.lang.Object
java.lang.Record
com.simibubi.create.content.logistics.redstoneRequester.AutoRequestData
public record AutoRequestData(PackageOrder encodedRequest, PackageOrder encodedRequestContext, String encodedTargetAddress, net.minecraft.core.BlockPos targetOffset, String targetDim, boolean isValid)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AutoRequestData> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, AutoRequestData> -
Constructor Summary
ConstructorsConstructorDescriptionAutoRequestData(PackageOrder encodedRequest, PackageOrder encodedRequestContext, String encodedTargetAddress, net.minecraft.core.BlockPos targetOffset, String targetDim, boolean isValid) Creates an instance of aAutoRequestDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theencodedRequestrecord component.Returns the value of theencodedRequestContextrecord component.Returns the value of theencodedTargetAddressrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisValid()Returns the value of theisValidrecord component.static AutoRequestDatareadFromItem(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos position, net.minecraft.world.item.ItemStack itemStack) Returns the value of thetargetDimrecord component.net.minecraft.core.BlockPosReturns the value of thetargetOffsetrecord component.final StringtoString()Returns a string representation of this record class.voidwriteToItem(net.minecraft.core.BlockPos position, net.minecraft.world.item.ItemStack itemStack)
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,AutoRequestData> STREAM_CODEC
-
-
Constructor Details
-
AutoRequestData
public AutoRequestData() -
AutoRequestData
public AutoRequestData(PackageOrder encodedRequest, PackageOrder encodedRequestContext, String encodedTargetAddress, net.minecraft.core.BlockPos targetOffset, String targetDim, boolean isValid) Creates an instance of aAutoRequestDatarecord class.- Parameters:
encodedRequest- the value for theencodedRequestrecord componentencodedRequestContext- the value for theencodedRequestContextrecord componentencodedTargetAddress- the value for theencodedTargetAddressrecord componenttargetOffset- the value for thetargetOffsetrecord componenttargetDim- the value for thetargetDimrecord componentisValid- the value for theisValidrecord component
-
-
Method Details
-
writeToItem
public void writeToItem(net.minecraft.core.BlockPos position, net.minecraft.world.item.ItemStack itemStack) -
readFromItem
public static AutoRequestData readFromItem(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos position, net.minecraft.world.item.ItemStack itemStack) -
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 '=='. -
encodedRequest
Returns the value of theencodedRequestrecord component.- Returns:
- the value of the
encodedRequestrecord component
-
encodedRequestContext
Returns the value of theencodedRequestContextrecord component.- Returns:
- the value of the
encodedRequestContextrecord component
-
encodedTargetAddress
Returns the value of theencodedTargetAddressrecord component.- Returns:
- the value of the
encodedTargetAddressrecord component
-
targetOffset
public net.minecraft.core.BlockPos targetOffset()Returns the value of thetargetOffsetrecord component.- Returns:
- the value of the
targetOffsetrecord component
-
targetDim
Returns the value of thetargetDimrecord component.- Returns:
- the value of the
targetDimrecord component
-
isValid
public boolean isValid()Returns the value of theisValidrecord component.- Returns:
- the value of the
isValidrecord component
-