Go to file
ChimneySwift 6e53901065
Merge pull request #1 from gpcf/master
fix removed API calls
2020-11-11 23:48:09 +10:00
screenshots Initial Upload 2018-05-24 11:15:45 +10:00
LICENSE Initial commit 2018-05-24 11:13:55 +10:00
README.md Add screenshot links 2018-05-24 11:19:26 +10:00
init.lua fix API 2020-11-05 22:16:07 +01:00
mod.conf Initial Upload 2018-05-24 11:15:45 +10:00

README.md

Dynamic Inventory Formspecs (CSM port)

Accessing node metadata is a very useful moderation and debugging tool. Unfortuantely the available metadata viewers lack the ability to read all metadata on every node in a friendly and easily readable way.

Dynamic Inventory Formspecs solves this issue by displaying inventories and metadata dynamically - no hard-coding required. It can handle inventories of any size (within reason) with ease as it calculates the most efficient way of displaying the formspec based on the length of the inventory list, not hard-coded values. The user can select any inventory or metadata field to view from a simple dropdown.

Usage

By default, the formspec will display if the user hits a node with default:stick that contains either metadata fields (eg. sign), an inventory (eg, chest), or both. This action is limited to default:stick else digging nodes with metadata or an inventory would be impossible.

By default, the inventory formspec will be displayed if the node has both metadata and an inventory, and can be toggled with the toggle button on the bottom. In the metadata formspec, the value of a selected field is displayed in a text field, while this field is editable, edited values will not be sent to the server, this is simply because this is the only way to get a scrollable text field. Since formspecs are commonly stored in metadata, formspecs will be automatically pretty-printed.

Any inventory you say? 🤔

Yes. Any inventory.

Gold Chest

Infinite Chest

BUT WHUT ABOUT SECURITY U HACKOR!?!!1!?!

Any server which still has nodes which don't check for unauthorised inventory access deserves to have people stealing items from locked chests. It takes 2 seconds to do. Seriously, just add this to the node's registration:

allow_metadata_inventory_take = function(pos, listname, index, stack, player)
    local meta = minetest.get_meta(pos)
    local name = player:get_player_name()
    if not meta:get_string("owner") == name and not minetest.check_player_privs(name, {protection_bypass=true,} then
        return 0
    end
    return stack:get_count()
end

Or update your server.

As for metadata, there is an option to disable sending sensitive metadata to the client, if this is such a big deal to you, use it.