Skip to content

Commit a09855f

Browse files
committed
Use locationArray more consistently in function docs
1 parent 0f38f19 commit a09855f

3 files changed

Lines changed: 45 additions & 38 deletions

File tree

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

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@
4444
import com.laytonsmith.core.exceptions.CancelCommandException;
4545
import com.laytonsmith.core.exceptions.ConfigRuntimeException;
4646

47-
/**
48-
*
49-
*/
5047
public class Environment {
5148

5249
public static String docs() {
@@ -68,7 +65,7 @@ public Integer[] numArgs() {
6865

6966
@Override
7067
public String docs() {
71-
return "string {x, y, z, [world] | xyzArray, [world]} Gets the id of the block at the coordinates. The format"
68+
return "string {x, y, z, [world] | locationArray, [world]} Gets the id of the block at the coordinates. The format"
7269
+ " of the return will be x:y where x is the id of the block, and y is the meta data for the block."
7370
+ " All blocks will return in this format, but blocks that don't have meta data will return 0 in y"
7471
+ " (eg. air is \"0:0\"). If a world isn't provided in the location array or as an argument, the"
@@ -268,7 +265,7 @@ public Integer[] numArgs() {
268265

269266
@Override
270267
public String docs() {
271-
return "void {xyzLocation, lineArray | xyzLocation, line1, [line2, [line3, [line4]]]}"
268+
return "void {locationArray, lineArray | locationArray, line1, [line2, [line3, [line4]]]}"
272269
+ " Sets the text of the sign at the given location. If the block at x,y,z isn't a sign,"
273270
+ " a RangeException is thrown. If the text on a line overflows 15 characters, it is simply"
274271
+ " truncated.";
@@ -363,8 +360,8 @@ public Integer[] numArgs() {
363360

364361
@Override
365362
public String docs() {
366-
return "array {xyzLocation} Given a location array, returns an array of 4 strings of the text in the sign at that"
367-
+ " location. If the location given isn't a sign, then a RangeException is thrown.";
363+
return "array {locationArray} Given a location array, returns an array of 4 strings of the text in the sign"
364+
+ " at that location. If the location given isn't a sign, then a RangeException is thrown.";
368365
}
369366

370367
@Override
@@ -423,7 +420,7 @@ public Integer[] numArgs() {
423420

424421
@Override
425422
public String docs() {
426-
return "boolean {xyzLocation} Returns true if the block at this location is a sign.";
423+
return "boolean {locationArray} Returns true if the block at this location is a sign.";
427424
}
428425

429426
@Override
@@ -473,8 +470,7 @@ public Integer[] numArgs() {
473470

474471
@Override
475472
public String docs() {
476-
return "void {locationArray} Mostly simulates a block break at a location. Does not trigger an event. Only works with"
477-
+ " craftbukkit.";
473+
return "void {locationArray} Mostly simulates a block break at a location. Does not trigger an event.";
478474
}
479475

480476
@Override
@@ -604,8 +600,8 @@ public Integer[] numArgs() {
604600

605601
@Override
606602
public String docs() {
607-
return "string {x, z, [world] | locationArray} Returns the biome type of this block column. The location array's"
608-
+ " y value is ignored. ---- The value returned"
603+
return "string {x, z, [world] | locationArray} Returns the biome type of this block column. The location"
604+
+ " array's y value is ignored. ---- The value returned"
609605
+ " may be one of the following: " + StringUtils.Join(MCBiomeType.types(), ", ", ", or ");
610606
}
611607

@@ -677,7 +673,7 @@ public Integer[] numArgs() {
677673

678674
@Override
679675
public String docs() {
680-
return "array {x, z, [world] | xyzArray, [world]} Gets the xyz of the highest block at a x and a z."
676+
return "array {x, z, [world] | locationArray, [world]} Gets the xyz of the highest block at a x and a z."
681677
+ "It works the same as get_block_at, except that it doesn't matter now what the Y is."
682678
+ "You can set it to -1000 or to 92374 it will just be ignored.";
683679
}
@@ -760,11 +756,11 @@ public Integer[] numArgs() {
760756

761757
@Override
762758
public String docs() {
763-
return "void {Locationarray, [size], [safe]} Creates an explosion with the given size at the given location."
764-
+ "Size defaults to size of a creeper (3), and null uses the default. If safe is true, (defaults to false)"
765-
+ " the explosion"
766-
+ " won't hurt the surrounding blocks. If size is 0, and safe is true, you will still see the animation"
767-
+ " and hear the sound, but players won't be hurt, and neither will the blocks.";
759+
return "void {locationArray, [size], [safe]} Creates an explosion with a given size at a given location."
760+
+ " Size defaults to size of a creeper (3), and null uses the default. If safe is true,"
761+
+ " (defaults to false) the explosion won't hurt the surrounding blocks. If size is 0, and safe is"
762+
+ " true, you will still see the animation and hear the sound, but players won't be hurt, and"
763+
+ " neither will the blocks.";
768764
}
769765

770766
@Override
@@ -933,7 +929,7 @@ public Integer[] numArgs() {
933929

934930
@Override
935931
public String docs() {
936-
return "void {[player], instrument, note, [location]} Plays a note for the given player, at the given location."
932+
return "void {[player], instrument, note, [locationArray]} Plays a note for the given player, at the given location."
937933
+ " Player defaults to the current player, and location defaults to the player's location. Instrument may be one of:"
938934
+ " " + StringUtils.Join(MCInstrument.values(), ", ", ", or ") + ", and note is an associative array with 2 values,"
939935
+ " array(octave: 0, tone: 'F#') where octave is either 0, 1, or 2, and tone is one of the notes "

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

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

325325
@Override
326326
public String docs() {
327-
return "void {xyzArray, effect, [radius]} Plays the specified effect (sound effect) at the given location, for all players within"
327+
return "void {locationArray, effect, [radius]} Plays the specified effect (sound effect) at the given location, for all players within"
328328
+ " the radius (or 64 by default). The effect can be one of the following: "
329329
+ StringUtils.Join(MCEffect.values(), ", ", ", or ", " or ")
330330
+ ". Additional data can be supplied with the syntax EFFECT:DATA. The RECORD_PLAY effect takes the item"

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

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -826,24 +826,35 @@ public Integer[] numArgs() {
826826

827827
@Override
828828
public String docs() {
829-
return "mixed {[pName], [value]} Returns various information about the player specified, or the current player if no argument was given. ---- "
830-
+ "If value is set, it should be an integer of one of the following indexes, and only that information for that index"
831-
+ " will be returned. Otherwise if value is not specified (or is -1), it returns an array of"
832-
+ " information with the following pieces of information in the specified index: "
833-
+ "<ul><li>0 - player's name; This will return the player's exact name, "
834-
+ " even if called with a partial match.</li><li>1 - player's location; an array of the player's xyz coordinates</li><li>2 - player's cursor; an array of the "
835-
+ "location of the player's cursor, or null if the block is out of sight.</li><li>3 - player's IP; Returns the IP address of this player.</li><li>4 - Display name; The name that is used when the"
836-
+ " player's name is displayed on screen typically. </li><li>5 - player's health; Gets the current health of the player, which will be an int"
837-
+ " from 0-20.</li><li>6 - Item in hand; The value returned by this will be similar to the value returned by get_block_at()</li><li>7 - "
838-
+ "World name; Gets the name of the world this player is in.</li><li>8 - Is Op; true or false if this player is an op.</li><li>9 - player groups;"
839-
+ " An array of the permissions groups the player is in.</li><li>10 - The player's hostname (or IP if a hostname can't be found)</li>"
840-
+ " <li>11 - Is sneaking?</li><li>12 - Host; The host the player connected to.</li>"
841-
+ " <li>13 - Player UUID (This is the same as 20, but is left in for backwards compatibility reasons.)</li>"
842-
+ " <li>14 - Is player in a vehicle? Returns true or false.</li>"
843-
+ " <li>15 - The slot number of the player's current hand.</li>"
844-
+ " <li>16 - Is sleeping?</li><li>17 - Is blocking?</li><li>18 - Is flying?</li><li>19 - Is sprinting?</li>"
845-
+ " <li>20 - Player UUID"
846-
+ " </ul>";
829+
return "mixed {[player], [value]} Returns various information about the player specified, or the current"
830+
+ " player if no argument was given. ----"
831+
+ " If value is set, it should be an integer of one of the following indexes, and only that"
832+
+ " information for that index will be returned. Otherwise if value is not specified (or is -1), it"
833+
+ " returns an array of information with the following pieces of information in the specified index:"
834+
+ "<ul>"
835+
+ "<li>0 - player's name; This will return the player's exact name,"
836+
+ " even if called with a partial match.</li>"
837+
+ "<li>1 - player's location; a location array of the player's coordinates</li>"
838+
+ "<li>2 - player's cursor; an array of the location of the player's cursor,"
839+
+ " or null if the block is out of sight.</li>"
840+
+ "<li>3 - player's IP; Returns the IP address of this player.</li>"
841+
+ "<li>4 - Display name; The name that is typically used when displayed on screen.</li>"
842+
+ "<li>5 - player's health; The current health of the player, which will be an int from 0-20.</li>"
843+
+ "<li>6 - Item in hand; The type and data for the item in the 0:0 format. (deprecated)</li>"
844+
+ "<li>7 - World name; Gets the name of the world this player is in.</li>"
845+
+ "<li>8 - Is Op; true or false if this player is an op.</li>"
846+
+ "<li>9 - player groups; An array of the groups the player is in, by permission nodes.</li>"
847+
+ "<li>10 - The player's hostname (or IP if a hostname can't be found)</li>"
848+
+ "<li>11 - Is sneaking?</li><li>12 - Host; The host the player connected to.</li>"
849+
+ "<li>13 - Player UUID; (This is the same as 20, but exists for backwards compatibility.)</li>"
850+
+ "<li>14 - Is player in a vehicle? Returns true or false.</li>"
851+
+ "<li>15 - Held Slot; The slot number of the player's current hand.</li>"
852+
+ "<li>16 - Is sleeping?</li>"
853+
+ "<li>17 - Is blocking?</li>"
854+
+ "<li>18 - Is flying?</li>"
855+
+ "<li>19 - Is sprinting?</li>"
856+
+ "<li>20 - Player UUID; The unique identifier for this player's account as returned by puuid()."
857+
+ "</ul>";
847858
}
848859

849860
@Override

0 commit comments

Comments
 (0)