From cef54aedcd70aa0f7f44280130e2a47cc4a4aa93 Mon Sep 17 00:00:00 2001 From: Alex 'mcmonkey' Goodwin Date: Tue, 6 Aug 2019 20:05:31 -0700 Subject: [PATCH] clean some meta --- .../com/denizenscript/denizen/CommonRegistries.java | 2 +- .../events/entity/EntityDeathScriptEvent.java | 8 ++------ .../com/denizenscript/denizen/objects/EntityTag.java | 8 ++++---- .../com/denizenscript/denizen/objects/PlayerTag.java | 4 ++-- .../com/denizenscript/denizen/objects/TradeTag.java | 2 +- .../objects/properties/entity/EntityFramed.java | 6 +++--- .../scripts/commands/entity/EquipCommand.java | 12 ++++++------ .../scripts/commands/item/DisplayItemCommand.java | 8 ++++---- .../scripts/commands/item/FakeItemCommand.java | 4 ++-- .../denizen/scripts/commands/item/GiveCommand.java | 2 +- .../scripts/commands/item/InventoryCommand.java | 6 +++--- .../denizen/scripts/commands/item/NBTCommand.java | 2 +- .../scripts/commands/player/OpenTradesCommand.java | 2 +- .../denizen/scripts/commands/world/DropCommand.java | 4 ++-- .../scripts/containers/core/BookScriptContainer.java | 4 ++-- .../containers/core/InventoryScriptContainer.java | 2 +- .../scripts/containers/core/ItemScriptContainer.java | 10 +++++----- 17 files changed, 41 insertions(+), 45 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/CommonRegistries.java b/plugin/src/main/java/com/denizenscript/denizen/CommonRegistries.java index 19c1d73d9c..96ece7922b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/CommonRegistries.java +++ b/plugin/src/main/java/com/denizenscript/denizen/CommonRegistries.java @@ -37,7 +37,7 @@ public class CommonRegistries { // ObjectTags can be used to CREATE new instances of objects, too! Though not all types allow 'new' // objects to be created, many do, such as ItemTags. With the use of tags, it's easy to reference a specific // item, say -- an item in the Player's hand -- items are also able to use a constructor to make a new item, - // and say, drop it in the world. Take the case of the command/usage '- drop i@diamond_ore'. The item object + // and say, drop it in the world. Take the case of the command/usage '- drop diamond_ore'. The item object // used is a brand new diamond_ore, which is then dropped by the command to a location of your choice -- just // specify an additional location argument. // diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDeathScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDeathScriptEvent.java index 0294545430..39e5056381 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDeathScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDeathScriptEvent.java @@ -12,6 +12,7 @@ import com.denizenscript.denizencore.scripts.ScriptEntryData; import com.denizenscript.denizencore.scripts.containers.ScriptContainer; import com.denizenscript.denizencore.utilities.CoreUtilities; +import org.bukkit.Material; import org.bukkit.entity.LivingEntity; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -253,12 +254,7 @@ else if (livingEntity.getKiller() != null) { drops = new ListTag(); for (ItemStack stack : event.getDrops()) { - if (stack == null) { - drops.add("i@air"); - } - else { - drops.add(new ItemTag(stack).identify()); - } + drops.addObject(new ItemTag(stack == null ? new ItemStack(Material.AIR) : stack)); } cancelled = false; dropItems = null; diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java index 03f209d6bb..4fb85a4e51 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java @@ -1550,7 +1550,7 @@ public String getAttribute(Attribute attribute) { // @returns ItemTag // @group inventory // @description - // If the entity is a horse or pig, returns the saddle as a ItemTag, or i@air if none. + // If the entity is a horse or pig, returns the saddle as a ItemTag, or air if none. // --> if (attribute.startsWith("saddle")) { if (getLivingEntity().getType() == EntityType.HORSE) { @@ -1568,7 +1568,7 @@ else if (getLivingEntity().getType() == EntityType.PIG) { // @returns ItemTag // @group inventory // @description - // If the entity is a horse, returns the item equipped as the horses armor, or i@air if none. + // If the entity is a horse, returns the item equipped as the horses armor, or air if none. // --> if (attribute.startsWith("horse_armor") || attribute.startsWith("horse_armour")) { if (getLivingEntity().getType() == EntityType.HORSE) { @@ -1600,7 +1600,7 @@ else if (getLivingEntity().getType() == EntityType.PIG) { // @returns ItemTag // @group inventory // @description - // Returns the item the entity is holding, or i@air if none. + // Returns the item the entity is holding, or air if none. // --> if (attribute.startsWith("item_in_hand") || attribute.startsWith("iteminhand")) { @@ -1613,7 +1613,7 @@ else if (getLivingEntity().getType() == EntityType.PIG) { // @returns ItemTag // @group inventory // @description - // Returns the item the entity is holding in their off hand, or i@air if none. + // Returns the item the entity is holding in their off hand, or air if none. // --> if (attribute.startsWith("item_in_offhand") || attribute.startsWith("iteminoffhand")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java index 39a3b249a8..cfe3ad0aa0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java @@ -2978,8 +2978,8 @@ else if (split.length > 1 && new ElementTag(split[1]).isBoolean()) { // can be one of the following: HAND, OFF_HAND, BOOTS, LEGS, CHEST, HEAD // Optionally, exclude the slot and item to stop showing the fake equipment, // if any, on the specified entity. - // - adjust fake_equipment:e@123|chest|i@diamond_chestplate - // - adjust fake_equipment:|head|i@jack_o_lantern + // - adjust fake_equipment:e@123|chest|diamond_chestplate + // - adjust fake_equipment:|head|jack_o_lantern // --> if (mechanism.matches("fake_equipment")) { if (!mechanism.getValue().asString().isEmpty()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/TradeTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/TradeTag.java index bc526bc91e..796603cf47 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/TradeTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/TradeTag.java @@ -42,7 +42,7 @@ public class TradeTag implements ObjectTag, Adjustable { // open two trades: // type: task // script: - // - opentrades trade@trade[max_uses=10;inputs=i@emerald[quantity=2];result=i@sponge|trade@trade[result=i@barrier] + // - opentrades trade@trade[max_uses=10;inputs=emerald[quantity=2];result=sponge|trade@trade[result=barrier] // // // For format info, see <@link language trade@> diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityFramed.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityFramed.java index d60908ea54..adb04e05e9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityFramed.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityFramed.java @@ -107,7 +107,7 @@ public String getAttribute(Attribute attribute) { // @mechanism EntityTag.framed // @group properties // @description - // If the entity is an item frame, returns the rotation of the material currently framed. + // If the entity is an item frame, returns the rotation of the item currently framed. // --> if (attribute.startsWith("framed_item_rotation")) { return new ElementTag(CoreUtilities.toLowerCase(getItemFrameEntity().getRotation().name())) @@ -120,7 +120,7 @@ public String getAttribute(Attribute attribute) { // @mechanism EntityTag.framed // @group properties // @description - // If the entity is an item frame, returns the material currently framed. + // If the entity is an item frame, returns the item currently framed. // --> if (attribute.startsWith("framed_item")) { return getItem() @@ -153,7 +153,7 @@ public void adjust(Mechanism mechanism) { // @description // Sets the entity's framed item and optionally the rotation as well. // Valid rotations: <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Rotation.html> - // For example: framed:i@diamond_sword|clockwise + // For example: framed:diamond_sword|clockwise // @tags // // diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/EquipCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/EquipCommand.java index 1faf3c5f52..d5079a5089 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/EquipCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/EquipCommand.java @@ -35,7 +35,7 @@ public class EquipCommand extends AbstractCommand { // // @Description // This command equips an item or armor to an entity or list of entities to the specified slot(s). - // Set the item to 'i@air' to unequip any slot. + // Set the item to 'air' to unequip any slot. // // @Tags // @@ -47,23 +47,23 @@ public class EquipCommand extends AbstractCommand { // // @Usage // Use to equip a stone block on the player's head. - // - equip head:i@stone + // - equip head:stone // // @Usage // Use to equip a iron helmet on two players named Bob and Steve. - // - equip p@bob|p@steve head:i@iron_helmet + // - equip p@bob|p@steve head:iron_helmet // // @Usage // Use to unequip all armor off the player. - // - equip head:i@air chest:i@air legs:i@air boots:i@air + // - equip head:air chest:air legs:air boots:air // // @Usage // Use to equip a saddle on a horse. - // - equip e@horse saddle:i@saddle + // - equip e@horse saddle:saddle // // @Usage // Use to equip a saddle on a pig. - // - equip e@pig saddle:i@saddle + // - equip e@pig saddle:saddle // --> @Override diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/DisplayItemCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/DisplayItemCommand.java index 3531b7d777..0ac0035735 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/DisplayItemCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/DisplayItemCommand.java @@ -42,19 +42,19 @@ public class DisplayItemCommand extends AbstractCommand implements Listener { // // @Usage // Use to display a stone block dropped at a players location - // - displayitem i@stone + // - displayitem stone // // @Usage // Use to display a diamond sword dropped at 12,64,-847 in world survival - // - displayitem i@diamond_sword l@12,64,-847,survival + // - displayitem diamond_sword l@12,64,-847,survival // // @Usage // Use to display redstone dust dropped at -54,100,-87 in world creative disappear after 10 seconds - // - displayitem i@redstone l@-54,100,-87,creative duration:10s + // - displayitem redstone l@-54,100,-87,creative duration:10s // // @Usage // Use to save the dropped item to save entry 'item_dropped' - // - displayitem i@redstone l@-54,100,-87,creative duration:10s save:item_dropped + // - displayitem redstone l@-54,100,-87,creative duration:10s save:item_dropped // --> @Override diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/FakeItemCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/FakeItemCommand.java index e9c9f59ac8..3b196998e7 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/FakeItemCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/FakeItemCommand.java @@ -42,11 +42,11 @@ public class FakeItemCommand extends AbstractCommand { // // @Usage // Use to show a clientside-only pumpkin on the player's head. - // - fakeitem i@pumpkin slot:head + // - fakeitem pumpkin slot:head // // @Usage // Use to show a fake book in the player's hand for 1 tick. - // - fakeitem "i@written_book[book=author|Morphan1|title|My Book|pages|This is my book!]" slot: duration:1t + // - fakeitem "written_book[book=author|Morphan1|title|My Book|pages|This is my book!]" slot: duration:1t // --> @Override diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/GiveCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/GiveCommand.java index 18deb92160..b32b0d1adc 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/GiveCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/GiveCommand.java @@ -50,7 +50,7 @@ public class GiveCommand extends AbstractCommand { // // @Usage // Use to give an item to the player. - // - give i@iron_sword + // - give iron_sword // // @Usage // Use to give an item and place it in a specific slot if possible. diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java index 3886181f3a..eef48a80f1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java @@ -47,7 +47,7 @@ public class InventoryCommand extends AbstractCommand { // open random inventory: // type: task // script: - // - inventory open "d:in@generic[size=18;title=My Awesome Inventory;contents=li@i@air|i@snow_ball]" + // - inventory open "d:in@generic[size=18;title=My Awesome Inventory;contents=li@air|snow_ball]" // // // --> @@ -82,7 +82,7 @@ public class InventoryCommand extends AbstractCommand { // // @Usage // Use to open a virtual inventory with a title and some items. - // - inventory open d:in@generic[size=27;title=BestInventory;contents=li@i@snow_ball|i@clay_brick] + // - inventory open d:in@generic[size=27;title=BestInventory;contents=li@snow_ball|clay_brick] // // @Usage // Use to open another player's inventory. @@ -91,7 +91,7 @@ public class InventoryCommand extends AbstractCommand { // @Usage // Use to remove all items from a chest, except any items in // the specified list. - // - inventory keep d:in@location[holder=l@123,123,123,world] o:li@i@snow_ball|i@ItemScript + // - inventory keep d:in@location[holder=l@123,123,123,world] o:li@snow_ball|ItemScript // // @Usage // Use to remove items specified in a chest from the current diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/NBTCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/NBTCommand.java index 7454f4e13b..90d979361c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/NBTCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/NBTCommand.java @@ -28,7 +28,7 @@ public class NBTCommand extends AbstractCommand { // // @Usage // Use to set a hidden value on an item and give the item to a player. - // - nbt i@snow_ball "MyCustomNBT.Damage:10" "save:SnowballOfDeath" + // - nbt snow_ball "MyCustomNBT.Damage:10" "save:SnowballOfDeath" // - give // // @Usage diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OpenTradesCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OpenTradesCommand.java index 025bb53900..410269b24c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OpenTradesCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OpenTradesCommand.java @@ -48,7 +48,7 @@ public class OpenTradesCommand extends AbstractCommand { // // @Usage // Use to open a list of trades with an optional title. - // - opentrades TradeTag[result=i@stone;inputs=li@i@stone;max_uses=9999]|TradeTag[result=i@barrier] "title:Useless Trades" + // - opentrades TradeTag[result=stone;inputs=li@stone;max_uses=9999]|TradeTag[result=barrier] "title:Useless Trades" // // @Usage // Use to force a player to trade with a villager. diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/DropCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/DropCommand.java index 2ed0c439af..1921d3730d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/DropCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/DropCommand.java @@ -45,7 +45,7 @@ public class DropCommand extends AbstractCommand { // // @Usage // Use to drop some loot around the player. - // - drop i@gold_nugget |].spawnable_blocks.random> + // - drop gold_nugget |].spawnable_blocks.random> // // @Usage // Use to reward a player with 500 xp. @@ -57,7 +57,7 @@ public class DropCommand extends AbstractCommand { // // @Usage // Use to drop an item with a pickup delay at the player's location. - // - drop i@diamond_sword delay:20s + // - drop diamond_sword delay:20s // --> enum Action {DROP_ITEM, DROP_EXP, DROP_ENTITY} diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/BookScriptContainer.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/BookScriptContainer.java index fdb776f431..73e44c6e51 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/BookScriptContainer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/BookScriptContainer.java @@ -22,8 +22,8 @@ public class BookScriptContainer extends ScriptContainer { // @description // Book script containers are similar to item script containers, except they are specifically // for the book items. They work with with the ItemTag object, and can be fetched - // with the Object Fetcher by using the ItemTag constructor i@book_script_name - // Example: - give i@my_book + // with the Object Fetcher by using the ItemTag constructor book_script_name + // Example: - give my_book // // // Book_Script_Name: diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InventoryScriptContainer.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InventoryScriptContainer.java index 193f995df8..d7563d189a 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InventoryScriptContainer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InventoryScriptContainer.java @@ -74,7 +74,7 @@ public class InventoryScriptContainer extends ScriptContainer { // procedural items: // - define list li@ // - foreach : - // - define item i@human_skull[skull_skin=<[value].name>] + // - define item human_skull[skull_skin=<[value].name>] // - define list <[list].include[<[item]>]> // - determine <[list]> // diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/ItemScriptContainer.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/ItemScriptContainer.java index d9b85db5c3..043553b70d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/ItemScriptContainer.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/ItemScriptContainer.java @@ -31,7 +31,7 @@ public class ItemScriptContainer extends ScriptContainer { // @description // Item script containers are an easy way to pre-define custom items for use within scripts. Item // scripts work with the ItemTag object, and can be fetched with the Object Fetcher by using the - // ItemTag constructor ItemTag_script_name. Example: - drop i@super_dooper_diamond + // ItemTag constructor ItemTag_script_name. Example: - drop super_dooper_diamond // // The following is the format for the container. Except for the 'material' key (and the dScript // required 'type' key), all other keys are optional. @@ -39,13 +39,13 @@ public class ItemScriptContainer extends ScriptContainer { // // # The name of the item script is the same name that you can use to construct a new // # ItemTag based on this item script. For example, an item script named 'sword of swiftness' - // # can be referred to as 'i@sword of swiftness'. + // # can be referred to as 'sword of swiftness'. // Item Script Name: // // type: item // - // # Must be a valid ItemTag (EG i@red_wool or i@potion,8226) See 'dItem' for more information. - // material: i@base_material + // # Must be a valid ItemTag (EG red_wool or potion,8226) See 'ItemTag' for more information. + // material: base_material // // # List any mechanisms you want to apply to the item within // mechanisms: @@ -69,7 +69,7 @@ public class ItemScriptContainer extends ScriptContainer { // - enchantment_name:level // - ... // - // # You can specify the items required to craft your item. For an empty slot, use i@air. + // # You can specify the items required to craft your item. For an empty slot, use air. // recipe: // - ItemTag|ItemTag|ItemTag // - ItemTag|ItemTag|ItemTag