Record Class RocketDestination

java.lang.Object
java.lang.Record
com.lightning.northstar.contraption.rocket.RocketDestination
Record Components:
dim - the target dimension, never null
pos - the waypoint position, if null the rocket stays at the same position
dir - the waypoint direction

@ParametersAreNonnullByDefault public record RocketDestination(net.minecraft.resources.ResourceLocation dim, @Nullable net.minecraft.core.BlockPos pos, @Nullable net.minecraft.core.Direction dir) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<RocketDestination>
     
    static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,RocketDestination>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RocketDestination(net.minecraft.resources.ResourceLocation dim, @Nullable net.minecraft.core.BlockPos pos, @Nullable net.minecraft.core.Direction dir)
    Creates an instance of a RocketDestination record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.resources.ResourceLocation
    dim()
    Returns the value of the dim record component.
    net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>
     
    @Nullable net.minecraft.core.Direction
    dir()
    Returns the value of the dir record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    static @Nullable RocketDestination
    fromTag(net.minecraft.nbt.CompoundTag tag)
     
    final int
    Returns a hash code value for this object.
    @Nullable net.minecraft.core.BlockPos
    pos()
    Returns the value of the pos record component.
    final String
    Returns a string representation of this record class.
    net.minecraft.nbt.CompoundTag
     

    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<RocketDestination> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,RocketDestination> STREAM_CODEC
  • Constructor Details

    • RocketDestination

      public RocketDestination(net.minecraft.resources.ResourceLocation dim, @Nullable @Nullable net.minecraft.core.BlockPos pos, @Nullable @Nullable net.minecraft.core.Direction dir)
      Creates an instance of a RocketDestination record class.
      Parameters:
      dim - the value for the dim record component
      pos - the value for the pos record component
      dir - the value for the dir record component
  • Method Details

    • dimKey

      public net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimKey()
    • toTag

      public net.minecraft.nbt.CompoundTag toTag()
    • fromTag

      @Nullable public static @Nullable RocketDestination fromTag(net.minecraft.nbt.CompoundTag tag)
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • dim

      public net.minecraft.resources.ResourceLocation dim()
      Returns the value of the dim record component.
      Returns:
      the value of the dim record component
    • pos

      @Nullable public @Nullable net.minecraft.core.BlockPos pos()
      Returns the value of the pos record component.
      Returns:
      the value of the pos record component
    • dir

      @Nullable public @Nullable net.minecraft.core.Direction dir()
      Returns the value of the dir record component.
      Returns:
      the value of the dir record component