Record Class AutoRequestData

java.lang.Object
java.lang.Record
com.simibubi.create.content.logistics.redstoneRequester.AutoRequestData

public record AutoRequestData(PackageOrderWithCrafts encodedRequest, String encodedTargetAddress, net.minecraft.core.BlockPos targetOffset, String targetDim, boolean isValid) extends Record
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<AutoRequestData>
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,AutoRequestData>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    AutoRequestData(PackageOrderWithCrafts encodedRequest, String encodedTargetAddress, net.minecraft.core.BlockPos targetOffset, String targetDim, boolean isValid)
    Creates an instance of a AutoRequestData record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the encodedRequest record component.
    Returns the value of the encodedTargetAddress record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the isValid record component.
    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)
     
    Returns the value of the targetDim record component.
    net.minecraft.core.BlockPos
    Returns the value of the targetOffset record component.
    final String
    Returns a string representation of this record class.
    void
    writeToItem(net.minecraft.core.BlockPos position, net.minecraft.world.item.ItemStack itemStack)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<AutoRequestData> 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(PackageOrderWithCrafts encodedRequest, String encodedTargetAddress, net.minecraft.core.BlockPos targetOffset, String targetDim, boolean isValid)
      Creates an instance of a AutoRequestData record class.
      Parameters:
      encodedRequest - the value for the encodedRequest record component
      encodedTargetAddress - the value for the encodedTargetAddress record component
      targetOffset - the value for the targetOffset record component
      targetDim - the value for the targetDim record component
      isValid - the value for the isValid record 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • encodedRequest

      public PackageOrderWithCrafts encodedRequest()
      Returns the value of the encodedRequest record component.
      Returns:
      the value of the encodedRequest record component
    • encodedTargetAddress

      public String encodedTargetAddress()
      Returns the value of the encodedTargetAddress record component.
      Returns:
      the value of the encodedTargetAddress record component
    • targetOffset

      public net.minecraft.core.BlockPos targetOffset()
      Returns the value of the targetOffset record component.
      Returns:
      the value of the targetOffset record component
    • targetDim

      public String targetDim()
      Returns the value of the targetDim record component.
      Returns:
      the value of the targetDim record component
    • isValid

      public boolean isValid()
      Returns the value of the isValid record component.
      Returns:
      the value of the isValid record component