Skip to content

Commit

Permalink
clean some meta
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 7, 2019
1 parent f8e3712 commit cef54ae
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 45 deletions.
Expand Up @@ -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.
//
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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")) {
Expand All @@ -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")) {
Expand Down
Expand Up @@ -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 <player> fake_equipment:e@123|chest|i@diamond_chestplate
// - adjust <player> fake_equipment:<player>|head|i@jack_o_lantern
// - adjust <player> fake_equipment:e@123|chest|diamond_chestplate
// - adjust <player> fake_equipment:<player>|head|jack_o_lantern
// -->
if (mechanism.matches("fake_equipment")) {
if (!mechanism.getValue().asString().isEmpty()) {
Expand Down
Expand Up @@ -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]
// </code>
//
// For format info, see <@link language trade@>
Expand Down
Expand Up @@ -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()))
Expand All @@ -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()
Expand Down Expand Up @@ -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
// <EntityTag.is_frame>
// <EntityTag.has_framed_item>
Expand Down
Expand Up @@ -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
// <EntityTag.equipment>
Expand All @@ -47,23 +47,23 @@ public class EquipCommand extends AbstractCommand {
//
// @Usage
// Use to equip a stone block on the player's head.
// - equip <player> head:i@stone
// - equip <player> 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 <player> head:i@air chest:i@air legs:i@air boots:i@air
// - equip <player> 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
Expand Down
Expand Up @@ -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 <player.location>
// - displayitem stone <player.location>
//
// @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
Expand Down
Expand Up @@ -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:<player.item_in_hand.slot> duration:1t
// - fakeitem "written_book[book=author|Morphan1|title|My Book|pages|This is my book!]" slot:<player.item_in_hand.slot> duration:1t
// -->

@Override
Expand Down
Expand Up @@ -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.
Expand Down
Expand Up @@ -47,7 +47,7 @@ public class InventoryCommand extends AbstractCommand {
// open random inventory:
// type: task
// script:
// - inventory open "d:in@generic[size=18;title=<red>My <green>Awesome <blue>Inventory;contents=li@i@air|i@snow_ball]"
// - inventory open "d:in@generic[size=18;title=<red>My <green>Awesome <blue>Inventory;contents=li@air|snow_ball]"
// </code>
//
// -->
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down
Expand Up @@ -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 <entry[SnowballOfDeath].new_item>
//
// @Usage
Expand Down
Expand Up @@ -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.
Expand Down
Expand Up @@ -45,7 +45,7 @@ public class DropCommand extends AbstractCommand {
//
// @Usage
// Use to drop some loot around the player.
// - drop i@gold_nugget <cuboid[cu@<player.location.add[-2,-2,-2]>|<player.location.add[2,2,2]>].spawnable_blocks.random>
// - drop gold_nugget <cuboid[cu@<player.location.add[-2,-2,-2]>|<player.location.add[2,2,2]>].spawnable_blocks.random>
//
// @Usage
// Use to reward a player with 500 xp.
Expand All @@ -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 <player.location> delay:20s
// - drop diamond_sword <player.location> delay:20s
// -->

enum Action {DROP_ITEM, DROP_EXP, DROP_ENTITY}
Expand Down
Expand Up @@ -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 <player> i@my_book
// with the Object Fetcher by using the ItemTag constructor book_script_name
// Example: - give <player> my_book
//
// <code>
// Book_Script_Name:
Expand Down
Expand Up @@ -74,7 +74,7 @@ public class InventoryScriptContainer extends ScriptContainer {
// procedural items:
// - define list li@
// - foreach <server.list_online_players>:
// - define item i@human_skull[skull_skin=<[value].name>]
// - define item human_skull[skull_skin=<[value].name>]
// - define list <[list].include[<[item]>]>
// - determine <[list]>
//
Expand Down
Expand Up @@ -31,21 +31,21 @@ 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 <player.location> i@super_dooper_diamond
// ItemTag constructor ItemTag_script_name. Example: - drop <player.location> 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.
//
// <code>
// # 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:
Expand All @@ -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
Expand Down

0 comments on commit cef54ae

Please sign in to comment.