Skip to content

Commit

Permalink
fix 'material.is_*' tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Dec 23, 2019
1 parent ef65691 commit e6b9f4f
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 12 deletions.
Expand Up @@ -538,6 +538,45 @@ public static void registerTags() {
return new ElementTag(MaterialHalf.describes(object));
});

// <--[tag]
// @attribute <MaterialTag.is_bamboo>
// @returns ElementTag(Boolean)
// @group properties
// @description
// Returns whether the material is a bamboo material.
// When this returns true, <@link tag LocationTag.leaf_size>,
// and <@link mechanism MaterialTag.leaf_size> are accessible.
// -->
registerTag("is_bamboo", (attribute, object) -> {
return new ElementTag(MaterialLeafSize.describes(object));
});

// <--[tag]
// @attribute <MaterialTag.is_levelable>
// @returns ElementTag(Boolean)
// @group properties
// @description
// Returns whether the material is a levelable material.
// When this returns true, <@link tag MaterialTag.level>, <@link tag MaterialTag.maximum_level>,
// and <@link mechanism MaterialTag.level> are accessible.
// -->
registerTag("is_levelable", (attribute, object) -> {
return new ElementTag(MaterialLevel.describes(object));
});

// <--[tag]
// @attribute <MaterialTag.is_lightable>
// @returns ElementTag(Boolean)
// @group properties
// @description
// Returns whether the material is a lightable material.
// When this returns true, <@link tag MaterialTag.lit>,
// and <@link mechanism MaterialTag.lit> are accessible.
// -->
registerTag("is_lightable", (attribute, object) -> {
return new ElementTag(MaterialLightable.describes(object));
});

// <--[tag]
// @attribute <MaterialTag.is_leaves>
// @returns ElementTag(Boolean)
Expand All @@ -552,6 +591,20 @@ public static void registerTags() {
return new ElementTag(MaterialPersistent.describes(object));
});

// <--[tag]
// @attribute <MaterialTag.is_pickle>
// @returns ElementTag(Boolean)
// @group properties
// @description
// Returns whether the material is a slab.
// When this returns true, <@link tag MaterialTag.pickle_count>,
// <@link tag MaterialTag.pickle_max>, <@link tag MaterialTag.pickle_min>,
// and <@link mechanism MaterialTag.pickle_max> are accessible.
// -->
registerTag("is_pickle", (attribute, object) -> {
return new ElementTag(MaterialPickle.describes(object));
});

// <--[tag]
// @attribute <MaterialTag.is_slab>
// @returns ElementTag(Boolean)
Expand All @@ -566,29 +619,42 @@ public static void registerTags() {
});

// <--[tag]
// @attribute <MaterialTag.is_levelable>
// @attribute <MaterialTag.is_snowable>
// @returns ElementTag(Boolean)
// @group properties
// @description
// Returns whether the material is a levelable material.
// When this returns true, <@link tag MaterialTag.level>, <@link tag MaterialTag.maximum_level>,
// and <@link mechanism MaterialTag.level> are accessible.
// Returns whether the material is snowable.
// When this returns true, <@link tag MaterialTag.snowy>,
// and <@link mechanism MaterialTag.snowy> are accessible.
// -->
registerTag("is_levelable", (attribute, object) -> {
return new ElementTag(MaterialLevel.describes(object));
registerTag("is_snowable", (attribute, object) -> {
return new ElementTag(MaterialSnowable.describes(object));
});

// <--[tag]
// @attribute <MaterialTag.is_lightable>
// @attribute <MaterialTag.is_switch>
// @returns ElementTag(Boolean)
// @group properties
// @description
// Returns whether the material is a lightable material.
// When this returns true, <@link tag MaterialTag.lit>,
// and <@link mechanism MaterialTag.lit> are accessible.
// Returns whether the material is a switch.
// When this returns true, <@link tag MaterialTag.switch_face>,
// and <@link mechanism MaterialTag.switch_face> are accessible.
// -->
registerTag("is_lightable", (attribute, object) -> {
return new ElementTag(MaterialLightable.describes(object));
registerTag("is_switch", (attribute, object) -> {
return new ElementTag(MaterialSnowable.describes(object));
});

// <--[tag]
// @attribute <MaterialTag.is_waterloggable>
// @returns ElementTag(Boolean)
// @group properties
// @description
// Returns whether the material is able to be waterlogged.
// When this returns true, <@link tag MaterialTag.waterlogged>,
// and <@link mechanism MaterialTag.waterlogged> are accessible.
// -->
registerTag("is_waterloggable", (attribute, object) -> {
return new ElementTag(MaterialSnowable.describes(object));
});

// <--[tag]
Expand Down
Expand Up @@ -70,6 +70,9 @@ public class InventoryCommand extends AbstractCommand {
// destination to be a valid player inventory.
// Using "close" closes any inventory that the currently attached player has opened.
//
// Note that instead of "add", you should usually use <@link command give>,
// and instead of "remove", you should usually use <@link command take>.
//
// @Tags
// <PlayerTag.inventory>
// <PlayerTag.enderchest>
Expand Down

0 comments on commit e6b9f4f

Please sign in to comment.