Scan - hzFishy/StructureCCloner GitHub Wiki

Submodes

Scanning methods

Hollow* Full Keep* Full
Default, doesn't get blocks behind others Destroy and replace blocks to scan ALL blocks Destroy ALL blocks, no replacing

*Not implemented yet


Setup

Before going any further you must have followed the global setup

Extra note: You can enable DiscordHook so you will be notified of what is happening in game inside Discord ! See config


Example of a setup

image

  • blue the fuel chest (the small square represents the fuel chest coords that were given in the config file)
  • red the drop off chest (the small square represents the drop off chest coords that were given in the config file)
  • green the zone where the scan will be
  • yellow the turtle

How to scan

  1. See known limitations ⚠️
  2. Do setup
  3. Start the turtle
  4. Select scan mode
  5. Enter the required inputs

    Start & End vector points (How to choose , Examples)

  6. Select a submode

    See Submodes

  7. Let the scan run and finish
  8. At the end (if autoupload is false) a prompt will appear asking if you want to upload your scan file result file to the StrcutureCCloner web storage or pastebin.

Examples

Basic

The turtle scanned the following volume (4x3x2) (x*y*z)

  • Layers: 1,2 & 3

Example_Basic_l1 Example_Basic_l2 Example_Basic_l3

  • Axis: x: red, y: green & z: blue

Example_Basic_axes

  • Given inputs : start & end

Example_Basic_pos1 Example_Basic_pos2

Result (pastebin) 1.06 Kb, 80l

Note: showIndexs was set to false

Small house

Screens

Example_maison1_build_1 Example_maison1_build_2

Result (pastebin) 4.72 Kb, 322l

Note: showIndexs was set to false


Scan file format

Information about how StructureCCloner stores the scan data.

File name

The file name is composed of:

  • scanResult_<scanfilepreffix>_<date (format: "%Y-%m-%d_%H-%M-%S")>_<random integer to 9999>

File architecture

The scan file result has the following architecture

{
  chunks = {
    {
      layers = {
        {
          {nameid, ..., nameid},
          {nameid, ..., nameid},
          ...
          {nameid, ..., nameid}
        },
        {
          {nameid, ..., nameid},
          {nameid, ..., nameid},
          ...
        },
        ...
      }
    },
    {
      ...
    },
    ...
  },
  names = {
    {
      id = "blockid",
      count = 10
    },
    {
      id = "blockid",
      count = 25
    },
    ...
  }
}

The scan result is saved as a lua object (table) for better performance, this is why you can see unusual stuff like = instead of : (json format)

Global explanation

Each chunk is split into layers (y-axis = height).

Each layer contains a list of list, the outer list represents the x-axis, and the inner list represents the z-axis.

The elements inside the inner list represents the blocks, here "nameid".

Detailed explanation

Names

Block names

To save space, each new scanned block data is added in the names table, its index represents its "number" or "id"

Here names

For each item data

For each scanned block data we store its id and how much it is used (count)

Note: the first index will always be the placeholderBlockIfEmpty (see config), even if none exists in the scanned volume (its count will be 0)

Note 2: for the id, the default namespace is minecraft:, so all minecraft vanilla blocks will not have this prefix (example: minecraft:smooth_quartz turns into smooth_quartz), other modded blocks will have the fullname (modname:blockname)

Here id and count

Chunks

Chunks

The 3D Zone (or volume) in where the turtle is going to scan all blocks

Here chunks

Layers

It contains a list of table of layer ids (here ["1"],["2"],...), each layer represents a y-level (height).

Here layers

Inside each layers

Inside each layers there is a list of list, the outer list represents the x-axis, and the inner list represents the z-axis.
The elements inside the inner list represents the blocks id.

Here the outer list is

{
  {nameid, ..., nameid}, -- inner list
  {nameid, ..., nameid}, -- inner list
   ...                   -- inner list
  {nameid, ..., nameid}  -- inner list
}

Here the inner list is

{nameid, ..., nameid}