Permalink
Browse files

Update documentation for Minecraft functions

  • Loading branch information...
PseudoKnight committed Sep 16, 2018
1 parent 75dc6d0 commit 649b753da5c2f72e971be1e73abe5c5f73d8de3d

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -304,11 +304,12 @@ public String getName() {
@Override
public String docs() {
return "string {x, y, z, [world] | locationArray, [world]} Gets the id of the block at the coordinates. The format"
+ " of the return will be x:y where x is the id of the block, and y is the meta data for the block."
+ " All blocks will return in this format, but blocks that don't have meta data will return 0 in y"
+ " (eg. air is \"0:0\"). If a world isn't provided in the location array or as an argument, the"
+ " current player's world is used.";
return "string {x, y, z, [world] | locationArray, [world]} Gets the id of the block at the coordinates."
+ " The format of the return will be x:y where x is the id of the block,"
+ " and y is the meta data for the block. All blocks will return in this format,"
+ " but blocks that don't have meta data will return 0 in y (eg. air is \"0:0\")."
+ " If a world isn't provided in the location array or as an argument,"
+ " the current player's world is used. (deprecated for get_block())";
}
@Override
@@ -407,9 +408,10 @@ public String getName() {
public String docs() {
return "void {x, y, z, id, [world] [physics] | locationArray, id, [physics]} Sets the id of the block at"
+ " the x y z coordinates specified. The id must be an integer or a blocktype identifier similar to"
+ " the type returned from get_block_at (eg. \"0:0\"). If the meta value is not specified, 0 is used."
+ " If world isn't specified, the current player's world is used. Physics (which defaults to true)"
+ " specifies whether or not to update the surrounding blocks when this block is set.";
+ " the type returned from get_block_at (eg. \"0:0\"). If the meta value is not specified,"
+ " 0 is used. If world isn't specified, the current player's world is used."
+ " Physics (which defaults to true) specifies whether or not to update the surrounding blocks when"
+ " this block is set. (deprecated for set_block())";
}
@Override
@@ -526,8 +528,7 @@ public String getName() {
public String docs() {
return "void {locationArray, lineArray | locationArray, line1, [line2, [line3, [line4]]]}"
+ " Sets the text of the sign at the given location. If the block at x,y,z isn't a sign,"
+ " a RangeException is thrown. If the text on a line overflows 15 characters, it is simply"
+ " truncated.";
+ " a RangeException is thrown. If a text line cannot fit on the sign, it'll be cut off.";
}
@Override
@@ -955,9 +956,8 @@ public String getName() {
@Override
public String docs() {
return "array {x, z, [world] | locationArray, [world]} Gets the xyz of the highest block at a x and a z."
+ "It works the same as get_block_at, except that it doesn't matter now what the Y is."
+ "You can set it to -1000 or to 92374 it will just be ignored.";
return "array {x, z, [world] | locationArray, [world]} Gets a location array for the highest block at a"
+ " specific x and z column. If a location array is specified, the y coordinate is ignored.";
}
@Override
@@ -1095,7 +1095,8 @@ public Construct exec(Target t, com.laytonsmith.core.environments.Environment en
if(w == null) {
if(!(env.getEnv(CommandHelperEnvironment.class).GetCommandSender() instanceof MCPlayer)) {
throw new CREPlayerOfflineException(this.getName() + " needs a world in the location array, or a player so it can take the current world of that player.", t);
throw new CREPlayerOfflineException(this.getName() + " needs a world in the location array,"
+ " or a player so it can take the current world of that player.", t);
}
m = env.getEnv(CommandHelperEnvironment.class).GetPlayer();
@@ -1167,7 +1168,8 @@ public Construct exec(Target t, com.laytonsmith.core.environments.Environment en
try {
i = MCInstrument.valueOf(args[instrumentOffset].val().toUpperCase().trim());
} catch (IllegalArgumentException e) {
throw new CREFormatException("Instrument provided is not a valid type, required one of: " + StringUtils.Join(MCInstrument.values(), ", ", ", or "), t);
throw new CREFormatException("Instrument provided is not a valid type, required one of: "
+ StringUtils.Join(MCInstrument.values(), ", ", ", or "), t);
}
MCTone tone = null;
if(args[noteOffset] instanceof CArray) {
@@ -1211,11 +1213,14 @@ public String getName() {
@Override
public String docs() {
return "void {[player], instrument, note, [locationArray]} Plays a note for the given player, at the given location."
+ " Player defaults to the current player, and location defaults to the player's location. Instrument may be one of:"
+ " " + StringUtils.Join(MCInstrument.values(), ", ", ", or ") + ", and note is an associative array with 2 values,"
+ " array(octave: 0, tone: 'F#') where octave is either 0, 1, or 2, and tone is one of the notes "
+ StringUtils.Join(MCTone.values(), ", ", ", or ") + ", optionally suffixed with a pound symbol, which denotes a sharp."
return "void {[player], instrument, note, [locationArray]} Plays a note for the given player, at the given"
+ " note block location. Player defaults to the current player, and location defaults to the"
+ " player's location. Instrument may be one of: "
+ StringUtils.Join(MCInstrument.values(), ", ", ", or ")
+ ", and note is an associative array with 2 values, array(octave: 0, tone: 'F#') where octave is"
+ " either 0, 1, or 2, and tone is one of the notes "
+ StringUtils.Join(MCTone.values(), ", ", ", or ")
+ ", optionally suffixed with a pound symbol, which denotes a sharp."
+ " (Not all notes can be sharped.)";
}
@@ -1481,7 +1486,7 @@ public String docs() {
+ " be a single player or an array of players to play the sound to, if"
+ " not given, all players can potentially hear it. ---- Possible categories: "
+ StringUtils.Join(MCSoundCategory.values(), ", ", ", or ", " or ") + "."
+ " \nPossible sounds: " + StringUtils.Join(MCSound.types(), "\n");
+ " \n\nPossible sounds: " + StringUtils.Join(MCSound.types(), "<br>");
}
@Override
@@ -1694,7 +1699,9 @@ public String getName() {
@Override
public String docs() {
return "mixed {locationArray, [index]} Returns an associative array with various information about a block."
+ " If an index is specified, it will return a boolean. ---- <ul>"
+ " If an index is specified, it will return a boolean. ---- The accuracy of these values will"
+ " depend on the server implementation."
+ "<ul>"
+ " <li>solid: If a block is solid (i.e. dirt or stone, as opposed to a torch or water)</li>"
+ " <li>flammable: Indicates if a block can catch fire</li>"
+ " <li>transparent: Indicates if light can pass through</li>"
@@ -1793,8 +1800,9 @@ public String getName() {
@Override
public String docs() {
return "boolean {locationArray, [checkMode]} Returns whether or not a block is being supplied with power."
+ "checkMode can be: \"BOTH\" (Check both direct and indirect power), \"DIRECT_ONLY\" (Check direct power only)"
+ " or \"INDIRECT_ONLY\" (Check indirect power only). CheckMode defaults to \"BOTH\".";
+ "checkMode can be: \"BOTH\" (Check both direct and indirect power),"
+ " \"DIRECT_ONLY\" (Check direct power only) or \"INDIRECT_ONLY\" (Check indirect power only)."
+ " CheckMode defaults to \"BOTH\".";
}
@Override
@@ -1881,7 +1889,7 @@ public String getName() {
@Override
public String docs() {
return "int {locationArray} Returns the redstone power level that is supplied to this block [0-15]."
+ " If is_block_powered(locationArray, 'DIRECT_ONLY') returns true, a redstone ore placed at the"
+ " If is_block_powered(locationArray, 'DIRECT_ONLY') returns true, a redstone dust placed at the"
+ " given location would be powered the return value - 1.";
}
@@ -1933,8 +1941,10 @@ public Boolean runAsync() {
@Override
public String docs() {
return "boolean {locationArray, [treeType]} Generates a tree at the given location and returns if the generation succeeded or not."
+ " treeType can be " + StringUtils.Join(MCTreeType.values(), ", ", ", or ", " or ") + ", defaulting to TREE.";
return "boolean {locationArray, [treeType]} Generates a tree at the given location and returns if the"
+ " generation succeeded or not. The treeType can be "
+ StringUtils.Join(MCTreeType.values(), ", ", ", or ", " or ")
+ ", defaulting to TREE.";
}
@Override
@@ -405,11 +405,12 @@ public String getName() {
@Override
public String docs() {
return "void {locationArray, effect, [radius]} Plays the specified effect (sound effect) at the given location, for all players within"
+ " the radius (or 64 by default). The effect can be one of the following: "
return "void {locationArray, effect, [radius]} Plays the specified effect at the given location"
+ " for all players within the radius (or 64 by default). The effect can be one of the following: "
+ StringUtils.Join(MCEffect.values(), ", ", ", or ", " or ")
+ ". Additional data can be supplied with the syntax EFFECT:DATA. The RECORD_PLAY effect takes the item"
+ " id of a disc as data, STEP_SOUND takes a blockID and SMOKE takes a direction bit (4 is upwards).";
+ ". Additional data can be supplied with the syntax EFFECT:DATA. The STEP_SOUND effect takes an"
+ " int of a legacy block id, SMOKE takes an int as a direction (4 is upwards), and POTION_BREAK"
+ " takes an int as a color.";
}
@Override
@@ -509,8 +510,9 @@ public String getName() {
@Override
public String docs() {
return "mixed {[value]} Returns various information about server."
+ "If value is set, it should be an integer of one of the following indexes, and only that information for that index"
+ " will be returned. ---- Otherwise if value is not specified (or is -1), it returns an array of"
+ "If value is set, it should be an integer of one of the following indexes,"
+ " and only that information for that index will be returned."
+ " ---- Otherwise if value is not specified (or is -1), it returns an array of"
+ " information with the following pieces of information in the specified index: "
+ "<ul><li>0 - Server name; the name of the server in server.properties.</li>"
+ "<li>1 - API version; The version of the plugin API this server is implementing.</li>"
@@ -694,7 +696,7 @@ public String getName() {
@Override
public String docs() {
return "Array {} An array of players banned on the server.";
return "array {} An array of players banned on the server.";
}
@Override
@@ -748,7 +750,7 @@ public String getName() {
@Override
public String docs() {
return "Array {} An array of players whitelisted on the server.";
return "array {} An array of players whitelisted on the server.";
}
@Override
@@ -833,8 +835,7 @@ public String getName() {
@Override
public String docs() {
return "string {locationArray} Gets the spawner type of the specified mob spawner. ----"
+ " Valid types will be one of the mob types.";
return "string {locationArray} Gets the entity type that will spawn from the specified mob spawner.";
}
@Override
@@ -896,8 +897,9 @@ public String getName() {
@Override
public String docs() {
return "void {locationArray, type} Sets the mob spawner type at the location specified. If the location is not a mob spawner,"
+ " or if the type is invalid, a FormatException is thrown. The type may be one of either "
return "void {locationArray, type} Sets the mob spawner's entity type at the location specified."
+ " If the location is not a mob spawner, or if the type is invalid, a FormatException is thrown."
+ " ---- The type may be one of either "
+ StringUtils.Join(MCEntityType.MCVanillaEntityType.values(), ", ", ", or ");
}
@@ -947,9 +949,9 @@ public String getName() {
public String docs() {
return "void {player, url} Sends a resourcepack URL to the player's client."
+ " If the client has not been requested to change resources in the"
+ " past, they will recieve a confirmation dialog before downloading"
+ " past, they will receive a confirmation dialog before downloading"
+ " and switching to the new pack. Clients that ignore server resources"
+ " will not recieve the request, so this function will not affect them.";
+ " will not receive the request, so this function will not affect them.";
}
@Override
@@ -1155,7 +1157,7 @@ public String docs() {
+ " it returns only that trait. Available traits: hasGravity, isBlock, isBurnable, isEdible,"
+ " isFlammable, isOccluding, isRecord, isSolid, isTransparent, isInteractable, maxDurability,"
+ " hardness (for block materials only), blastResistance (for block materials only),"
+ " and maxStacksize.";
+ " and maxStacksize. The accuracy of these values depend on the server implementation.";
}
@Override
@@ -1293,9 +1295,10 @@ public String getName() {
@Override
public String docs() {
return "void {location, [isMonitored]} Sets up a location to be monitored for redstone changes. If a location is monitored,"
+ " it will cause redstone_changed events to be trigged. By default, isMonitored is true, however, setting it to false"
+ " will remove the previously monitored location from the list of monitors.";
return "void {location, [isMonitored]} Sets up a location to be monitored for redstone changes."
+ " If a location is monitored, it will cause redstone_changed events to be triggered. By default,"
+ " isMonitored is true, however, setting it to false will remove the previously monitored location"
+ " from the list of monitors.";
}
@Override
Oops, something went wrong.

0 comments on commit 649b753

Please sign in to comment.