Record Class RocketDestination
java.lang.Object
java.lang.Record
com.lightning.northstar.contraption.rocket.RocketDestination
- Record Components:
dim- the target dimension, never nullpos- the waypoint position, if null the rocket stays at the same positiondir- 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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<RocketDestination> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, RocketDestination> -
Constructor Summary
ConstructorsConstructorDescriptionRocketDestination(net.minecraft.resources.ResourceLocation dim, @Nullable net.minecraft.core.BlockPos pos, @Nullable net.minecraft.core.Direction dir) Creates an instance of aRocketDestinationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.ResourceLocationdim()Returns the value of thedimrecord component.net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimKey()@Nullable net.minecraft.core.Directiondir()Returns the value of thedirrecord component.final booleanIndicates whether some other object is "equal to" this one.static @Nullable RocketDestinationfromTag(net.minecraft.nbt.CompoundTag tag) final inthashCode()Returns a hash code value for this object.@Nullable net.minecraft.core.BlockPospos()Returns the value of theposrecord component.final StringtoString()Returns a string representation of this record class.net.minecraft.nbt.CompoundTagtoTag()
-
Field Details
-
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 aRocketDestinationrecord class.
-
-
Method Details
-
dimKey
public net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimKey() -
toTag
public net.minecraft.nbt.CompoundTag toTag() -
fromTag
-
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). -
dim
public net.minecraft.resources.ResourceLocation dim()Returns the value of thedimrecord component.- Returns:
- the value of the
dimrecord component
-
pos
@Nullable public @Nullable net.minecraft.core.BlockPos pos()Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
dir
@Nullable public @Nullable net.minecraft.core.Direction dir()Returns the value of thedirrecord component.- Returns:
- the value of the
dirrecord component
-