Class BoxPreviewData
java.lang.Object
com.ldtteam.structurize.storage.rendering.types.BoxPreviewData
Preview data for box contexts.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BoxPreviewData> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, BoxPreviewData> -
Constructor Summary
ConstructorsConstructorDescriptionBoxPreviewData(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2, Optional<net.minecraft.core.BlockPos> anchor) -
Method Summary
Modifier and TypeMethodDescriptionOptional<net.minecraft.core.BlockPos> anchor()booleaninthashCode()booleannet.minecraft.core.BlockPospos1()net.minecraft.core.BlockPospos2()voidsetExpireTime(int seconds) toString()withAnchor(Optional<net.minecraft.core.BlockPos> anchor) Update the anchor position.withCorners(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2) Update the corners.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,BoxPreviewData> STREAM_CODEC
-
-
Constructor Details
-
BoxPreviewData
public BoxPreviewData(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2, Optional<net.minecraft.core.BlockPos> anchor) - Parameters:
pos1- the first pos.pos2- the second pos.anchor- the anchor of the box.
-
-
Method Details
-
withCorners
public BoxPreviewData withCorners(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2) Update the corners.- Parameters:
pos1- the new first corner.pos2- the new second corner.- Returns:
- the new box with updated corners.
-
withAnchor
Update the anchor position.- Parameters:
anchor- the new anchor position.- Returns:
- the new box with updated anchor.
-
isExpired
public boolean isExpired() -
setExpireTime
public void setExpireTime(int seconds) -
pos1
public net.minecraft.core.BlockPos pos1() -
pos2
public net.minecraft.core.BlockPos pos2() -
anchor
-
equals
-
hashCode
public int hashCode() -
toString
-