Skip to content

Commit a7b6d8c

Browse files
committed
Documentation updates
1 parent a09855f commit a7b6d8c

8 files changed

Lines changed: 77 additions & 65 deletions

File tree

src/main/java/com/laytonsmith/core/functions/EntityManagement.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ public String getName() {
590590

591591
@Override
592592
public String docs() {
593-
return "mixed {entityID} Returns the EntityType of the entity with the specified ID."
593+
return "string {entityID} Returns the EntityType of the entity with the specified ID."
594594
+ " Returns null if the entity does not exist.";
595595
}
596596

@@ -1272,7 +1272,7 @@ public String getName() {
12721272

12731273
@Override
12741274
public String docs() {
1275-
return "mixed {entityID} Returns the ID of the given entity's rider, or null if it doesn't have one.";
1275+
return "string {entityID} Returns the ID of the given entity's rider, or null if it doesn't have one.";
12761276
}
12771277

12781278
@Override
@@ -1300,7 +1300,7 @@ public String getName() {
13001300

13011301
@Override
13021302
public String docs() {
1303-
return "mixed {entityID} Returns the ID of the given entity's vehicle, or null if it doesn't have one. ----"
1303+
return "string {entityID} Returns the ID of the given entity's vehicle, or null if it doesn't have one. ----"
13041304
+ " If the entity is on top of a stack of other entities, this returns the bottom most entity"
13051305
+ " on Bukkit versions 1.9 through much of 1.12.2. This was a bug. It returns the direct entity"
13061306
+ " underneath on other versions.";

src/main/java/com/laytonsmith/core/functions/InventoryManagement.java

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ public static String docs() {
4747
return "Provides methods for managing inventory related tasks.";
4848
}
4949

50+
private static final String ITEM_OBJECT = " An item object consists of an associative array with the following keys,"
51+
+ " name: the string id of the item,"
52+
+ " type: The numeric id of the item (deprecated),"
53+
+ " data: The data value of the item, or the damage if a damageable item,"
54+
+ " qty: The number of items in their inventory,"
55+
+ " meta: An array of item meta or null if none exists (see {{function|get_itemmeta}} for details).";
5056
@api(environments = {CommandHelperEnvironment.class})
5157
public static class pinv extends AbstractFunction {
5258

@@ -62,19 +68,15 @@ public Integer[] numArgs() {
6268

6369
@Override
6470
public String docs() {
65-
return "mixed {[player, [slot]]} Gets the inventory information for the specified player, or the current "
71+
return "array {[player, [slot]]} Gets the inventory information for the specified player, or the current "
6672
+ " player if none specified. If the index is specified, only the slot given will be returned."
6773
+ " The index of the array in the array is 0 - 35, 100 - 103, -106, which corresponds to the slot"
6874
+ " in the player's inventory. To access armor slots, you may also specify the index. (100 - 103)."
6975
+ " The quick bar is 0 - 8. If index is null, the item in the player's hand is returned, regardless"
7076
+ " of what slot is selected. If index is -106, the player's off-hand item is returned. If there is"
7177
+ " no item at the slot specified, null is returned."
7278
+ " ---- If all slots are requested, an associative array of item objects is returned, and if"
73-
+ " only one item is requested, just that single item object is returned. An item object"
74-
+ " consists of the following associative array(name: the string id of the item,"
75-
+ " type: The numeric id of the item, data: The data value of the item,"
76-
+ " or the damage if a damagable item, qty: The number of items in their inventory, meta: An array"
77-
+ " of item meta or null if none exists. See {{function|get_itemmeta}} for details about item meta.";
79+
+ " only one item is requested, just that single item object is returned." + ITEM_OBJECT;
7880
}
7981

8082
@Override
@@ -442,8 +444,7 @@ public String docs() {
442444
+ " second slot to be a stack of stone. set_pinv(array(103: array(type: 298))) gives them a hat."
443445
+ " To set the item in hand, use something like set_pinv(player(), null, array(type: 298))."
444446
+ " If you set a null key in an inventory array, only one of the items will be used (which one is"
445-
+ " undefined). Use an index of -106 to set the item in the player's off-hand. The type key"
446-
+ " supports the string item format (eg. \"35:11\") for convenience and backwards compatibility.";
447+
+ " undefined). Use an index of -106 to set the item in the player's off-hand.";
447448

448449
}
449450

@@ -1203,9 +1204,7 @@ public String docs() {
12031204
+ " enderchest would be: set_penderchest(array(2: array(type: 1, qty: 64))) This sets the chest's second slot"
12041205
+ " to be a stack of stone. set_penderchest(array(103: array(type: 298))) gives them a hat."
12051206
+ " Note that this uses the unsafe"
1206-
+ " enchantment mechanism to add enchantments, so any enchantment value will work. If"
1207-
+ " type uses the old format (for instance, \"35:11\"), then the second number is taken"
1208-
+ " to be the data, making this backwards compatible (and sometimes more convenient).";
1207+
+ " enchantment mechanism to add enchantments, so any enchantment value will work.";
12091208

12101209
}
12111210

@@ -1301,16 +1300,12 @@ public Integer[] numArgs() {
13011300

13021301
@Override
13031302
public String docs() {
1304-
return "mixed {[player, [index]]} Gets the inventory information for the specified player's enderchest, or the current player if none specified. If the index is specified, only the slot "
1305-
+ " given will be returned."
1306-
+ " The index of the array in the array is 0 - 26, which corresponds to the slot in the enderchest inventory."
1307-
+ " If there is no item at the slot specified, null is returned."
1303+
return "array {[player, [index]]} Gets the inventory for the specified player's enderchest, or the current"
1304+
+ " player if none specified. If the index is specified, only the slot given will be returned."
1305+
+ " The index of the array in the array is 0 - 26, which corresponds to the slot in the enderchest"
1306+
+ " inventory. If there is no item at the slot specified, null is returned."
13081307
+ " ---- If all slots are requested, an associative array of item objects is returned, and if"
1309-
+ " only one item is requested, just that single item object is returned. An item object"
1310-
+ " consists of the following associative array(type: The id of the item, data: The data value of the item,"
1311-
+ " or the damage if a damagable item, qty: The number of items in their inventory, enchants: An array"
1312-
+ " of enchant objects, with 0 or more associative arrays which look like:"
1313-
+ " array(etype: The type of enchantment, elevel: The strength of the enchantment))";
1308+
+ " only one item is requested, just that single item object is returned." + ITEM_OBJECT;
13141309
}
13151310

13161311
@Override
@@ -1749,16 +1744,12 @@ public Integer[] numArgs() {
17491744

17501745
@Override
17511746
public String docs() {
1752-
return "mixed {entityID, [index] | locationArray, [index]} Gets the inventory information for the specified block or entity."
1747+
return "array {entityID, [index] | locationArray, [index]} Gets the inventory for the specified block or entity."
17531748
+ " If the block or entity can't have an inventory, a FormatException is thrown. If the index is specified,"
1754-
+ " only the slot given will be returned. The max index of the array in the array is different for different types"
1755-
+ " of inventories. If there is no item at the slot specified, null is returned."
1749+
+ " only the slot given will be returned. The max index of the array in the array is different for"
1750+
+ " different types of inventories. If there is no item at the slot specified, null is returned."
17561751
+ " ---- If all slots are requested, an associative array of item objects is returned, and if"
1757-
+ " only one item is requested, just that single item object is returned. An item object"
1758-
+ " consists of the following associative array(type: The id of the item, data: The data value of the item,"
1759-
+ " or the damage if a damagable item, qty: The number of items in their inventory, enchants: An array"
1760-
+ " of enchant objects, with 0 or more associative arrays which look like:"
1761-
+ " array(etype: The type of enchantment, elevel: The strength of the enchantment))";
1752+
+ " only one item is requested, just that single item object is returned." + ITEM_OBJECT;
17621753
}
17631754

17641755
@Override
@@ -1835,9 +1826,7 @@ public String docs() {
18351826
+ " and it is skipped, but the function will not fail as a whole. A simple way to set one item would be:"
18361827
+ " set_inventory(123, array(2: array(type: 1, qty: 64))) This sets the inventory second slot"
18371828
+ " to be a stack of stone for entity with ID = 123. Note that this uses the unsafe"
1838-
+ " enchantment mechanism to add enchantments, so any enchantment value will work. If"
1839-
+ " type uses the old format (for instance, \"35:11\"), then the second number is taken"
1840-
+ " to be the data, making this backwards compatible (and sometimes more convenient).";
1829+
+ " enchantment mechanism to add enchantments, so any enchantment value will work.";
18411830

18421831
}
18431832

src/main/java/com/laytonsmith/core/functions/ItemMeta.java

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,26 @@ public static String docs() {
4040
}
4141

4242
private static final String applicableItemMeta = "<ul>"
43-
+ "<li>All items - display (string), lore (array of strings), enchants (An array of enchantment arrays, "
44-
+ " which are associative arrays that look like: array(etype: The type of enchantment, elevel:"
45-
+ " The strength of the enchantment)), repair (int, repair cost), flags(array). Possible flags: "
46-
+ StringUtils.Join(MCItemFlag.values(), ", ", " or ") + "</li>"
47-
+ "<li>Books - title (string), author (string), pages (array of strings)</li>"
48-
+ "<li>EnchantedBooks - stored (array of enchantment arrays (see Example))</li>"
49-
+ "<li>Leather Armor - color (color array (see Example))</li>"
50-
+ "<li>Skulls - owner (string) NOTE: the visual change only applies to player skulls</li>"
51-
+ "<li>Potions - potions (array of potion arrays), main(int, the id of the main effect)</li>"
52-
+ "<li>Banners - basecolor (string), patterns (array of pattern arrays)</li>"
53-
+ "<li>Fireworks - firework (array with strength (int), effects (array of effect arrays (see Example)))</li>"
54-
+ "<li>Firework Charges - effect (single Firework effect array)"
43+
+ "<li>All items - \"display\" (string), \"lore\" (array of strings), \"enchants\" (An array of enchantment"
44+
+ " arrays, which are associative arrays that look like: array(\"etype\": The type of enchantment, \"elevel\":"
45+
+ " The strength of the enchantment)), \"repair\" (int, repair cost), \"unbreakable\" (boolean), \"flags\""
46+
+ " (array). Possible flags: " + StringUtils.Join(MCItemFlag.values(), ", ", " or ") + "</li>"
47+
+ "<li>Books - \"title\" (string), author (string), \"pages\" (array of strings)</li>"
48+
+ "<li>EnchantedBooks - \"stored\" (array of enchantment arrays (see Example))</li>"
49+
+ "<li>Leather Armor - \"color\" (color array (see Example))</li>"
50+
+ "<li>Player Skulls - \"owner\" (string) or \"owneruuid\" (string)</li>"
51+
+ "<li>Potions - \"potions\" (array of potion arrays), \"base\" (an array with the keys \"type\","
52+
+ " \"extended\", and \"upgraded\")</li>"
53+
+ "<li>Banners - \"basecolor\" (string), \"patterns\" (an array of pattern arrays, each with the keys"
54+
+ " \"shape\" and \"color\")</li>"
55+
+ "<li>Fireworks - \"firework\" (array with strength (int), \"effects\" (array of effect arrays (see Example)))</li>"
56+
+ "<li>Firework Charges - \"effect\" (single Firework effect array)</li>"
57+
+ "<li>Storage Blocks - \"inventory\" (an array of item arrays)</li>"
58+
+ "<li>Mob Eggs/Spawners - \"spawntype\" (an entity type)</li>"
59+
+ "<li>Furnace - \"burntime\" (int), \"cooktime\" (int), and in \"inventory\" these keys can exist if an"
60+
+ " item exists in that slot: \"result\", \"fuel\", and \"smelting\".</li>"
61+
+ "<li>Brewing Stand - \"brewtime\" (int), \"fuel\" (int), and in \"inventory\" these keys can exist if an"
62+
+ " item exists in that slot: \"fuel\", \"ingredient\", \"leftbottle\", \"middlebottle\", and \"rightbottle\".</li>"
5563
+ "</ul>";
5664

5765
@api(environments = {CommandHelperEnvironment.class})
@@ -107,7 +115,7 @@ public Integer[] numArgs() {
107115

108116
@Override
109117
public String docs() {
110-
return "mixed {[player,] inventorySlot} Returns an associative array of known ItemMeta for the slot given,"
118+
return "array {[player,] inventorySlot} Returns an associative array of known ItemMeta for the slot given,"
111119
+ " or null if there isn't any. All items can have a display(name), lore, and/or enchants, "
112120
+ " and more info will be available for the items that have it. ---- Returned keys: "
113121
+ applicableItemMeta;

src/main/java/com/laytonsmith/core/functions/Meta.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ public Integer[] numArgs() {
597597

598598
@Override
599599
public String docs() {
600-
return "mixed {} Gets the command (as a string) that ended up triggering this script, exactly"
600+
return "string {} Gets the command (as a string) that ended up triggering this script, exactly"
601601
+ " how it was entered by the player. This could be null, if for instance"
602602
+ " it is called from within an event.";
603603
}

src/main/java/com/laytonsmith/core/functions/Persistence.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public Integer[] numArgs() {
150150

151151
@Override
152152
public String docs() {
153-
return "Mixed {[namespace, ...,] key} Returns a stored value stored with store_value. If the key doesn't exist in storage, null"
153+
return "mixed {[namespace, ...,] key} Returns a stored value stored with store_value. If the key doesn't exist in storage, null"
154154
+ " is returned. On a more detailed note: If the value stored in the persistence database is not actually a construct,"
155155
+ " then null is also returned.";
156156
}

src/main/java/com/laytonsmith/core/functions/PlayerManagement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4546,7 +4546,7 @@ public Integer[] numArgs() {
45464546

45474547
@Override
45484548
public String docs() {
4549-
return "mixed {[player]} Returns ID of vehicle which player is in or null if player is outside the vehicle";
4549+
return "string {[player]} Returns ID of vehicle which player is in or null if player is outside the vehicle";
45504550
}
45514551

45524552
@Override

src/main/resources/docs/Compatibility

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
This page lists compatibility of various milestone versions of CommandHelper. Note that this chart was created starting with build 1498, so earlier builds may not be accurate. In general, the compatibility requirements, if not listed, are the same as the previous milestone build. The minimum requirements for the current builds are:
22

3-
* Java 7
3+
* Java 8
44
* Bukkit version as specified below (when used as a Bukkit plugin)
55

66
Also note that CommandHelper may still be backwards and forward compatible to a large degree, many of the advanced features that normally have hard dependencies on certain versions of external dependencies have been configured to "soft" fail, that is, individual components may not work, but in general the plugin should continue to function. Regardless, only the most current dev builds are officially supported.
@@ -13,8 +13,8 @@ Also note that CommandHelper may still be backwards and forward compatible to a
1313
! scope="col" width="40%" | Milestone
1414
! scope="col" width="50%" | Compatibility
1515
|-
16-
| ??
17-
| ??
16+
| [http://builds.enginehub.org/job/commandhelper/10106 #3345-]
17+
| [https://github.com/EngineHub/CommandHelper/commit/40dc779ee121f771b1ac643e5d180365bec2ac80 40dc779e]
1818
| Updated several dependencies
1919
* com.jcraft:jsch ..................................... 0.1.51 -> 0.1.54
2020
* commons-codec:commons-codec .............................. 1.9 -> 1.11
@@ -27,29 +27,44 @@ Also note that CommandHelper may still be backwards and forward compatible to a
2727
* org.yaml:snakeyaml ...................................... 1.13 -> 1.20
2828
* redis.clients:jedis ................................... 2.5.1 -> 2.9.0
2929
|-
30+
| [http://builds.enginehub.org/job/commandhelper/9952 #3260-]
31+
| [https://github.com/EngineHub/commandhelper/commit/7450f62119a36d03c12620913e4ede4728da68e1 7450f621]
32+
| Removed remaining backwards compatibility for versions prior to 1.7.10
33+
| Bukkit 1.7.10 - 1.12.2
34+
|-
3035
| [http://builds.enginehub.org/job/commandhelper/9876 #3219-]
3136
| [https://github.com/EngineHub/CommandHelper/commit/4d970d0dc2edb1a7a648904df01af148bba761e1 4d970d0]
32-
| Updated for Spigot 1.12.1
33-
| Spigot 1.7.8 - 1.12.1
37+
| Updated for Bukkit 1.12.1
38+
| Bukkit 1.7.8 - 1.12.1
39+
|-
40+
| [http://builds.enginehub.org/job/commandhelper/8735 #3091-]
41+
| [https://github.com/sk89q/commandhelper/commit/8086fe6a80b7ee2b2250d775a7f0c4a711127aa2 8086fe]
42+
| Finished updating for Bukkit 1.9
43+
| Bukkit 1.7.8 - 1.9.0
44+
|-
45+
| [http://builds.enginehub.org/job/commandhelper/8450 #3040-]
46+
| [https://github.com/sk89q/commandhelper/commit/8b08d139216fd13519ceb5d85ca195c77e41aca1 8b08d139]
47+
| 3.3.2 snapshots start. All extensions need to be updated.
48+
| Bukkit 1.7.8 - 1.8.8
3449
|-
3550
| [http://builds.enginehub.org/job/commandhelper/7014 #2895-]
3651
| [https://github.com/sk89q/commandhelper/commit/6304f912f0be41e3522e0ae4191b1319ef8a8b89 6304f91]
37-
| Should still be compatible with former build
38-
| Spigot 1.7.6 - 1.8.6
52+
| Updated for Bukkit 1.8.6
53+
| Bukkit 1.7.6 - 1.8.6
3954
|-
4055
| [http://builds.enginehub.org/job/commandhelper/6821 #2857-]
4156
| [https://github.com/sk89q/commandhelper/commit/f8953eb485a6689299381c8f644ea16fb92e9853 f8953eb]
42-
| Removed WorldEdit dependency (See SKCompat extension)
57+
| Removed WorldEdit dependency (See https://letsbuild.net/jenkins/job/SKCompat/ SKCompat] extension)
4358
|-
4459
| [http://builds.enginehub.org/job/commandhelper/6776 #2842-]
4560
| [https://github.com/sk89q/commandhelper/commit/4b485fd208f2b43d0e5bae71c74b48b212dc0140 4b485fd]
46-
| Removed vault dependency (See CHVault extension)
61+
| Removed vault dependency (See [https://letsbuild.net/jenkins/job/CHVault/ CHVault] extension)
4762
|-
4863
| [http://builds.enginehub.org/job/commandhelper/6492 #2802-]
4964
| [https://github.com/sk89q/CommandHelper/commit/cc0f80e9983b13c2ff6f643fbbc441f8f86268e8 cc0f80e]
50-
| Updated for Spigot 1.8.
65+
| Updated for Bukkit 1.8
5166
* Vault 1.4
52-
| Spigot 1.7.2 - 1.8
67+
| Bukkit 1.7.2 - 1.8.0
5368
|-
5469
| [http://builds.enginehub.org/job/commandhelper/5115/ #2717-aca997c]
5570
| [https://github.com/sk89q/commandhelper/commit/aca997cf7a09f00a92cd46aefc3a8f44f478a3d5 aca997c]
@@ -63,17 +78,17 @@ Also note that CommandHelper may still be backwards and forward compatible to a
6378
* mysql-connector-java 5.1.30
6479
* jedis: 2.5.1
6580
|-
66-
| [http://builds.enginehub.org/job/commandhelper/5114/ #2716-512d9d3]
81+
| [http://builds.enginehub.org/job/commandhelper/5114/ #2716-]
6782
| [https://github.com/sk89q/commandhelper/commit/484c0645d302e22b8eec815acb54b91ea31c3b10 484c064]
6883
| Updated for Minecraft 1.7.9 (should still be compatible with 1.7.2 builds, excepting that Sound.BREATH and Sound.HURT have been removed).
6984
| Bukkit 1.7.2 - 1.7.9
7085
|-
71-
| [http://builds.enginehub.org/job/commandhelper/4876/ #2681-773d877]
86+
| [http://builds.enginehub.org/job/commandhelper/4876/ #2681-]
7287
| [https://github.com/sk89q/commandhelper/commit/773d877048514bb422b1e8755c9520ac99d9852a 773d877]
7388
| Updated to Minecraft 1.7.8 (should still be compatible with 1.7.2 builds, however)
7489
| Bukkit 1.7.2 - 1.7.8
7590
|-
76-
| [http://builds.enginehub.org/job/commandhelper/3463/ #2445-8c4b165]
91+
| [http://builds.enginehub.org/job/commandhelper/3463/ #2445-]
7792
| [https://github.com/sk89q/commandhelper/commit/8c4b1652ed5c43dddb95c7e6612aea072716aea5 8c4b165]
7893
| Updated to Minecraft 1.7.2
7994
| Bukkit 1.7.2

src/main/resources/docs/Logic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ Had we left the break() out, case 2 and the default case would have merged toget
279279

280280
{{TakeNote|text=While break() is in fact optional, it is still recommended that you use it when applicable.}}
281281

282-
Using break() is still recommeneded however, even though it is technically optional. Consider the following example.
282+
Using break() is still recommended however, even though it is technically optional. Consider the following example.
283283

284284
%%CODE|
285285
switch(@v){

0 commit comments

Comments
 (0)