Class BoxPreviewData

java.lang.Object
com.ldtteam.structurize.storage.rendering.types.BoxPreviewData

public final class BoxPreviewData extends Object
Preview data for box contexts.
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<BoxPreviewData> 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

      public BoxPreviewData withAnchor(Optional<net.minecraft.core.BlockPos> anchor)
      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

      public Optional<net.minecraft.core.BlockPos> anchor()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object