cccbridge
cccbridge copied to clipboard
Get/Set filters
Description
The ability to Get/Set filter data on blocks that support it, ex: Brass Funnel.
The Get operation could look like this
local isAttributeFilter, data = peripheral.wrap("back").getFilter()
-- An attribute filter would be returned like this:
{["mod:minecraft"]=true, ["!display_name"]="Carrot"}
--(It matches all minecraft items that are not a Carrot)
-- An item filter would be far simpler
{"minecraft:andesite","minecraft:carrot"}
--And its good to remember that attribute filters can be placed in item filters. This can be represented by nesting tables
{"minecraft:andesite","minecraft:carrot", {["mod:minecraft"]=true, ["!display_name"]="Carrot"}}
The set operation would work the same way
peripheral.wrap("back").setFilter(table, [isAttributeFilter])