Skip to content

Commit

Permalink
meta format standardization
Browse files Browse the repository at this point in the history
also match core commit also cuboid error catch
  • Loading branch information
mcmonkey4eva committed Jan 15, 2022
1 parent 07655c8 commit 081ab90
Show file tree
Hide file tree
Showing 15 changed files with 528 additions and 524 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ public CuboidTag(Location point_1, Location point_2) {
}

public void addPair(LocationTag point_1, LocationTag point_2) {
if (point_1.getWorldName() == null) {
Debug.echoError("Tried to make cuboid without a world!");
return;
}
if (!point_1.getWorldName().equals(point_2.getWorldName())) {
Debug.echoError("Tried to make cross-world cuboid!");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1183,18 +1183,18 @@ public String identify(Supplier<String> mechsHandler) {
public String getWaitingMechanismsDebuggable() {
StringBuilder properties = new StringBuilder();
for (Mechanism mechanism : mechanisms) {
properties.append(mechanism.getName()).append("<G>=<Y>").append(PropertyParser.escapePropertyValue(mechanism.getValue().asString())).append("<G>; <Y>");
properties.append(mechanism.getName()).append(" <LG>=<Y> ").append(mechanism.getValue().asString()).append("<LG>; <Y>");
}
if (properties.length() > 0) {
return "<G>[<Y>" + properties.substring(0, properties.length() - "; <Y>".length()) + " <G>]";
return "<LG>[<Y>" + properties.substring(0, properties.length() - "; <Y>".length()) + " <LG>]";
}
return "";
}

public String getWaitingMechanismsString() {
StringBuilder properties = new StringBuilder();
for (Mechanism mechanism : mechanisms) {
properties.append(mechanism.getName()).append("=").append(PropertyParser.escapePropertyValue(mechanism.getValue().asString())).append(";");
properties.append(PropertyParser.escapePropertyKey(mechanism.getName())).append("=").append(PropertyParser.escapePropertyValue(mechanism.getValue().asString())).append(";");
}
if (properties.length() > 0) {
return "[" + properties.substring(0, properties.length() - 1) + "]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3360,7 +3360,7 @@ else if (getPlayerEntity().getGameMode() == GameMode.SPECTATOR) {
// To cause real spectator mode spectating, use <@link mechanism PlayerTag.spectator_target>
// Note that in some cases you may want to force the player into the spectate gamemode prior to using this mechanism.
// Note: They cannot cancel the spectating without a re-log -- you must make them spectate themselves to cancel the effect.
// (i.e. - adjust <player> spectate:<player>)
// Like: - adjust <player> spectate:<player>
// -->
if (mechanism.matches("spectate") && mechanism.requireObject(EntityTag.class)) {
NMSHandler.getPacketHelper().forceSpectate(getPlayerEntity(), mechanism.valueAsType(EntityTag.class).getBukkitEntity());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ public class AssignmentScriptContainer extends ScriptContainer {
// <code>
// Assignment_Script_Name:
//
// type: assignment
// type: assignment
//
// # | All assignment scripts MUST have this key!
// actions:
// on <action>:
// - ...
// # | All assignment scripts MUST have this key!
// actions:
// on <action>:
// - ...
//
// # | Most assignment scripts should exclude this key, but it's available.
// default constants:
// <constant_name>: <value>
// <constant_list>:
// - ...
// # | Most assignment scripts should exclude this key, but it's available.
// default constants:
// <constant_name>: <value>
// <constant_list>:
// - ...
//
// # | MOST assignment scripts should have this key!
// interact scripts:
// - <interact_script_name>
// </code>
// # | MOST assignment scripts should have this key!
// interact scripts:
// - <interact_script_name>
// </code>
//
// All part of an assignment script are optional. The three features provided can be
// used together, but do not require one another.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@ public class BookScriptContainer extends ScriptContainer {
// <code>
// Book_Script_Name:
//
// type: book
// type: book
//
// # The 'custom name' can be anything you wish.
// # | All book scripts MUST have this key!
// title: custom name
// # The 'custom name' can be anything you wish.
// # | All book scripts MUST have this key!
// title: custom name
//
// # The 'custom name' can be anything you wish.
// # | All book scripts MUST have this key!
// author: custom name
// # The 'custom name' can be anything you wish.
// # | All book scripts MUST have this key!
// author: custom name
//
// # Defaults to true. Set to false to spawn a 'book and quill' instead of a 'written book'.
// # | Some book scripts might have this key!
// signed: true/false
// # Defaults to true. Set to false to spawn a 'book and quill' instead of a 'written book'.
// # | Some book scripts might have this key!
// signed: true/false
//
// # Each -line in the text section represents an entire page.
// # To create a newline, use the tag <n>. To create a paragraph, use <p>.
// # | All book scripts MUST have this key!
// text:
// - page
// - ...
// # Each -line in the text section represents an entire page.
// # To create a newline, use the tag <n>. To create a paragraph, use <p>.
// # | All book scripts MUST have this key!
// text:
// - page
// - ...
// </code>
//
// -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,90 +50,90 @@ public class CommandScriptContainer extends ScriptContainer {
// # The name of the script doesn't matter, and will not affect the command in any way.
// Command_Script_Name:
//
// type: command
// type: command
//
// # The name of the command. This will be the default method for running the command, and will show in '/help'.
// # | All command scripts MUST have this key!
// name: mycmd
// # The name of the command. This will be the default method for running the command, and will show in '/help'.
// # | All command scripts MUST have this key!
// name: mycmd
//
// # The description of the command. This will be shown in the '/help' command.
// # Multiple lines are acceptable, via <&nl> (the tag for a new line), but you should
// # make the first line a brief summary of what your command does.
// # | All command scripts MUST have this key!
// description: My command.
// # The description of the command. This will be shown in the '/help' command.
// # Multiple lines are acceptable, via <&nl> (the tag for a new line), but you should
// # make the first line a brief summary of what your command does.
// # | All command scripts MUST have this key!
// description: My command.
//
// # Correct usage for the command. This will show in the '/help' command.
// # This is NOT the name of the command, and it is NOT used to control input parsing. It is EXCLUSIVELY for '/help'.
// # | All command scripts MUST have this key!
// usage: /mycmd <&lt>myArg1<&gt>
// # Correct usage for the command. This will show in the '/help' command.
// # This is NOT the name of the command, and it is NOT used to control input parsing. It is EXCLUSIVELY for '/help'.
// # | All command scripts MUST have this key!
// usage: /mycmd <&lt>myArg1<&gt>
//
// # A list of aliases for the command. These will be used as alternative ways to trigger the command, and will show in the '/help' command.
// # | Some command scripts might have this key, but it's optional.
// aliases:
// - myalias
// - mycommand
// # A list of aliases for the command. These will be used as alternative ways to trigger the command, and will show in the '/help' command.
// # | Some command scripts might have this key, but it's optional.
// aliases:
// - myalias
// - mycommand
//
// # The permission node to check for permissions plugins. This will automatically
// # block players without the permission from accessing the command and help for
// # the command.
// # Note that you can include multiple permission nodes (a player only needs to have any one permission from the list)
// # by separating them with a semicolon, like: perm.one;perm.two;third.perm
// # | Most command scripts should have this key!
// permission: my.permission.node
// # The permission node to check for permissions plugins. This will automatically
// # block players without the permission from accessing the command and help for
// # the command.
// # Note that you can include multiple permission nodes (a player only needs to have any one permission from the list)
// # by separating them with a semicolon, like: perm.one;perm.two;third.perm
// # | Most command scripts should have this key!
// permission: my.permission.node
//
// # The message to send to the player when they try to use the command without
// # permission. If this is not specified, the default Bukkit message will be sent.
// # Has "permission" def available.
// # | Most command scripts should NOT have this key, but it's available.
// permission message: Sorry, <player.name>, you can't use my command because you don't have the permission '<[permission]>'!
// # The message to send to the player when they try to use the command without
// # permission. If this is not specified, the default Bukkit message will be sent.
// # Has "permission" def available.
// # | Most command scripts should NOT have this key, but it's available.
// permission message: Sorry, <player.name>, you can't use my command because you don't have the permission '<[permission]>'!
//
// # The procedure-based script that will be checked when a player or the console
// # is trying to view help for this command. This must always be determined true
// # or false. If there is no script, it's assumed that all players and the console
// # should be allowed to view the help for this command.
// # Available context: <context.server> returns whether the server is viewing the help (a player if false).
// # | Most command scripts should NOT have this key, but it's available.
// allowed help:
// - determine <player.has_flag[special_allowed_help_flag]||<context.server>>
// # The procedure-based script that will be checked when a player or the console
// # is trying to view help for this command. This must always be determined true
// # or false. If there is no script, it's assumed that all players and the console
// # should be allowed to view the help for this command.
// # Available context: <context.server> returns whether the server is viewing the help (a player if false).
// # | Most command scripts should NOT have this key, but it's available.
// allowed help:
// - determine <player.has_flag[special_allowed_help_flag]||<context.server>>
//
// # You can optionally specify tab completions on a per-argument basis.
// # Available context:
// # <context.args> returns a list of input arguments.
// # <context.raw_args> returns all the arguments as raw text.
// # <context.server> returns whether the server is using tab completion (a player if false).
// # <context.alias> returns the command alias being used.
// # | This key is great to have when used well, but is not required.
// tab completions:
// # This will complete "alpha" and "beta" for the first argument
// 1: alpha|beta
// # This will complete any online player name for the second argument
// 2: <server.online_players.parse[name]>
// # This will allow flags "-a", "-b", or "-c" to be entered in the third, fourth, or fifth argument.
// 3 4 5: -a|-b|-c
// # Any argument other than the ones explicitly listed will be handled here with a tab complete that just says 'StopTyping'.
// default: StopTyping
// # You can optionally specify tab completions on a per-argument basis.
// # Available context:
// # <context.args> returns a list of input arguments.
// # <context.raw_args> returns all the arguments as raw text.
// # <context.server> returns whether the server is using tab completion (a player if false).
// # <context.alias> returns the command alias being used.
// # | This key is great to have when used well, but is not required.
// tab completions:
// # This will complete "alpha" and "beta" for the first argument
// 1: alpha|beta
// # This will complete any online player name for the second argument
// 2: <server.online_players.parse[name]>
// # This will allow flags "-a", "-b", or "-c" to be entered in the third, fourth, or fifth argument.
// 3 4 5: -a|-b|-c
// # Any argument other than the ones explicitly listed will be handled here with a tab complete that just says 'StopTyping'.
// default: StopTyping
//
// # You can also optionally use the 'tab complete' key to build custom procedure-style tab complete logic
// # if the simply numeric argument basis isn't sufficient.
// # Has the same context available as 'tab completions'.
// # | Most scripts should leave this key off, though it can be useful to some.
// tab complete:
// - determine some|dynamic|logic|here
// # You can also optionally use the 'tab complete' key to build custom procedure-style tab complete logic
// # if the simply numeric argument basis isn't sufficient.
// # Has the same context available as 'tab completions'.
// # | Most scripts should leave this key off, though it can be useful to some.
// tab complete:
// - determine some|dynamic|logic|here
//
// # The script that will run when the command is executed.
// # No, you do not need '- determine fulfilled' or anything of the sort, since the command is fully registered.
// # Available context:
// # <context.args> returns a list of input arguments.
// # <context.raw_args> returns all the arguments as raw text.
// # <context.source_type> returns the source of the command. Can be: PLAYER, SERVER, COMMAND_BLOCK, or COMMAND_MINECART.
// # <context.alias> returns the command alias being used.
// # <context.command_block_location> returns the command block's location (if the command was run from one).
// # <context.command_minecart> returns the EntityTag of the command minecart (if the command was run from one).
// # | All command scripts MUST have this key!
// script:
// - narrate Yay!
// - narrate "My command worked!"
// - narrate "And I typed '/<context.alias> <context.raw_args>'!"
// # The script that will run when the command is executed.
// # No, you do not need '- determine fulfilled' or anything of the sort, since the command is fully registered.
// # Available context:
// # <context.args> returns a list of input arguments.
// # <context.raw_args> returns all the arguments as raw text.
// # <context.source_type> returns the source of the command. Can be: PLAYER, SERVER, COMMAND_BLOCK, or COMMAND_MINECART.
// # <context.alias> returns the command alias being used.
// # <context.command_block_location> returns the command block's location (if the command was run from one).
// # <context.command_minecart> returns the EntityTag of the command minecart (if the command was run from one).
// # | All command scripts MUST have this key!
// script:
// - narrate Yay!
// - narrate "My command worked!"
// - narrate "And I typed '/<context.alias> <context.raw_args>'!"
// </code>
//
// -->
Expand Down
Loading

0 comments on commit 081ab90

Please sign in to comment.