Class BlueprintPreviewData

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

public class BlueprintPreviewData extends Object
Necessary data for blueprint preview.
  • Constructor Details

    • BlueprintPreviewData

      public BlueprintPreviewData()
      Default constructor to create a new setup.
    • BlueprintPreviewData

      public BlueprintPreviewData(boolean serverSyncEnabled)
      Default constructor to create a new setup.
      Parameters:
      serverSyncEnabled - if false then wont send sync preview messages to server
    • BlueprintPreviewData

      public BlueprintPreviewData(net.minecraft.network.FriendlyByteBuf byteBuf)
      Create blueprint preview data from byteBuf.
      Parameters:
      byteBuf - the buffer data.
    • BlueprintPreviewData

      public BlueprintPreviewData(net.minecraft.network.FriendlyByteBuf byteBuf, boolean serverSyncEnabled)
      Create blueprint preview data from byteBuf.
      Parameters:
      byteBuf - the buffer data.
      serverSyncEnabled - if false then wont send sync preview messages to server
  • Method Details

    • writeToBuf

      public void writeToBuf(net.minecraft.network.FriendlyByteBuf byteBuf)
      Write this preview cache to bytebuf.
      Parameters:
      byteBuf - the buf to write it to.
    • setBlueprintFuture

      public void setBlueprintFuture(Future<Blueprint> blueprintFuture)
      Set the blueprint future.
      Parameters:
      blueprintFuture - the future.
    • setGroundOffset

      public void setGroundOffset(int offset)
      set the y offset between current and original position this also actually adjusts the position -- ensure that's set first
      Parameters:
      offset - the new offset
    • getBlueprint

      public Blueprint getBlueprint()
      Get the current blueprint to render.
      Returns:
      the blueprint or null if not ready yet.
    • setBlueprint

      public void setBlueprint(Blueprint blueprint)
      Set a blueprint that is alreayd loaded.
      Parameters:
      blueprint - the blueprint to set.
    • mirror

      public void mirror()
      Mirror the blueprint.
    • rotate

      public void rotate(net.minecraft.world.level.block.Rotation rotation)
      Rotate the preview by a certain quantity.
      Parameters:
      rotation - the rotation factor.
    • setRotationMirror

      public void setRotationMirror(RotationMirror rotationMirror)
      Rotate/mirror the preview to given value.
      Parameters:
      rotationMirror - new rot/mir for blueprint
    • syncChangesToServer

      public void syncChangesToServer()
      Sync the changes to the server.
    • move

      public void move(net.minecraft.core.BlockPos offset)
      Move this preview by an offset.
      Parameters:
      offset - the offset to move it by.
    • shouldRefresh

      @Deprecated(since="1.20", forRemoval=true) public boolean shouldRefresh()
      Deprecated, for removal: This API element is subject to removal in a future version.
      no longer needed
      Check if the blueprint rendered should refresh the cache.
      Returns:
      true if so.
    • scheduleRefresh

      @Deprecated(since="1.20", forRemoval=true) public void scheduleRefresh()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tell the structurize renderer to refresh the cache.
    • getPlacementSettings

      @Deprecated(since="1.20", forRemoval=true) public PlacementSettings getPlacementSettings()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the placement settings for this instance.
      Returns:
      the placement settings with mirror and rotation.
    • isEmpty

      public boolean isEmpty()
      Check if this is an invalid preview data object.
      Returns:
      true if so.
    • getRotation

      @Deprecated(since="1.20", forRemoval=true) public net.minecraft.world.level.block.Rotation getRotation()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the rotation of the preview.
      Returns:
      the rotation.
    • getMirror

      @Deprecated(since="1.20", forRemoval=true) public net.minecraft.world.level.block.Mirror getMirror()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the mirror of the preview.
      Returns:
      the mirror.
    • getRotationMirror

      public RotationMirror getRotationMirror()
      Get the placement settings for this instance.
      Returns:
      the placement settings with mirror and rotation.
    • getPos

      public net.minecraft.core.BlockPos getPos()
      Get the pos of the preview.
      Returns:
      the pos.
    • setPos

      public void setPos(net.minecraft.core.BlockPos pos)
      Set the position of the preview.
      Parameters:
      pos - the pos to set.
    • getRenderKey

      public RenderingCacheKey getRenderKey()
    • isServerSyncEnabled

      public boolean isServerSyncEnabled()
    • setRenderBlocksNice

      public void setRenderBlocksNice(boolean renderNice)
      Sets whether substitution blocks should render nice
      Parameters:
      renderNice -
    • getRenderBlocksNice

      public boolean getRenderBlocksNice()
      Whether substitution blocks render nice
      Returns:
    • setOverridePreviewTransparency

      public void setOverridePreviewTransparency(float overridePreviewTransparency)
      Overrides client config for preview transparency if already enabled, else does nothing.
      Parameters:
      overridePreviewTransparency - -1 (or any negative) for keep config, 0 = transparent to 1 = opaque
    • getOverridePreviewTransparency

      public float getOverridePreviewTransparency()
    • getSolidSubstitutionOverride

      public net.minecraft.world.level.block.state.BlockState getSolidSubstitutionOverride()
      Get the solid placeholder blockstate override
      Returns:
    • setSolidSubstitutionOverride

      public void setSolidSubstitutionOverride(net.minecraft.world.level.block.state.BlockState solidSubstitutionOverride)
      Set the solid placeholder blockstate override, only updates when the renderer is recalculated