Skip to content

Commit

Permalink
huge pile of meta fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Nov 30, 2019
1 parent a6abb3e commit f01921c
Show file tree
Hide file tree
Showing 21 changed files with 93 additions and 79 deletions.
Expand Up @@ -45,14 +45,14 @@ public class HealthTrait extends Trait implements Listener {
//
// Related Tags
// <@link tag NPCTag.health>
// <@link tag NPCTag.health.formatted>
// <@link tag NPCTag.health.max>
// <@link tag NPCTag.health.percentage>
// <@link tag NPCTag.formatted_health>
// <@link tag NPCTag.health_max>
// <@link tag NPCTag.health_percentage>
// <@link tag NPCTag.has_trait[health]>
//
// Related Mechanisms
// <@link mechanism health>
// <@link mechanism max_health>
// <@link mechanism NPCTag.health>
// <@link mechanism NPCTag.max_health>
//
// Related Commands
// <@link command heal>
Expand Down
Expand Up @@ -2149,7 +2149,7 @@ else if (mtr.angle == BlockFace.EAST) {
// <--[tag]
// @attribute <EntityTag.is_collidable>
// @returns ElementTag(Boolean)
// @mechanism collidable
// @mechanism EntityTag.collidable
// @group attributes
// @description
// Returns whether the entity is collidable.
Expand Down Expand Up @@ -2814,7 +2814,7 @@ public void adjust(Mechanism mechanism) {
// Sets the entity holding this entity by leash.
// The entity must be living.
// @tags
// <EntityTag.leashed>
// <EntityTag.is_leashed>
// <EntityTag.leash_holder>
// -->
if (mechanism.matches("leash_holder") && mechanism.requireObject(EntityTag.class)) {
Expand Down Expand Up @@ -2857,7 +2857,7 @@ public void adjust(Mechanism mechanism) {
// Sets the passengers of this entity.
// @tags
// <EntityTag.passengers>
// <EntityTag.empty>
// <EntityTag.is_empty>
// -->
if (mechanism.matches("passengers")) {
entity.eject();
Expand All @@ -2882,7 +2882,7 @@ public void adjust(Mechanism mechanism) {
// Sets the passenger of this entity.
// @tags
// <EntityTag.passenger>
// <EntityTag.empty>
// <EntityTag.is_empty>
// -->
if (mechanism.matches("passenger") && mechanism.requireObject(EntityTag.class)) {
EntityTag ent = mechanism.valueAsType(EntityTag.class);
Expand Down Expand Up @@ -2917,7 +2917,7 @@ public void adjust(Mechanism mechanism) {
// The entity must be living.
// @tags
// <EntityTag.oxygen>
// <EntityTag.oxygen.max>
// <EntityTag.max_oxygen>
// -->
if (mechanism.matches("remaining_air") && mechanism.requireInteger()) {
getLivingEntity().setRemainingAir(mechanism.getValue().asInt());
Expand Down
Expand Up @@ -2306,7 +2306,7 @@ else if ((object.inventory instanceof FurnaceInventory)) {
// <--[tag]
// @attribute <InventoryTag.anvil_repair_cost>
// @returns ElementTag(Number)
// @mechanism anvil_repair_cost
// @mechanism InventoryTag.anvil_repair_cost
// @description
// Returns the current repair cost on an anvil.
// -->
Expand All @@ -2320,7 +2320,7 @@ else if ((object.inventory instanceof FurnaceInventory)) {
// <--[tag]
// @attribute <InventoryTag.anvil_max_repair_cost>
// @returns ElementTag(Number)
// @mechanism anvil_max_repair_cost
// @mechanism InventoryTag.anvil_max_repair_cost
// @description
// Returns the maximum repair cost on an anvil.
// -->
Expand All @@ -2347,7 +2347,7 @@ else if ((object.inventory instanceof FurnaceInventory)) {
// <--[tag]
// @attribute <InventoryTag.fuel>
// @returns ItemTag
// @mechanism fuel
// @mechanism InventoryTag.fuel
// @description
// Returns the item currently in the fuel section of a furnace or brewing stand inventory.
// -->
Expand All @@ -2362,7 +2362,7 @@ else if ((object.inventory instanceof FurnaceInventory)) {
// <--[tag]
// @attribute <InventoryTag.input>
// @returns ItemTag
// @mechanism input
// @mechanism InventoryTag.input
// @description
// Returns the item currently in the smelting slot of a furnace inventory, or the ingredient slot of a brewing stand inventory.
// -->
Expand Down
28 changes: 14 additions & 14 deletions plugin/src/main/java/com/denizenscript/denizen/objects/ItemTag.java
Expand Up @@ -685,8 +685,8 @@ public static void registerTags() {
// @description
// Returns whether the item can be repaired.
// If this returns true, it will enable access to:
// <@link mechanism ItemTag.durability>, <@link tag ItemTag.max_durability>,
// and <@link tag ItemTag.durability>
// <@link mechanism ItemTag.durability>,
// <@link tag ItemTag.max_durability>, and <@link tag ItemTag.durability>.
// -->
registerTag("repairable", (attribute, object) -> {
return new ElementTag(ItemDurability.describes(object));
Expand All @@ -699,7 +699,7 @@ public static void registerTags() {
// @description
// Returns whether the item is a growable crop.
// If this returns true, it will enable access to:
// <@link mechanism ItemTag.plant_growth> and <@link tag ItemTag.plant_growth>
// <@link mechanism ItemTag.plant_growth> and <@link tag ItemTag.plant_growth>.
// -->
registerTag("is_crop", (attribute, object) -> {
return new ElementTag(ItemPlantgrowth.describes(object));
Expand All @@ -712,10 +712,8 @@ public static void registerTags() {
// @description
// Returns whether the item is considered an editable book.
// If this returns true, it will enable access to:
// <@link mechanism ItemTag.book>, <@link tag ItemTag.book>,
// <@link tag ItemTag.book.author>, <@link tag ItemTag.book.title>,
// <@link tag ItemTag.book.page_count>, <@link tag ItemTag.book.page[<#>]>,
// and <@link tag ItemTag.book.pages>
// <@link mechanism ItemTag.book>,
// <@link tag ItemTag.book_author>, <@link tag ItemTag.book_title>, and <@link tag ItemTag.book_pages>.
// -->
registerTag("is_book", (attribute, object) -> {
return new ElementTag(ItemBook.describes(object));
Expand All @@ -725,9 +723,10 @@ public static void registerTags() {
// @attribute <ItemTag.is_colorable>
// @returns ElementTag(Boolean)
// @group properties
// @description
// Returns whether the item can have a custom color.
// If this returns true, it will enable access to:
// <@link mechanism ItemTag.color>, and <@link tag ItemTag.color>
// <@link mechanism ItemTag.color>, and <@link tag ItemTag.color>.
// -->
registerTag("is_colorable", (attribute, object) -> {
return new ElementTag(ItemColor.describes(object));
Expand All @@ -741,9 +740,10 @@ public static void registerTags() {
// @attribute <ItemTag.is_firework>
// @returns ElementTag(Boolean)
// @group properties
// @description
// Returns whether the item is a firework.
// If this returns true, it will enable access to:
// <@link mechanism ItemTag.firework>, and <@link tag ItemTag.firework>
// <@link mechanism ItemTag.firework>, and <@link tag ItemTag.firework>.
// -->
registerTag("is_firework", (attribute, object) -> {
return new ElementTag(ItemFirework.describes(object));
Expand All @@ -753,9 +753,10 @@ public static void registerTags() {
// @attribute <ItemTag.has_inventory>
// @returns ElementTag(Boolean)
// @group properties
// @description
// Returns whether the item has an inventory.
// If this returns true, it will enable access to:
// <@link mechanism ItemTag.inventory>, and <@link tag ItemTag.inventory>
// <@link mechanism ItemTag.inventory>, and <@link tag ItemTag.inventory>.
// -->
registerTag("has_inventory", (attribute, object) -> {
return new ElementTag(ItemInventory.describes(object));
Expand All @@ -765,9 +766,10 @@ public static void registerTags() {
// @attribute <ItemTag.is_lockable>
// @returns ElementTag(Boolean)
// @group properties
// @description
// Returns whether the item is lockable.
// If this returns true, it will enable access to:
// <@link mechanism ItemTag.lock>, and <@link tag ItemTag.lock>
// <@link mechanism ItemTag.lock>, and <@link tag ItemTag.lock>.
// -->
registerTag("is_lockable", (attribute, object) -> {
return new ElementTag(ItemLock.describes(object));
Expand Down Expand Up @@ -801,9 +803,7 @@ public static void registerTags() {
// @description
// Returns the item converted to a raw JSON object with one layer of escaping for network transmission.
// EG, via /tellraw.
// EXAMPLE USAGE: execute as_server 'tellraw <player.name>
// {"text":"","extra":[{"text":"This is the item in your hand ","color":"white"},
// {"text":"Item","color":"white","hoverEvent":{"action":"show_item","value":"{<player.item_in_hand.json>}"}}]}'
// Generally, prefer tags like <@link tag ElementTag.on_hover.type> with type 'show_item'.
// -->
registerTag("json", (attribute, object) -> {
return new ElementTag(NMSHandler.getItemHelper().getJsonString(object.item));
Expand Down
Expand Up @@ -816,7 +816,7 @@ public static void registerTags() {
// <--[tag]
// @attribute <MaterialTag.piston_reaction>
// @returns ElementTag
// @mechanism piston_reaction
// @mechanism MaterialTag.piston_reaction
// @description
// Returns the material's piston reaction. (Only for block materials).
// -->
Expand All @@ -831,7 +831,7 @@ public static void registerTags() {
// <--[tag]
// @attribute <MaterialTag.block_strength>
// @returns ElementTag(Decimal)
// @mechanism block_strength
// @mechanism MaterialTag.block_strength
// @description
// Returns the material's strength level. (Only for block materials).
// This is a representation of how much time mining is needed to break a block.
Expand Down
Expand Up @@ -977,7 +977,7 @@ else if (attribute.startsWith("list", 2)) {
// <--[tag]
// @attribute <NPCTag.distance_margin>
// @returns ElementTag(Decimal)
// @mechanism distance_margin
// @mechanism NPCTag.distance_margin
// @description
// Returns the NPC's current pathfinding distance margin. That is, how close it needs to get to its destination (in block-lengths).
// -->
Expand All @@ -988,7 +988,7 @@ else if (attribute.startsWith("list", 2)) {
// <--[tag]
// @attribute <NPCTag.path_distance_margin>
// @returns ElementTag(Decimal)
// @mechanism path_distance_margin
// @mechanism NPCTag.path_distance_margin
// @description
// Returns the NPC's current pathfinding distance margin. That is, how close it needs to get to individual points along its path.
// -->
Expand Down Expand Up @@ -1380,7 +1380,7 @@ public void adjust(Mechanism mechanism) {
// @description
// Sets the maximum movement distance of the NPC.
// @tags
// <NPCTag.navigator.range>
// <NPCTag.range>
// -->
if (mechanism.matches("range") && mechanism.requireFloat()) {
getCitizen().getNavigator().getDefaultParameters().range(mechanism.getValue().asFloat());
Expand All @@ -1393,7 +1393,7 @@ public void adjust(Mechanism mechanism) {
// @description
// Sets the maximum attack distance of the NPC.
// @tags
// <NPCTag.navigator.attack_range>
// <NPCTag.attack_range>
// -->
if (mechanism.matches("attack_range") && mechanism.requireFloat()) {
getCitizen().getNavigator().getDefaultParameters().attackRange(mechanism.getValue().asFloat());
Expand All @@ -1406,7 +1406,7 @@ public void adjust(Mechanism mechanism) {
// @description
// Sets the movement speed of the NPC.
// @tags
// <NPCTag.navigator.speed>
// <NPCTag.speed>
// -->
if (mechanism.matches("speed") && mechanism.requireFloat()) {
getCitizen().getNavigator().getDefaultParameters().speedModifier(mechanism.getValue().asFloat());
Expand Down
Expand Up @@ -537,6 +537,7 @@ public static void registerTags() {
// <--[tag]
// @attribute <WorldTag.ticks_per_animal_spawn>
// @returns DurationTag
// @Mechanism WorldTag.ticks_per_animal_spawns
// @description
// Returns the world's ticks per animal spawn value.
// -->
Expand All @@ -547,6 +548,7 @@ public static void registerTags() {
// <--[tag]
// @attribute <WorldTag.ticks_per_monster_spawn>
// @returns DurationTag
// @Mechanism WorldTag.ticks_per_monster_spawns
// @description
// Returns the world's ticks per monster spawn value.
// -->
Expand Down Expand Up @@ -1022,7 +1024,7 @@ public void adjust(Mechanism mechanism) {
// @description
// Sets the time between animal spawns.
// @tags
// <WorldTag.ticks_per_animal_spawns>
// <WorldTag.ticks_per_animal_spawn>
// -->
if (mechanism.matches("ticks_per_animal_spawns") && mechanism.requireObject(DurationTag.class)) {
getWorld().setTicksPerAnimalSpawns(mechanism.valueAsType(DurationTag.class).getTicksAsInt());
Expand All @@ -1035,7 +1037,7 @@ public void adjust(Mechanism mechanism) {
// @description
// Sets the time between monster spawns.
// @tags
// <WorldTag.ticks_per_monster_spawns>
// <WorldTag.ticks_per_monster_spawn>
// -->
if (mechanism.matches("ticks_per_monster_spawns") && mechanism.requireObject(DurationTag.class)) {
getWorld().setTicksPerMonsterSpawns(mechanism.valueAsType(DurationTag.class).getTicksAsInt());
Expand Down
Expand Up @@ -202,7 +202,7 @@ public void adjust(Mechanism mechanism) {
// <EntityTag.age>
// <EntityTag.is_baby>
// <EntityTag.is_age_locked>
// <EntityTag.is_ageable>
// <EntityTag.ageable>
// -->

if (mechanism.matches("age_lock")
Expand All @@ -224,7 +224,7 @@ public void adjust(Mechanism mechanism) {
// <EntityTag.age>
// <EntityTag.is_baby>
// <EntityTag.is_age_locked>
// <EntityTag.is_ageable>
// <EntityTag.ageable>
// -->

if (mechanism.matches("age")) {
Expand Down
Expand Up @@ -105,7 +105,7 @@ public ObjectTag getObjectAttribute(Attribute attribute) {
// <--[tag]
// @attribute <EntityTag.attributes>
// @returns ListTag
// @mechanism attributes
// @mechanism EntityTag.attributes
// @group properties
// @description
// Returns a list of all attributes on the entity, formatted in a way that can be sent back into the 'attributes' mechanism.
Expand All @@ -117,7 +117,7 @@ public ObjectTag getObjectAttribute(Attribute attribute) {
// <--[tag]
// @attribute <EntityTag.has_attribute[<attribute>]>
// @returns ElementTag(Boolean)
// @mechanism attributes
// @mechanism EntityTag.attributes
// @group properties
// @description
// Returns whether the entity has the named attribute.
Expand All @@ -132,7 +132,7 @@ public ObjectTag getObjectAttribute(Attribute attribute) {
// <--[tag]
// @attribute <EntityTag.attribute_value[<attribute>]>
// @returns ElementTag(Decimal)
// @mechanism attributes
// @mechanism EntityTag.attributes
// @group properties
// @description
// Returns the final calculated value of the named attribute for the entity.
Expand All @@ -154,7 +154,7 @@ public ObjectTag getObjectAttribute(Attribute attribute) {
// <--[tag]
// @attribute <EntityTag.attribute_base_value[<attribute>]>
// @returns ElementTag(Decimal)
// @mechanism attributes
// @mechanism EntityTag.attributes
// @group properties
// @description
// Returns the base value of the named attribute for the entity.
Expand All @@ -176,7 +176,7 @@ public ObjectTag getObjectAttribute(Attribute attribute) {
// <--[tag]
// @attribute <EntityTag.attribute_default_value[<attribute>]>
// @returns ElementTag(Decimal)
// @mechanism attributes
// @mechanism EntityTag.attributes
// @group properties
// @description
// Returns the default value of the named attribute for the entity.
Expand Down
Expand Up @@ -202,7 +202,7 @@ public void adjust(Mechanism mechanism) {
// For the available color options, refer to <@link language Entity Color Types>.
// @tags
// <EntityTag.color>
// <EntityTag.is_colorable>
// <EntityTag.colorable>
// -->

if (mechanism.matches("color")) {
Expand Down
Expand Up @@ -155,7 +155,6 @@ public void adjust(Mechanism mechanism) {
// Valid rotations: <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Rotation.html>
// For example: framed:diamond_sword|clockwise
// @tags
// <EntityTag.is_frame>
// <EntityTag.has_framed_item>
// <EntityTag.framed_item>
// <EntityTag.framed_item_rotation>
Expand Down

0 comments on commit f01921c

Please sign in to comment.