Placeholder

Description

placeholder node / a better unknown node

Overview 🔗

Provides a "better" unknown node which can be handled properly by worldedit and other schematic mechanisms (given they support metadata).

Features:

  • Handles and restores metadata

  • Restores the original node and metadata if it is available (via lbm)

  • Can be serialized and deserialized with worldedit

Use-cases:

  • Schematic handling with unknown nodes

How it works 🔗

There is a placeholder node (placeholder:placeholder) which holds all the relevant data about the unknown node in its metadata:

  • original_nodename the original nodename

  • original_metadata the original metadata, serialized with minetest.serialize

  • original_param2 (optional) the original param2

Api 🔗

local pos = { x=0, y=0, z=0 }
local metadata = {
    inventory = {},
    fields = {
        x = "y"
    }
}
-- place a placeholder manually
placeholder.place(pos, {name="unknown:nodename"}, metadata)

-- unwrap the placeholder metadata (returns the original node- and metadata)
local meta = minetest.get_meta(pos)
local node, metadata = placeholder.unwrap(meta)

-- try to restore the placeholder at the position
-- this function gets also called in the placeholder-lbm for automatic restoration
placeholder.replace(pos)

Reviews

Review

Do you recommend this mod?

  • No reviews, yet.

Releases

2024-04-22

Download

2024-04-22 02:12 UTC

2024-04-22 🔗

No release notes

2024-02-10

Download

2024-02-10 02:12 UTC

2024-02-10 🔗

No release notes

2023-04-12

Download

2023-04-12 02:16 UTC

2023-04-12 🔗

No release notes

2023-03-24

Download

2023-03-24 02:16 UTC

2023-03-24 🔗

No release notes

2023-03-18

Download

2023-03-18 02:16 UTC

2023-03-18 🔗

No release notes

All releases