Skip to content

Get/Set filters #107

@landynmj

Description

@landynmj

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])

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions