Mod
Placeholder
placeholder node / a better unknown node
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_nodenamethe original nodename -
original_metadatathe original metadata, serialized withminetest.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) Links
- Source: https://github.com/BuckarooBanzay/placeholder
- Issues: https://github.com/BuckarooBanzay/placeholder/issues
- Website: https://github.com/BuckarooBanzay/placeholder
- Original ContentDB page: content.luanti.org/packages/BuckarooBanzay/placeholder/
License
MIT
Development state
ACTIVELY_DEVELOPED
| Version | Date | Min engine | Size | Download |
|---|---|---|---|---|
| 2024-04-22 | 2024-04-22 02:12:52 | 607.1 KB | Download |