HoloPrint

repository·main·Indexed 41 days ago

https://github.com/superllama88888/holoprint

A web application that converts Minecraft Bedrock Edition (.mcstructure) files into resource packs, enabling holographic projections of builds within Minecraft worlds. It includes a system for controlling holograms via in-game items, block update schemas for version migration, and detailed configuration for block geometry, texture atlas mappings, and material lists.

Tokens
7K
Snippets
22
Records
33
Agent score
52%

What's inside HoloPrint

  1. Privacy and Analytics in HoloPrint

    main

    HoloPrint uses minimal analytics to track usage statistics.

    Data Collection:

    • The only data recorded is the first 4 bytes of the SHA-256 hashes of structure files used during pack creation. This acts as a unique identifier that cannot be used to reconstruct the original file.
    • No cookies are used.

    Browser Storage:

    • The only data stored in your browser is a cache of resource pack resources used to speed up the pack creation process.

    Managing Cache:

    • You can clear the stored resource pack cache using the Resource packs -> Clear resource pack cache button within the application.
  2. Licensing for created packs

    main

    All packs created using HoloPrint are licensed under the CC BY-NC-SA 4.0 license.

    Key restrictions:

    • You may not sell packs created with HoloPrint.
    • You may not put packs behind advertisements or monetized barriers.

    Allowed uses include:

    • Writing tutorials or blog posts about HoloPrint.
    • Showing HoloPrint-created packs in videos (e.g., YouTube).

    Prohibited uses include:

    • Limiting access to packs via monetized link shorteners (e.g., Linkvertise).
    • Forcing users to wait for downloads or purchase subscriptions to access the packs.
  3. How to use HoloPrint to generate hologram resource packs

    main

    HoloPrint converts Minecraft Bedrock Edition (.mcstructure) files into resource packs that display holograms of your builds. Follow these steps to create a pack:

    1. Export your structure: Use a Structure Block in Minecraft to export a .mcstructure file. You can obtain a structure block by running the command /give @s structure_block.
      • Note for Android users: The Structure Block export button is hidden by default. Use this pack to restore it.
    2. Generate the pack: Visit https://holoprint-mc.github.io, upload your .mcstructure file, and adjust the generation settings.
    3. Download: Generate and download the resulting .mcpack file.
    4. Apply in Minecraft: Install the resource pack in your world and place an armour stand to initialize the hologram.
  4. How to use HoloPrint to create holographic building projections

    main

    HoloPrint converts Minecraft Bedrock Edition (.mcstructure) files into resource packs that display holographic projections of buildings. Follow these steps to create and use a projection:

    1. Export your structure:
      • In Minecraft, run /give @s structure_block to obtain a structure block.
      • Use the structure block to export your building as a .mcstructure file.
      • Note for Android users: The export button is hidden by default. Use this resource pack to restore it.
    2. Generate the resource pack:
    3. Install the pack:
      • Download the generated .mcpack file.
      • Import and enable the resource pack in your Minecraft world.
    4. Display the hologram:
      • Place an Armor Stand in your world to act as the anchor for the holographic projection.
  5. Configure HoloPrint via HoloPrintConfig

    main

    The HoloPrintConfig type defines the global configuration for the HoloPrint system. It controls visual properties (scale, opacity, tint), animation settings, UI/control behavior, and pack metadata.

    Key configuration groups include:

    • Visuals: SCALE, OPACITY, MULTIPLE_OPACITIES, TINT_COLOR, TINT_OPACITY, and TEXTURE_OUTLINE_* settings.
    • Animations: SPAWN_ANIMATION_ENABLED and SPAWN_ANIMATION_LENGTH.
    • Controls: PLAYER_CONTROLS_ENABLED, UI_CONTROLS_ENABLED, and the CONTROLS object.
    • Validation: VALIDATE_AIR_BLOCKS and WRONG_BLOCK_OVERLAY_COLOR.
    • Pack Metadata: PACK_NAME, AUTHORS, DESCRIPTION, and PACK_ICON_BLOB.
    • Preview Settings: PREVIEW_BLOCK_LIMIT, SHOW_PREVIEW_SKYBOX, and SHOW_PREVIEW_WIDGETS.
  6. Configure hologram controls with HoloPrintControlsConfig

    main

    The HoloPrintControlsConfig type allows you to map specific in-game actions to ItemCriteria. This defines which items will trigger specific hologram behaviors.

    Available control actions include:

    • TOGGLE_RENDERING
    • CHANGE_OPACITY
    • TOGGLE_TINT
    • TOGGLE_VALIDATING
    • CHANGE_LAYER / DECREASE_LAYER / CHANGE_LAYER_MODE
    • MOVE_HOLOGRAM / ROTATE_HOLOGRAM
    • CHANGE_STRUCTURE (Players only)
    • DISABLE_PLAYER_CONTROLS (Players only)
    • BACKUP_HOLOGRAM (Forces armour stands to backup state for 30s)
  7. Hologram control items and interactions

    main

    Once the resource pack is active, you can control the holographic projection using specific items held by or interacting with the anchor (Armor Stand).

    ActionItem / Input
    Toggle RenderingBrick
    Adjust TransparencyAmethyst Shard (Sneak to decrease, otherwise increase)
    Switch LayersLeather (Sneak to decrease, otherwise increase) or modify Armor Stand pose
    Move HologramStick
    Rotate HologramCopper Ingot
    Validate StructureIron Ingot
    View Material ListTab key (Keyboard) or Bookcase icon (Touchscreen)
    Toggle TintingWhite Dye
    Switch Layer ModeFlint
    Switch StructureArrow or attack the Armor Stand with an empty hand
    Save Hologram SettingsPaper
    Armor Stand ControlsEquip items or attack the Armor Stand
    Disable Player ControlsBone
    WARNING

    Player controls may be unstable, but Armor Stand controls are always effective.

  8. Hologram control items and actions

    main

    Once the resource pack is active, you can control the hologram using specific items.

    ActionItemDetails
    Toggle renderingBrickTurns the hologram visibility on/off
    Change transparencyAmethyst shardSneak to decrease, stand to increase
    Change layerLeatherSneak to decrease, stand to increase; or change armour stand pose
    Move hologramStickMoves the hologram position
    Rotate hologramCopper ingotRotates the hologram
    Block validationIron ingotValidates the structure against the world
    Material listTab (Keyboard) / Book icon (Touch)Displays required materials
    Toggle tintWhite dyeToggles color tinting
    Change layer modeFlintSwitches between layer modes
    Change structureArrow / Hit empty armour standSwitches to a different structure
    Save settingsPaperSaves a backup of hologram settings
    Armour stand controlsGive item or HitAccesses armour stand specific controls
    Disable player controlsBoneDisables player-based interaction (Note: Armour stand controls will still work)
  9. Merge multiple structure palettes with mergeStructurePalettes()

    main

    When working with multiple IStructure objects, you can use mergeStructurePalettes(structures) to combine their individual block palettes into a single, shared palette.

    This function:

    1. Creates a unique set of all blocks present across all provided structures.
    2. Updates the block indices for each structure so they all point to the new, unified palette.
    3. Returns the resulting merged palette array.

    This is useful for ensuring that multiple structures can be rendered or processed using a single consistent block lookup table.

    import { mergeStructurePalettes } from './path/to/structureHelpers.js';
    
    // structures is an array of IStructure objects
    const sharedPalette = mergeStructurePalettes(structures);
  10. Define block geometry using the Cube interface

    main

    The Cube interface is the primary way to define 3D geometry for blocks. It allows for precise control over position, size, rotation, transformations, and UV mapping.

    Key capabilities include:

    • Transformations: Use pos, size, rot (XYZ degrees), pivot, translate, or a full 4x4 transform matrix.
    • Conditional Rendering: Use the if property with C-style syntax to render cubes based on block states.
    • UV Mapping: Control UVs via uv, uvSizes, uvRot, or boxUv (for box-style UVs). You can also flip textures using flipTextureHorizontally or flipTextureVertically.
    • Texturing: Assign specific textures to faces using textures. This supports cardinal directions, side, or * (all faces), and can point to specific file paths or other faces.
    • Inheritance: Use copy to inherit geometry from another block shape or copyBlock to copy an entire block definition.
    const myCube: Cube = {
      pos: [0, 0, 0],
      size: [16, 16, 16],
      if: "state.facing == 1",
      textures: {
        north: "textures/block/my_texture",
        side: "carried.east"
      },
      tint: "#FF0000"
    };
  11. Configure Block Shapes and Patterns

    main

    The BlockShapes interface manages how block names map to specific geometric definitions.

    • individualBlocks: A direct mapping where the key is the block name and the value is the block shape name.
    • patterns: A mapping of regular expression strings to block shape names. These patterns are tested if no individual block match is found.
    const shapes: BlockShapes = {
      individualBlocks: {
        "minecraft:stone": "stone_shape",
        "minecraft:dirt": "dirt_shape"
      },
      patterns: {
        "/minecraft:grass_*/": "grass_shape"
      }
    };
  12. Concatenate multiple files into one

    main

    The concatenateFiles function creates a new File object by concatenating the contents of an array of File objects. You can optionally provide a custom name for the resulting file; otherwise, it defaults to a comma-separated string of the original filenames.

    import { concatenateFiles } from './utils/files.js';
    
    const combinedFile = concatenateFiles([file1, file2], 'merged.txt');