Feature/conditional tags#261
Open
mineLdiver wants to merge 11 commits into
Open
Conversation
…ts, general context system improvements
Contributor
|
Pls world, x, y, z overrides in block isIn methods, kthxbai |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Features added:
Conditional tags
Default conditions
stationapi:block_metadata(BlockRegistry)Makes the tag apply only if the block's metadata matches the one provided in the condition's data.
Data is defined by a single
metadatainteger field, and can be set via the@metadatashorthand.Examples
Fully qualified condition:
{ "values": [ { "id": "example_mod:example_block", "conditions": [ { "type": "stationapi:block_metadata", "metadata": 15 } ] } ] }Shorthand condition:
{ "values": [ "example_mod:example_block@15" ] }stationapi:item_damage(ItemRegistry)Makes the tag apply only if the item's damage matches the one provided in the condition's data.
Data is defined by a single
damageinteger field, and can be set via the@damageshorthand.Examples
Fully qualified condition:
{ "values": [ { "id": "example_mod:example_item", "conditions": [ { "type": "stationapi:item_damage", "damage": 32767 } ] } ] }Shorthand condition:
{ "values": [ "example_mod:example_item@32767" ] }Querying tags
Blocks and items now require additional context when querying tags, for example:
Old, context-less methods are still present, but follow these rules:
.isIn(...)) are deprecated and exclude all conditional tags.streamTags()) include all conditional tagsRegistering a condition
Targeted tags removal
Tags can now define a
removearray to remove previously defined tags (ordered by data priority):resources/data/minecraft/stationapi/tags/blocks/mineable/pickaxe.json{ "remove": [ "minecraft:stone" ] }Tag removals use the same schema as tag values, meaning they can be conditional and optional