################################################################################ # # d W o r l d E d i t o r # # # Authors: |Anthony|, mcmonkey # Version: 0.32 # dScript Version: 0.9.8-DEV-b646 # # # #-------------------------------------- # #--- About this script # # dWorldEditor is a world editing system written with the Denizen Scripting # Engine. Currently, it offers a robust set of area selection tools, a rich # command interface, and TAB completion for all commands. The in game help # system is complete with explanations, usage, and examples. # # The dWE Wand item provides an easy "click click" method for selecting a # cuboid. It has two modes currently, cuboid and extender. The selection wand # and other tools are very solid. # # Other scripts can easily use the wand by simply getting the region selection # from the flag like so: # - define pos1 '' # - define pos2 '' # - define cuboid 'cu@%pos1%|%pos2%' # # Has my work helped you in some way? Show your support by clicking the # Like button. # Feeling generous? Get me a coffee :D # https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NPXKHCNMTGSUG # #-------------------------------------- # # dWorldEditor Permissions and Commands # # Every command in dWorldEditor has its own dwe. permission. There # are also some permission nodes that apply to a group of related commands such # as dwe.select to grant permission for all selection related commands. # # Commands in dWorldEditor can be run as an argument of the /dwe command OR # can be run by their shorthand slash dot version like so: /.help # # Command Permission Description # # /dwe help ( <#>) -none- The root command will show a list # of all dWE commands you have permission # to use. You can specify a command to # get help for and a page number. # # /dwe about (<#>) -none- Learn about the project. # # /dwe wand (-type [cuboid/extender]) dwe.admin Give yourself the selection wand. # dwe.select You can also specify the wand type. # dwe.wand # # /dwe show dwe.admin Shows an outline of your selection. # dwe.select Currently shows blue stained glass for # dwe.show 10 seconds but that will change later. # # /dwe chunk dwe.admin Marks the chunk you are standing in # dwe.select as your selection. # dwe.chunk # # /dwe contract [<#>] () dwe.admin Contracts your selection by the given # dwe.select amount in the specified direction. If no # dwe.contract direction is given, it contracts in the # direction you are looking. # # /dwe expand [<#>] (-v) () dwe.admin Expands your selection by the given # dwe.select amount in the specified direction. If # dwe.expand no direction is given, it expands in # the direction you are looking. Optionally # specify -v for vertical only expansion. # # /dwe inset [<#>] (-h) dwe.admin Insets your selection by the given # dwe.select amount in all directions. Optionally # dwe.inset specify -h for horizontal only inset. # # /dwe outset [<#>] (-h) dwe.admin Outsets your selection by the given # dwe.select amount in all directions. Optionally -h # dwe.outset for horizontal only inset. # # /dwe pos1 dwe.admin Sets the location you are standing on # dwe.select as position 1. # dwe.pos # # /dwe pos2 dwe.admin Sets the location you are standing on # dwe.select as position 2. # dwe.pos # # /dwe hpos1 dwe.admin Sets the location you are looking at # dwe.select as position 1. # dwe.pos # # /dwe hpos2 dwe.admin Sets the location you are looking as # dwe.select as position 2. # dwe.pos # # /dwe shift [<#>] () dwe.admin Shifts your selection by the given # dwe.select amount in the specified direction. If # dwe.shift no direction is given, it shifts in # the direction you are looking. # # /dwe copy dwe.admin Copys your current selection to your # dwe.edit clipboard. The clipboard can hold more # dwe.copy than one item and will survive restarts. # # /dwe cut dwe.admin Just like Copy except your selection # dwe.edit is also removed. # dwe.cut # # /dwe paste [#] (-a, -w, -l, -p, -d) dwe.admin Pastes your current clipboard item. You # dwe.edit can optionally specify a clipboard entry. # dwe.paste # # /dwe set [(%#)] dwe.admin Sets your current selection to the # ([],(,)) dwe.edit material specified. TAB completion works # (-d, -g, -n, -l, -w, -p) dwe.set for material names. # # /dwe replace [(%#)] dwe.admin Replace materials in an area with other # [(%#)] ([],(,)) dwe.edit materials. TAB completion works for # (-d, -g, -n, -l, -w, -p) dwe.set material names. # # /dwe sphere [(%#)] dwe.admin Create an ellipsoid of the specified # ([],(,)) dwe.edit material. If no size values are given, it # (-d, -g, -n, -l, -w, -p) dwe.sphere uses the values from the wand. # # /dwe undo [#] (-n, -a, -d) dwe.admin Undo previous edits. You can specify # dwe.edit which edit to undo. # dwe.undo # # /dwe redo [#] (-n, -a, -d) dwe.admin Redo previous edits. You can specify # dwe.edit which undo to redo. # dwe.undo # # /dwe schem [list/load/unload/save/delete dwe.admin Manage and use schematics. # /copy/rename/bind/paste] (-p) dwe.schematic # #------------------------------------------------------------------------------- # # Schematic File Paths & Naming # # %p% = || 'public' # %n% = Display name of the schematic # # Saves # File: schematics/dWE/saves/%p%/%n%.schematic # Name: dWE_saves_%p%_%n% # Copys # File: schematics/dWE/clipboard/%p%/%n%.schematic # Name: dWE_clipboard_%p%_%n% # Undos # File: schematics/dWE/undo/%p%/%n%.schematic # Name: dWE_undo_%p%_%n% # Redos # File: schematics/dWE/redo/%p%/%n%.schematic # Name: dWE_redo_%p%_%n% # #------------------------------------------------------------------------------- # # TODO: # - Editing & Clipboard # - Copy (Functional) # - Paste (Functional) # - Replace (Functional) # - Stack # - Rotate # - Undo (Functional) # - Redo (Functional) # - Schematics (Functional) # - Still needs rotation and flipping # - Config File # - Maxblocks to change per operation # - Undo history size # - async-blockedit # - hpos max distance # - TAB Completion # - There is only sparse implementation and it's bugging me m(._.)m # - Drag command # - Turning on drag displays a selection outline and updates (on player move # or every second). Selection area stays in the same relative location to # the player as it was when enabled regardless of the players new location. # # ################################################################################ # # dWorldEditor Version # # Handles dWE Versioning Checks # dWE_Version: type: version author: Anthony name: dWorldEditor version: 0.32 description: Denizen World Editor id: 22 # # END dWorldEditor Version #-------------------------------------- # # ################################################################################ # # dWorldEditor Events # # This should cover all dWE related world events. # dWE_Events: type: world debug: false events: on player clicks block: - if ! { - queue clear } - determine passively CANCELLED - inject instantly on server start: - inject locally load on reload scripts: - run locally load delay:1t on system time hourly: # - if ! { # - queue clear # } - if !contains 'q@dWE_UpdateCheck' { - run locally delay:1t updateCheck 'id:dWE_UpdateCheck' } - if !contains 'q@dWE_SendMetrics' { - run locally delay:1t sendMetrics 'id:dWE_SendMetrics' } load: - if !contains 'q@dWE_UpdateCheck' { - run locally delay:1t updateCheck 'id:dWE_UpdateCheck' } - flag server 'dWE.Command_List:!' - flag server 'dWE.Command_List:|:' updateCheck: - ^if ! { - ~webget "http://one.denizenscript.com/denizen/repo/version/" save:page - ^flag server "dWE.Version.Repo:" d:1h } - ^define repoVersion '' - ^define currentVersion '' - ^if '%repoVersion%' == 'unknown' { - run s@msgPrefixed instantly 'def:dWE|<&7>Unable to check for update! <&7><&o>%currentVersion%<&7> is installed!' } else if '%repoVersion%' > '%currentVersion%' { - run s@msgPrefixed instantly 'def:dWE|<&7>Update from version <&o>%currentVersion%<&7> to <&o>%repoVersion%<&7>!' } else if '%repoVersion%' != '%currentVersion%' { - run s@msgPrefixed instantly 'def:dWE|<&7>What happened? You are on version <&o>%currentVersion%<&7> and the repo says <&o>%repoVersion%<&7>!' } sendMetrics: # - run s@msgPrefixed instantly 'def:dWE|<&3>Sending usage metrics...' - ~webget "http://morphanone.space/webizen.aspx/tracker?script=&version=&players=&denizen_version=&jenkins_build=&bukkit_version=" 'save:send' - if ! { - run s@msgPrefixed instantly 'def:dWE|<&c>Metrics failed!' } # # END dWorldEditor Events #-------------------------------------- # # ################################################################################ # # dWorldEditor Messages # # This is the house for various output messages # # - These may or may not get moved to their respective command scripts # #-------------------------------------- # dWE_Msg: type: item debug: false material: i@human_skull display name: "<&4> [<&6>dWE<&4>]" lore: - <&5>Click for Help script: - run s@msgPrefixed 'def:dWE|%1%' set_Pos: - run s@msgPrefixed 'def:dWE|<&f>POS%pos%<&co> <&3><&o>, <&3><&o>]> <&7>(<&o><&7>)' set_pos1: - run s@msgPrefixed 'def:dWE|<&f>Selection started at <&3><&o>,<&3><&o>]>' set_pos2: - run s@msgPrefixed 'def:dWE|<&f>Selection expanded to include<&co> <&3><&o>,<&3><&o>]> <&7>(<&o><&7>)' shift: - run s@msgPrefixed 'def:dWE|<&f>Shifted<&f> <&7><&o>%direction% <&7>by <&o>%n% <&7>blocks (<&o><&7>)' expand: - define expandBy '' - run s@msgPrefixed 'def:dWE|<&f>Expanded<&f> <&7><&o>%direction% <&7>by <&o>%expandBy% <&7>blocks (<&o><&7>)' contract: - define contractBy '].as_int>' - run s@msgPrefixed 'def:dWE|<&f>Contracted<&f> <&7><&o>%direction% <&7>by <&o>%contractBy% <&7>blocks (<&o><&7>)' inset: - define insetBy '].as_int>' - run s@msgPrefixed 'def:dWE|<&f>Inset<&f> <&7>by <&o>%insetBy% <&7>blocks (<&o><&7>)' outset: - define outsetBy '' - run s@msgPrefixed 'def:dWE|<&f>Outset<&f> <&7>by <&o>%outsetBy% <&7>blocks (<&o><&7>)' # # END dWorldEditor Messages #-------------------------------------- # # ################################################################################ # # dWorldEditor Wand Item # # This is the house for the wand item # # #-------------------------------------- # dWE_Wand: type: item debug: false material: m@wood_axe display name: dWE Region Selector lore: - <&7><&o>Left<&7> click to start a selection - <&7><&o>Right<&7> click to expand the selection script: - if !> { - take i@dWE_Wand - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&a>You should not have this!' instantly - queue clear } - if { - define pos 1 } else if { - define pos 2 } else { - queue clear } - define pos1 '' - define pos2 '' - define type '' - if { - inject locally %type% } else { - inject locally cuboid } cuboid: - if ]||false> { - run s@msgPrefixed 'def:dWE|<&c>pos%pos% is already set' - queue clear } - define pos%pos% '' - flag player dWEWand:! - flag player dWEWand:|:%pos1%|%pos2% - inject s@dWE_Msg p:set_Pos extender: - define cuboid cu@%pos1%|%pos2% - if %pos% == 1 { - define cuboid cu@| } else { - if %pos1% == null { - run s@msgPrefixed 'def:dWE|<&c>You must begin a selection before you can expand it.' - queue clear } - define cuboid_old %cuboid% - define cuboid ]> - if == { - run s@msgPrefixed 'def:dWE|<&c>That position is already included.' - queue clear } } - define pos1 '' - define pos2 '' - flag player dWEWand:! - flag player dWEWand:|:%pos1%|%pos2% - inject s@dWE_Msg p:set_pos%pos% # # END dWorldEditor Wand Item #-------------------------------------- # # dWE Tools # # All dWE tools should be housed here. Players can bind any action to any tool. # dWE_Tools: type: world debug: false events: on player clicks: - if ! { - queue clear } - determine passively CANCELLED - define tool '' - if !> || 'li@public|' !contains '' { - take - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&a>You should not have this!' instantly - queue clear } - inject locally %tool% schem: - choose '': - case 'left': - if { - define n '1' - define entry '' - define o '' - define u '' - define t 'Undo' - inject s@dWE_PS - flag player 'dWE.History.Undo:<-:%entry%/' - adjust server 'delete_file:schematics/dWE/Undo/%u%/%entry%.schematic' - run s@msgPrefixed 'def:dWE|<&7><&o>Undo entry %entry% complete!' - queue clear } - define o '' - if '%o%' == 'null' { - queue clear } - if '' != 'null' { - queue clear } - define name '' - define p '' - define d '' - define a '' - define v '' - if '%v%' != '0' { - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%||%name%' - queue clear } - define cuboid '' - if !|]> { - queue clear } # Save the existing area for undo history - define u '' - define t 'Undo' - inject s@dWE_ISN # I know i should do logic here, but damnit... empty args shouldn't be a problem if they are optional! - ~schematic paste 'name:dWE_saves_%p%_%name%' '%o%' '%cuboid%' %d% %a% - run s@msgPrefixed 'def:dWE|Pasted %name%' - case 'right': - run s@msgPrefixed 'def:dWE|Rotating schematics is currently unsupported!' ################################################################################ # # Denizen World Editor Command Script Containers # # Every command has its own script container. The root command functions mostly # as link to specific commands and provides some initial processing. # # #-------------------------------------- # # dWE Command Script Registrar # # The root command. Validates minor input and sends to command script. # dWE_Commands: type: command debug: false name: dwe description: Denizen World Editor usage: /dwe aliases: '' allowed help: - determine > script: - define command '' - define commands '' - define args ']||li@>' - if ! || !]> { - inject s@dWE_Commands_Help } - inject s@dWE_Commands_%command% tab complete: - define command '' - define commands '' - define args ']||li@>' - define spaces '' - if { - inject s@dWE_Commands_%command% 'p:tab complete' } else { - define commands '' } - foreach %commands% { - if !]> { - define commands '' } } - if { - determine 'li@' } - determine '' # Preprocessors. Does some pre-processing and passes back to the calling command prerun: - if { - run s@msgPrefixed 'def:dWE|<&c>This command must be run as a player.' - queue clear } - if == '.%command%' { - if !]> { - inject s@dWE_Commands_Help p:helpList - queue clear } - define commands '' - define args "" } - if %preRun% == 'a' { - goto 'END' } - define pos1 '' - define pos2 '' - if || { - run s@msgPrefixed 'def:dWE|<&c>No region selected!' - queue clear } - define oldSize '' - define cuboid 'cu@%pos1%|%pos2%' - define center '' - if %preRun% == 'b' { - goto 'END' } - define pRange '50' - define d ']:delayed||>' - define g ']:no_physics||>' - define n ']:naturally||>' - define s '' - define p '' - define o ']:%pos1%||]:||0>>' - define args '' - define matlist '' - define mats 'li@' - define pcts 'li@' - foreach '%matlist%' { - define mat '].get[1]||null>' - if '%mat%' !matches material { - run s@msgPrefixed 'def:dWE|<&c>SYNTAX ERROR<&co> <&6> Invalid Material <&c><&o>%mat%' - run s@msgPrefixed 'def: |<&6>>' - queue clear } - define mats '' - define pct '].get[2]||].round_up||100>>' - if '%pct%' matches number { - define pcts ']>' } } - if { - run s@msgPrefixed 'def:dWE|<&c>SYNTAX ERROR<&co> <&6> Missing Material' - run s@msgPrefixed 'def: |<&6>>' - queue clear } - if '%s%' == '0' { # Only specify material. Sizes are determined by wand selection. - define s '' } else { - define s '' - if == 2 { - run s@msgPrefixed 'def:dWE|<&c>SYNTAX ERROR<&co> <&6> Invalid Size' - run s@msgPrefixed 'def: |<&6>>' - queue clear } - define x '' - define y '' - define z '' - define s "%x%,%y%,%z%" } - mark 'END' prerunB: - if %p% { - run s@msgPrefixed 'def:dWE|<&c><&o>Showing outline of effected area' - showfake '' '' to: 'd:s' - queue clear } # If using dRegions, check for overlapping regions before editing. - if ! { - if ||]> { - run s@msgPrefixed 'def:dWE|<&c>Region selection contains unowned dRegions!' - if !> { - queue clear } - run s@msgPrefixed 'def:dWE|<&c>But you are an admin so it is ok!' } } # Save the existing area for undo history - define o '>' - define t 'Undo' - define u '' - inject s@dWE_ISN # # END dWE Command Registrar #-------------------------------------- # # ################################################################################ # # # dWorldEditor Command Scripts # # This section holds all of the commands for dWorldEditor. The root command /dwe # takes many arguments but most of those arguments can also be run as individual # commands. This results in dWorldEditor command args having a shorthand version # in the form of /.arg # dWE_Commands_Help: type: command debug: false speed: 0 name: .help description: Show dWorldEditor help usage: /.help aliases: '' allowed help: - determine > data: description: - 'This is the help for dWorldEditor. The help files are here to help you. Help yourself by reading the help. It<&sq>s helpful. <&c>Seriously!' - ' ' - 'Thorough TAB completion is available for all dWorldEditor commands, including help. Try it and see!' usage: '/dwe help <<>arg/<&ns><>>' examples: - '<&f>To show the <&a>second<&f> page of help for the <&2>help<&f> command' - '<&sp>' - ' <&e>/dwe help <&2>help <&a>2' - ' ' - '<&f>To show the <&a>third<&f> page of the help files' - '<&sp>' - ' <&e>/dwe help <&a>3' permissions: [] tab complete: - if ! { - define commands '' - define args "" } - define command '' - if { - determine 'li@' } else { - define commands '' } - foreach %commands% { - if !]> { - define commands '' } } - if { - determine 'li@' } - determine '' script: - if ! { - define command 'help' } - define prerun 'a' - inject s@dWE_Commands p:prerun - define arg '' - if { - define page '' - inject s@dWE_Commands_Help p:helpList - queue clear } - if { - define command '%arg%' - define page ']:||1>' - inject s@dWE_Commands_Help p:helpCommand - queue clear } - inject s@dWE_Commands_Help p:helpList - queue clear helpList: # Filter the list of commands this player can use # Build the help documentation - define commands '' - define helpDoc 'li@' - foreach %commands% { - if !]> { - define commands '' } else { - define usage '>' - define usage ']>' - define button '<&co>|.help %value%|<&a>Click for <&b> <&a>help]>' - define helpDoc '<&7>>|<&e.pad_left[3].with[<&sp>]>%usage%]>' } } - run s@msgBoxed instantly 'def:dwe|dWorldEditor|.about|<&a>Click to learn<&nl><&a>about the project!]>|Help|.help|<&a>Go back to main help]> Files|dwe help||52|10|' helpCommand: # Help for a specific command - define short '>' - define desc '>' - define usage '>' - define examples '>' - define entries '<&7>%short%| |%desc%| |<&b><&n>Usage<&co>| |<&e.pad_left[3].with[ ]>%usage%| |<&3><&n>Examples<&co>| |%examples%' - run s@msgBoxed instantly 'def:dwe|dWorldEditor|.about|<&a>Click to learn<&nl><&a>about the project!]>|Help|.help|<&a>Go back to main help]> - |.help %arg%||52|10|%entries%' dWE_Commands_About: type: command debug: false speed: 0 name: .about description: Details about the project usage: /.about aliases: '' data: description: - 'dWorldEditor is a world editing system written with the Denizen Scripting Engine.' - ' ' - 'Currently, it offers a robust set of area selection tools. The dWE Wand item provides an easy <&dq>click click<&dq> method for selecting a cuboid. It has two modes currently, cuboid and extender.' - ' ' - 'Future development will bring more advanced editing tools, but for now be satisfied with kick-ass selection tools!' usage: '/dwe about' examples: [] permissions: [] tab complete: - determine 'li@' script: - if ! { - define command 'about' } - define prerun 'a' - inject s@dWE_Commands p:prerun - run s@msgBoxed instantly 'def:dwe|dWorldEditor|.help|<&a>Go back to main help]>|<&e>About|dwe about|]:||1>|52|10|<&7>>| |>' dWE_Commands_Show: type: command debug: false speed: 0 name: .show description: Show your current dWE selection usage: /.show aliases: '' data: description: 'See an outline of the area you have selected. Currently shows blue stained glass for 10 seconds. The material and time are configurable, but not yet ;)' usage: '/dwe show' examples: [] permissions: - admin - select - show tab complete: - determine 'li@' script: - if ! { - define command 'show' } - define prerun 'b' - inject s@dWE_Commands p:prerun - showfake to: d:s dWE_Commands_Wand: type: command debug: false speed: 0 name: .wand description: Get the region wand usage: /.wand (-type [cuboid/extender]) aliases: '' data: description: - 'The selection wand is the tool that you will use to select an area for editing. There are two types of selection wands to choose from.' - ' ' - 'To use the cuboid selection wand, left click to set position 1 and right click to set position 2.' - ' ' - 'To use the extender selection wand, left click to start the selection area. Subsequent right clicks will expand the selection to include the location you clicked.' usage: '/dwe wand (-type [cuboid/extender])' examples: - '<&f>To give yourself the wand' - ' <&e>/dwe wand' - ' ' - '<&f>To change the wand type to extender' - ' <&e>/dwe wand -type extender' permissions: - admin - select - wand tab complete: - if ! { - if !]> { - determine 'li@' } - define args "" - define spaces '' } - choose '%spaces%': - case '0': - determine 'wand -type ' - case '1': - define arg '' - if '%arg%' != '-type ' { - determine '-type ' } - case '2': - define arg2 '' - define arg1 '' - if '%arg1%' != '-type' { - determine 'li@' } - if 'li@cuboid|extender' contains '%arg2%' { - determine 'li@' } else { - determine ']]||li@cuboid|extender>' } - default: - determine 'li@' script: - if ! { - define command 'wand' } - define prerun 'a' - inject s@dWE_Commands p:prerun - if { - define type ]||null> - if { - run s@msgPrefixed 'def:dWE|<&7><&o>Now using the <&f><&o>%type% <&7><&o>selection wand' - flag player 'dWEWand_Type:%type%' } else { - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>Unknown wand type!' - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe -type <&6><&lb><&7>cuboid/extender<&6><&rb>' } - queue clear } - if ]> != '-1' { - run s@msgPrefixed 'def:dWE|<&c>You already have a wand!' } else { - give i@dWE_Wand } - define type '' - choose '%type%': - case 'cuboid': - run s@msgPrefixed 'def:dWE|<&a>Left click to select pos1' - run s@msgPrefixed 'def:dWE|<&a>Right click to select pos2' - case 'extender': - run s@msgPrefixed 'def:dWE|<&a>Left click to start a selection,' - run s@msgPrefixed 'def:dWE|<&a>Right click to expand the selection.' - default: - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>Unknown wand type!' - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe -type <&6><&lb><&7>cuboid/extender<&6><&rb>' - queue clear dWE_Commands_Pos1: type: command debug: false speed: 0 name: .pos1 description: Set position 1 usage: /.pos1 aliases: '' data: description: 'Sets the location you are standing at as position 1. This will be the block above the block you are standing on.' usage: '/dwe pos1' examples: [] permissions: - admin - select - pos tab complete: - determine 'li@' script: - if ! { - define command 'pos1' } - define prerun 'a' - inject s@dWE_Commands p:prerun - define pos1 '' - if { - run s@msgPrefixed 'def:dWE|<&c>pos1 is already set' - queue clear } - define pos1 '' - define pos2 '' - flag player dWEWand:! - flag player dWEWand:|:%pos1%|%pos2% - define pos 1 - inject s@dWE_Msg p:set_Pos dWE_Commands_Pos2: type: command debug: false speed: 0 name: .pos2 description: Set position 2 usage: /.pos2 aliases: '' data: description: 'Sets the location you are standing at as position 2. This will be the block above the block you are standing on.' usage: '/dwe pos2' examples: [] permissions: - admin - select - pos tab complete: - determine 'li@' script: - if ! { - define command 'pos2' } - define prerun 'a' - inject s@dWE_Commands p:prerun - define pos2 '' - if { - run s@msgPrefixed 'def:dWE|<&c>pos2 is already set' - queue clear } - define pos1 '' - define pos2 '' - flag player dWEWand:! - flag player dWEWand:|:%pos1%|%pos2% - define pos 2 - inject s@dWE_Msg p:set_Pos dWE_Commands_Hpos1: type: command debug: false speed: 0 name: .hpos1 description: Set position 1 usage: /.hpos1 aliases: '' data: description: 'Sets the location you are looking at as position 1. Has a range of 160 blocks and will not target air unless that range has been met.' usage: '/dwe hpos1' examples: [] permissions: - admin - select - pos tab complete: - determine 'li@' script: - if ! { - define command 'hpos1' } - define prerun 'a' - inject s@dWE_Commands p:prerun - define pos1 '' - if { - run s@msgPrefixed 'def:dWE|<&c>pos1 is already set' - queue clear } - define pos1 '' - define pos2 '' - flag player dWEWand:! - flag player dWEWand:|:%pos1%|%pos2% - define pos 1 - inject s@dWE_Msg p:set_Pos dWE_Commands_Hpos2: type: command debug: false speed: 0 name: .hpos2 description: Set position 2 usage: /.hpos2 aliases: '' allowed help: - determine > data: description: 'Sets the location you are looking at as position 2. Has a range of 160 blocks and will not target air unless that range has been met.' usage: '/dwe hpos2' examples: [] permissions: - admin - select - pos tab complete: - determine 'li@' script: - if ! { - define command 'hpos2' } - define prerun 'a' - inject s@dWE_Commands p:prerun - define pos2 '' - if { - run s@msgPrefixed 'def:dWE|<&c>pos2 is already set' - queue clear } - define pos1 '' - define pos2 '' - flag player dWEWand:! - flag player dWEWand:|:%pos1%|%pos2% - define pos 2 - inject s@dWE_Msg p:set_Pos dWE_Commands_Chunk: type: command debug: false speed: 0 name: .chunk description: Selects the chunk you are standing in usage: /.chunk aliases: '' data: description: 'Sets the chunk you are standing in as your cuboid selection.' usage: '/dwe chunk' examples: [] permissions: - admin - select - chunk tab complete: - determine 'li@' script: - if ! { - define command 'chunk' } - define prerun 'a' - inject s@dWE_Commands p:prerun - define pos1 '' - define pos2 '' - flag player dWEWand:! - flag player dWEWand:|:%pos1%|%pos2% - run s@msgPrefixed 'def:dWE|<&f>Chunk selected<&co> ' dWE_Commands_Expand: type: command debug: false speed: 0 name: .expand description: Expands your selection usage: /.expand <<>amount/v<>> (n/s/e/w/u/d) aliases: '' data: description: 'You can expand your selection in cardinal directions, up, down, or vertically. If you do not specify a direction, the selection will be expanded in the direction you are looking.' usage: '/dwe expand <<>amount/v<>> (n/s/e/w/u/d)' examples: - '<&f>To expand your selection 10 blocks up' - ' <&e>/dwe expand 10 u' - ' ' - '<&f>To expand your selection vertically' - ' <&e>/dwe expand v' - ' ' - '<&f>To expand your selection 5 blocks in the direction you are looking' - ' <&e>/dwe expand 5' permissions: - admin - select - expand tab complete: - if ! { - if !]> { - determine 'li@' } - define args "" - define spaces '' } - choose '%spaces%': - case '0': - determine 'expand [<&ns>]/v ' - case '1': - define arg1 '' - if '%arg1%' matches 'number' || '%arg1%' == 'v' { - determine '%arg1% ' } else { - determine '[<&ns>]/v ' } - case '2': - define arg2 '' - define arg1 '' - if '%arg1%' == 'v' || '%arg1%' !matches 'number' { - determine 'li@' } - if 'li@n|s|e|w|u|d' contains '%arg2%' { - determine 'li@' } else { - determine 'li@n|s|e|w|u|d' } - default: - determine 'li@' script: # /dwe expand (n/s/e/w/u/d) - if ! { - define command 'expand' } - if { - run s@msgPrefixed 'def:dWE|<&c>This command must be run as a player.' - queue clear } - define prerun 'b' - inject s@dWE_Commands p:prerun - if { - define pos1 ',0].replace[l@]>' - define pos2 ']>,0].replace[l@]>' - define direction 'Vertically' - goto 'end' } - define n '' - define d '' - if { - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe expand <&6><&lb><&7>amount/v<&6><&rb> <&6>(<&7>direction<&6>)' - queue clear } - if { - define d '|]>' } - if { - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>Unknown direction!' - queue clear } - choose '%d%': - case 'n': - if ]> { - define pos1 '' } else { - define pos2 '' } - define direction 'North' - case 'e': - if ]> { - define pos1 '' } else { - define pos2 '' } - define direction 'East' - case 's': - if ]> { - define pos1 '' } else { - define pos2 '' } - define direction 'South' - case 'w': - if ]> { - define pos1 '' } else { - define pos2 '' } - define direction 'West' - case 'u': - if ]> { - define pos1 '' } else { - define pos2 '' } - define direction 'Up' - case 'd': - if ]> { - define pos1 '' } else { - define pos2 '' } - define direction 'Down' - default: - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>An impossible error occurred while expanding your selection!' - queue clear - mark 'end' - flag player dWEWand:! - flag player dWEWand:|:%pos1%|%pos2% - inject s@dWE_Msg p:expand dWE_Commands_Contract: type: command debug: false speed: 0 name: .contract description: Contracts your selection usage: /.contract aliases: '' data: description: 'You can contract your selection in cardinal directions, up, or down. If you do not specify a direction, the selection will be contracted in the direction you are looking.' usage: '/dwe contract <<>amount<>> (n/s/e/w/u/d)' examples: - '<&f>To contract your selection 10 blocks down' - ' <&e>/dwe contract 10 d' - ' ' - '<&f>To contract your selection 1 block in the direction you are looking' - ' <&e>/dwe contract 1' permissions: - admin - select - contract tab complete: - if ! { - if !]> { - determine 'li@' } - define args "" - define spaces '' } - choose '%spaces%': - case '0': - determine 'contract [<&ns>] ' - case '1': - define arg1 '' - if '%arg1%' matches 'number' { - determine '%arg1% ' } else { - determine '[<&ns>] ' } - case '2': - define arg2 '' - define arg1 '' - if '%arg1%' !matches 'number' { - determine 'li@' } - if 'li@n|s|e|w|u|d' contains '%arg2%' { - determine 'li@' } else { - determine 'li@n|s|e|w|u|d' } - default: - determine 'li@' script: # /dwe contract (n/s/e/w/u/d) - if ! { - define command 'contract' } - define prerun 'b' - inject s@dWE_Commands p:prerun - define n '' - define d '' - if { - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe contract <&6><&lb><&7>amount<&6><&rb> <&6>(<&7>direction<&6>)' - queue clear } - if { - define d '|]>' } - if { - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>Unknown direction!' - queue clear } - choose '%d%': - case 'n': - if ]> { - define pos2 '' } else { - define pos1 '' } - define direction 'North' - case 'e': - if ]> { - define pos2 '' } else { - define pos1 '' } - define direction 'East' - case 's': - if ]> { - define pos2 '' } else { - define pos1 '' } - define direction 'South' - case 'w': - if ]> { - define pos2 '' } else { - define pos1 '' } - define direction 'West' - case 'u': - if ]> { - define pos2 '' } else { - define pos1 '' } - define direction 'Up' - case 'd': - if ]> { - define pos2 '' } else { - define pos1 '' } - define direction 'Down' - default: - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>An impossible error occurred while contracting your selection!' - queue clear - flag player dWEWand:! - flag player dWEWand:|:%pos1%|%pos2% - inject s@dWE_Msg p:contract dWE_Commands_Inset: type: command debug: false speed: 0 name: .inset description: Insets your selection usage: /.inset aliases: '' data: description: 'Inset is a form of contraction. The selection will decrease by the amount specified in all directions. It will shrink toward the center. You can also specify that it will inset only horizontally.' usage: '/dwe inset <<><&ns><>> -h' examples: - '<&f>To inset your selection by 3 blocks in all directions' - ' <&e>/dwe inset 3' - ' ' - '<&f>To horizontally inset your selection by 6 blocks' - ' <&e>/dwe inset 6 -h' permissions: - admin - select - inset tab complete: - if ! { - if !]> { - determine 'li@' } - define args "" - define spaces '' } - choose '%spaces%': - case '0': - determine 'inset [<&ns>] -h ' - case '1': - define arg1 '' - if '%arg1%' matches 'number' || '%arg1%' == '-h' { - determine '%arg1% ' } else { - determine '[<&ns>] ' } - case '2': - define arg1 '' - define arg2 '' - if '%arg1%' matches 'number' { - determine '-h' } - if '%arg1%' == '-h' { - determine ']:%arg2% || <&lb><&ns><&rb>>' } else { - determine 'li@' } - default: - determine 'li@' script: # /dwe inset -h - if ! { - define command 'inset' } - define prerun 'b' - inject s@dWE_Commands p:prerun - define n '' - if { - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe inset <&6><&lb><&7>amount<&6><&rb> <&6>(<&7>-h<&6>)' - queue clear } - define cuboid cu@%pos1%|%pos2% - if '' { - define cuboid 'cu@|' } - define cuboid 'cu@|' - define pos1 '' - define pos2 '' - flag player dWEWand:! - flag player dWEWand:|:%pos1%|%pos2% - inject s@dWE_Msg p:inset dWE_Commands_Outset: type: command debug: false speed: 0 name: .outset description: Outsets your selection usage: /.outset aliases: '' data: description: 'Outset is a form of expansion. The selection will increase by the amount specified in all directions. It will expand from the center. You can also specify that it will outset only horizontally.' usage: '/dwe outset <<><&ns><>> -h' examples: - '<&f>To outset your selection by 8 blocks in all directions' - ' <&e>/dwe outset 8' - ' ' - '<&f>To horizontally outset your selection by 2 blocks' - ' <&e>/dwe outset 2 -h' permissions: - admin - select - outset tab complete: - if ! { - if !]> { - determine 'li@' } - define args "" - define spaces '' } - choose '%spaces%': - case '0': - determine 'outset [<&ns>] -h ' - case '1': - define arg1 '' - if '%arg1%' matches 'number' || '%arg1%' == '-h' { - determine '%arg1% ' } else { - determine '[<&ns>] ' } - case '2': - define arg1 '' - define arg2 '' - if '%arg1%' matches 'number' { - determine '-h' } - if '%arg1%' == '-h' { - determine ']:%arg2% || <&lb><&ns><&rb>>' } else { - determine 'li@' } - default: - determine 'li@' script: # /dwe outset -h - if ! { - define command 'outset' } - define prerun 'b' - inject s@dWE_Commands p:prerun - define n '' - if { - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe outset <&6><&lb><&7>amount<&6><&rb> <&6>(<&7>-h<&6>)' - queue clear } - define cuboid cu@%pos1%|%pos2% - if '' { - define cuboid 'cu@|' } - define cuboid 'cu@|' - define pos1 '' - define pos2 '' - flag player dWEWand:! - flag player dWEWand:|:%pos1%|%pos2% - inject s@dWE_Msg p:outset dWE_Commands_Shift: type: command debug: false speed: 0 name: .shift description: Shifts your selection usage: /.shift aliases: '' data: description: 'You can shift your selection area in all cardinal directions, up, and down. Your selection will shift in the direction you are looking if no direction is specified.' usage: '/dwe shift <<>amount<>> (n/s/e/w/u/d)' examples: - '<&f>To shift your selection by 16 blocks to the east' - ' <&e>/dwe shift 16 e' - ' ' - '<&f>To shift your selection by 2 blocks in the direction you are looking' - ' <&e>/dwe shift 2' permissions: - admin - select - shift math: n: '0,0,-' s: '0,0,' w: '-,0,0' e: ',0,0' d: '0,-,0' u: '0,,0' d: n: 'North' s: 'South' w: 'West' e: 'East' d: 'Down' u: 'Up' tab complete: - if ! { - if !]> { - determine 'li@' } - define args "" - define spaces '' } - choose '%spaces%': - case '0': - determine 'shift [<&ns>] ' - case '1': - define arg1 '' - if '%arg1%' matches 'number' || '%arg1%' == 'v' { - determine '%arg1% ' } else { - determine '[<&ns>] ' } - case '2': - define arg2 '' - define arg1 '' - if '%arg1%' == 'v' || '%arg1%' !matches 'number' { - determine 'li@' } - if 'li@n|s|e|w|u|d' contains '%arg2%' { - determine 'li@' } else { - determine 'li@n|s|e|w|u|d' } - default: - determine 'li@' script: # /dwe shift (n/s/e/w/u/d) - if ! { - define command 'shift' } - define prerun 'b' - inject s@dWE_Commands p:prerun - define n '' - define d '' - if { - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe shift <&6><&lb><&7>amount<&6><&rb> <&6>(<&7>direction<&6>)' - queue clear } - if { - define d '|]>' } - if { - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>Unknown direction!' - queue clear } - define direction '' - repeat 2 { - define pos%value% '>]>' } - flag player dWEWand:! - flag player dWEWand:|:%pos1%|%pos2% - inject s@dWE_Msg p:shift dWE_Commands_Set: type: command debug: false speed: 0 name: .Set description: Set your selection to a material usage: /.set aliases: '' data: description: - 'Set the materials in an area. You can use either the specific material name or the minecraft material name. TAB completion is available for the minecraft material names.' - ' ' - 'Arguments and -switches to the set command can be compounded and supplied in any order you like.' usage: '/dwe set <&lb><<>material<>>(<&pc><&ns>)/...<&rb> (<<>x<>>(,<<>y<>>,<<>z<>>)) (-d, -g, -n, -l, -w, -p)' examples: - '<&f>To set your selection to white stained clay using minecraft material name and data value.' - ' <&e>/dwe set stained_clay,0' - ' ' - '<&f>To set your selection to white stained clay using specific material name.' - ' <&e>/dwe set white_clay' - ' ' - '<&f>To set your selection to 25<&pc> white stained clay and 75<&pc> dirt.' - ' <&e>/dwe set white_clay<&pc>25/dirt<&pc>75' - ' ' - '<&f>To set a 4x5x10 area to stone using the center of your selection.' - ' <&e>/dwe set stone 4,5,10' - ' ' - '<&f>To set an area the size of your selection to stone. Uses the block you are looking at as the min corner.' - ' <&e>/dwe set stone -l' - ' ' - '<&f>To set a 4x5x10 area to stone using the wand position 1 as the min corner. Really only useful when manually setting a size.' - ' <&e>/dwe set stone 4,5,10 -w' - ' ' - '<&f>To perform any operation slowly to prevent server lag use the -d switch.' - ' <&e>/dwe set dirt -d' - ' ' - '<&f>To place blocks without physics use the -g switch. Physics will still apply if a block update effects the block.' - ' <&e>/dwe set sand -g' - ' ' - '<&f>To break blocks <&dq>naturally<&dq> allowing item drops to spawn use the -n switch.' - ' <&e>/dwe set air -n' - ' ' - '<&f>To see an outline of the area any command will effect use the -p switch.' - ' <&e>/dwe set stone -p' permissions: - admin - edit - set tab complete: - if ! { - if !]> { - determine 'li@' } - define args "" - define spaces '' } - choose '%spaces%': - case '0': - determine 'set <<>material<>>' - case '1': - define arg1 '' - if '%arg1%' matches 'material' { - determine '%arg1%' } else { - define blocks '' - determine '' } - default: - determine 'li@' script: # /dwe set - if ! { - define command 'set' } - define prerun 'c' - inject s@dWE_Commands p:prerun - define selection 'cu@|' - if '%o%' == '0' { - define o '' } else { - define selection 'cu@%o%|].as_location>' } - define blocks '' - inject s@dWE_Commands p:prerunB - ~modifyblock %d% %g% %n% - run s@msgPrefixed 'def:dWE|Set complete!' dWE_Commands_Replace: type: command debug: false speed: 0 name: .replace description: Replace materials in an area usage: /.replace aliases: '' data: description: - 'Replace materials in an area. You can use either the specific material name or the minecraft material name. TAB completion is available for the minecraft material names.' - ' ' - 'Arguments and -switches to the replace command can be compounded and supplied in any order you like.' usage: '/dwe replace <&lb><<>newMat<>>(<&pc><&ns>)/...<&rb> <&lb><<>oldMat<>>/...<&rb> (<<>x<>>(,<<>y<>>,<<>z<>>)) (-d, -g, -n, -l, -w, -p)' examples: - '<&f>To replace stone blocks in your selection with dirt.' - ' <&e>/.replace dirt stone' - ' ' - '<&f>To replace stone and dirt with sand.' - ' <&e>/.replace sand stone/dirt' - ' ' - '<&f>To replace air with 25<&pc> sand and 25<&pc> gravel.' - ' <&e>/.replace sand<&pc>25/gravel<&pc>25 air' - ' ' - '<&f>To replace stone in a 4x2x2 area with dirt using the center of your selection.' - ' <&e>/.replace dirt stone 4,2,2' - ' ' - '<&f>To replace stone in an area the size of your selection with dirt using the block you are looking at as the min corner.' - ' <&e>/.replace dirt stone -l' - ' ' - '<&f>To replace stone in a 4x5x10 area with dirt using the wand position 1 as the min corner. Really only useful when manually setting a size.' - ' <&e>/.replace dirt stone 4,5,10 -w' - ' ' - '<&f>To perform any operation slowly to prevent server lag use the -d switch.' - ' <&e>/.replace dirt stone -d' - ' ' - '<&f>To replace blocks without physics use the -g switch. Physics will still apply if a block update effects the block.' - ' <&e>/.replace sand air -g' - ' ' - '<&f>To replace blocks with air <&dq>naturally<&dq> allowing item drops to spawn use the -n switch.' - ' <&e>/.replace air tall_grass/crops -n' - ' ' - '<&f>To see a preview of the locations any command will effect use the -p switch.' - '<&4>WARNING<&co><&nl><&c>This has the potential to crash servers! Use with -d if in doubt!' - ' <&e>/.replace air tall_grass/crops -p' permissions: - admin - edit - replace tab complete: - if ! { - if !]> { - determine 'li@' } - define args "" - define spaces '' } - choose '%spaces%': - case '0': - determine 'set <<>material<>>' - case '1': - define arg1 '' - if '%arg1%' matches 'material' { - determine '%arg1%' } else { - define blocks '' - determine '' } - default: - determine 'li@' script: # /dwe replace - if ! { - define command 'replace' } - define prerun 'c' - inject s@dWE_Commands p:prerun - define oldMats '' - foreach %oldMats% { - if '%value%' !matches material { - run s@msgPrefixed 'def:dWE|<&c>SYNTAX ERROR<&co> <&6> Invalid Material <&c><&o>%value%' - narrate '<&6>>' - queue clear } } - define selection 'cu@|' - if '%o%' == '0' { - define o '' } else { - define selection 'cu@%o%|].as_location>' } - define blocks '' - if == '0' { - run s@msgPrefixed 'def:dWE|<&c><&o> ]:are||is> not within your selection.' - queue clear } - inject s@dWE_Commands p:prerunB - ~modifyblock %d% %g% %n% - run s@msgPrefixed 'def:dWE|Replace complete!' dWE_Commands_Sphere: type: command debug: false speed: 0 name: .sphere description: Creates an ellipsoid usage: /.sphere aliases: '' data: description: - 'Create an ellipsoid from your selection. You can use either the specific material name or the minecraft material name. TAB completion is available for the minecraft material names.' - ' ' - 'Arguments and -switches to the sphere command can be compounded and supplied in any order you like.' usage: '/dwe sphere <&lb><<>material<>>(<&pc><&ns>)/...<&rb> (<<>x<>>(,<<>y<>>,<<>z<>>)) (-d, -g, -n, -l, -w, -p)' examples: - '<&f>Create a white wool ellipsoid from you selection using minecraft material name and data value.' - ' <&e>/dwe sphere wool,0' - ' ' - '<&f>Create a white wool ellipsoid from you selection using specific material name.' - ' <&e>/dwe sphere white_wool' - ' ' - '<&f>Create an ellipsoid that is 50<&pc> stone and 50<&pc> dirt from your selection.' - ' <&e>/dwe sphere white_clay<&pc>50/dirt<&pc>50' - ' ' - '<&f>Create a stone ellipsoid with radii 6x2x6 using the center of your selection.' - ' <&e>/dwe sphere stone 6,2,6' - ' ' - '<&f>Create a dirt ellipsoid the size of your selection. Uses the block you are looking at as the min corner.' - ' <&e>/dwe sphere dirt -l' - ' ' - '<&f>Create a stone ellipsoid with radii 4x5x10 using the wand position 1 as the min corner. Really only useful when manually setting a size.' - ' <&e>/dwe sphere stone 4,5,10' - ' ' - '<&f>To perform any operation slowly to prevent server lag use the -d switch' - ' <&e>/dwe sphere dirt -d' - ' ' - '<&f>Create an ellipsoid without physics use the -g switch. Physics will still apply if a block update effects the block.' - ' <&e>/dwe sphere sand -g' - ' ' - '<&f>To break blocks <&dq>naturally<&dq> allowing item drops to spawn use the -n switch' - ' <&e>/dwe sphere air -n' - ' ' - '<&f>To see an outline of the area any command will effect use the -p switch' - ' <&e>/dwe sphere stone -p' permissions: - admin - edit - sphere tab complete: - determine 'li@' script: - if ! { - define command 'sphere' } - define prerun 'c' - inject s@dWE_Commands p:prerun - define s '' - define ellipsoid 'ellipsoid@,' - define selection 'cu@|' - if '%o%' == '0' { - define o '' } else { - define selection 'cu@%o%|].as_location>' - define center '' - define ellipsoid 'ellipsoid@,' } - define blocks '' - inject s@dWE_Commands p:prerunB - ~modifyblock %d% %g% %n% - run s@msgPrefixed 'def:dWE|Set complete!' #dWE_Commands_Cyl: ## This does no work as expected # type: command # debug: false # speed: 0 # name: .cyl # description: Creates a cylinder # usage: /.cyl # aliases: '' # data: # description: 'Create an cylinder centered from your selection.' # usage: '/dwe sphere [<<>material<>>(<&pc><&ns>)/...] (<<>x<>>(,<<>y<>>,<<>z<>>)) (-d, -g, -n, -l, -w)' # examples: [] # permissions: # - admin # - edit # - sphere # tab complete: # - determine 'li@' # script: # # /dwe cylinder ,[,] # - if ! { # - define command 'cyl' # } # - define prerun 'c' # - inject s@dWE_Commands p:prerun # - define selection 'cu@|' # - if '%o%' == '0' { # - define o '' # } # else { # - define selection 'cu@%o%|].as_location>' # } # - define location '' # - narrate "%location%" # - inject s@dWE_Commands p:prerunB # - ~modifyblock 'radius:' 'height:' 'depth:' %d% %g% %n% # - run s@msgPrefixed 'def:dWE|Set complete!' dWE_Commands_Copy: type: command debug: false speed: 0 name: .copy description: Copy your selection usage: /.copy aliases: '' data: description: 'Copy your current selection to your clipboard for pasting.' usage: '/dwe copy' examples: - 'You don<&sq>t actually need an example...' - 'Do you?' permissions: - admin - edit - copy tab complete: - determine 'li@' script: # /dwe copy - if ! { - define command 'copy' } - define prerun 'b' - inject s@dWE_Commands p:prerun - define u '' - define t 'Clipboard' - define o '' - inject s@dWE_ISN - run s@msgPrefixed 'def:dWE|<&7><&o>Selection saved to clipboard' dWE_Commands_Cut: type: command debug: false speed: 0 name: .cut description: Cut your selection usage: /.cut aliases: '' data: description: 'Cut is just like copy except that your selection is also removed.' usage: '/dwe cut' examples: - 'You don<&sq>t actually need an example...' - 'Do you?' permissions: - admin - edit - cut tab complete: - determine 'li@' script: # /dwe cut - if ! { - define command 'cut' } - define prerun 'b' - inject s@dWE_Commands p:prerun - inject s@dWE_Commands p:prerunB - define t 'Clipboard' - inject s@dWE_ISN - run s@msgPrefixed 'def:dWE|<&7><&o>Selection saved to clipboard' - if { - ~modifyblock m@air delayed } else { - ~modifyblock m@air } dWE_Commands_Paste: type: command debug: false speed: 0 name: .paste description: Paste your selection usage: /.paste aliases: '' data: description: 'Paste items from your clipboard to a location.' usage: '/dwe paste <&lb><&ns><&rb> (-a, -w, -l, -p, -d)' examples: - '<&f>To paste the most recent entry in your clipboard' - ' <&e>/dwe paste' - ' <&e>/dwe paste 1' - ' ' - '<&f>To paste the fifth oldest entry in your clipboard' - ' <&e>/dwe paste 5' - ' ' - '<&f>To paste the second entry in your clipboard ignoring air blocks' - ' <&e>/dwe paste 2 -a' - ' ' - '<&f>To paste your clipboard at position 1 of your wand' - ' <&e>/dwe paste -w' - ' ' - '<&f>To paste your clipboard to the location you are looking at' - ' <&e>/dwe paste -l' - ' ' - '<&f>To preview your paste showing an outline of the space it will occupy' - ' <&e>/dwe paste -p' - ' ' - '<&f>To paste your clipboard slowly' - ' <&e>/dwe paste -d' permissions: - admin - edit - paste tab complete: - determine 'li@' script: # /dwe paste - if ! { - define command 'paste' } - define prerun 'b' - inject s@dWE_Commands p:prerun # Will be a config file option - define clipboardLimit '3' - define pRange '50' - define n '' - define a ']:noair||>' - define d ']:delayed||>' - define p '' - define o ']:%pos1%||]:||>>' - define u '' - define t 'Clipboard' - inject s@dWE_PS - run s@msgPrefixed 'def:dWE|<&7><&o>Clipboard entry %entry% pasted!' dWE_Commands_Rotate: type: command debug: false speed: 0 name: .rotate description: Rotate your selection usage: /.rotate aliases: '' data: description: 'This isn<&sq>t documented because you should <&c>NOT<&f> use it!' usage: '/dwe rotate' examples: [] permissions: - admin - edit - rotate tab complete: - determine 'li@' script: # /dwe rotate [90/180/270/360] - if ! { - define command 'rotate' } - define prerun 'b' - inject s@dWE_Commands p:prerun - run s@msgPrefixed 'def:dWE|<&c>This command doesn<&sq>t do anything yet!' dWE_Commands_Undo: type: command debug: false speed: 0 name: .undo description: Undo edits usage: /.undo aliases: '' data: description: 'For those <&dq>Oh Fudge!<&dq> moments. Simply undo.' usage: '/dwe undo (<&ns>) (-a, -d)' examples: - 'Undo your last edit.' - ' <&e>/dwe undo' - ' ' - 'Undo your fourth most recent edit.' - ' <&e>/dwe undo 4' - ' ' - 'Undo your last edit slowly to prevent server lag.' - ' <&e>/dwe undo -d' - ' ' - 'Undo your last edit ignoring air blocks.' - ' <&e>/dwe undo -a' - ' ' permissions: - admin - edit - undo tab complete: - determine 'li@' script: # /dwe undo - if ! { - define command 'undo' } - define prerun 'a' - inject s@dWE_Commands p:prerun - define n '' - define a ']:noair||>' - define d ']:delayed||>' - define entry '' - define o '' - define u '' - define t 'Undo' - inject s@dWE_PS - flag player 'dWE.History.Undo:<-:%entry%/' - adjust server 'delete_file:schematics/dWE/Undo/%u%/%entry%.schematic' - run s@msgPrefixed 'def:dWE|<&7><&o>Undo entry %entry% complete!' dWE_Commands_Redo: type: command debug: false speed: 0 name: .redo description: Redo edits usage: /.redo aliases: '' data: description: 'For when you should have done that thing you thought you shouldn<&sq>t have. Redo.' usage: '/dwe redo (<&ns>) (-a, -d)' examples: - 'Redo your last undo.' - ' <&e>/dwe redo' - ' ' - 'Redo your third most recent undo.' - ' <&e>/dwe redo 3' - ' ' - 'Redo your last undo slowly to prevent server lag.' - ' <&e>/dwe redo -d' - ' ' - 'Redo your last undo ignoring air blocks.' - ' <&e>/dwe redo -a' - ' ' permissions: - admin - edit - undo tab complete: - determine 'li@' script: # /dwe redo - if ! { - define command 'redo' } - define prerun 'a' - inject s@dWE_Commands p:prerun - define n '' - define a ']:noair||>' - define d ']:delayed||>' - define entry '' - define o '' - define u '' - define t 'Redo' - inject s@dWE_PS - flag player 'dWE.History.Redo:<-:%entry%/' - adjust server 'delete_file:schematics/dWE/Redo/%u%/%entry%.schematic' - run s@msgPrefixed 'def:dWE|<&7><&o>Redo entry %entry% complete!' dWE_Commands_Schem: type: command debug: false speed: 0 name: .schem description: Manage Schematics usage: /.schem aliases: '' data: description: 'Do what you need to with schematics' usage: '/dwe schem list, load, unload, save, delete, copy, rename, paste, bind (-p)' examples: - 'List the second page of schematics.' - ' <&e>/dwe schem list 2' - ' ' - 'Load the schematic named house1' - ' <&e>/dwe schem load house1' - ' ' - 'Unload the public schematic named house1' - ' <&e>/dwe schem unload -p house1' - ' ' - 'Save your current selection as park_bench15' - ' <&e>/dwe schem save park_bench15' - ' ' - 'Delete the schematic named aa1' - ' <&e>/dwe schem delete aa1' - ' ' - 'Copy the big_tree schematic and name it tree1' - ' <&e>/dwe schem copy big_tree tree1' - ' ' - 'Rename the dirt_shack schematic to my_mansion' - ' <&e>/dwe schem rename dirt_shack my_mansion' - ' ' - 'Paste the public schematic named tank at the location you are looking' - ' <&e>/dwe schem paste tank -p -l' - ' ' - 'Bind the schematic named barn to the tool in your hand' - ' - The -d switch will prevent server lag when the tool is used' - ' - The -a switch will ignore pasting air blocks' - ' <&e>/dwe schem bind barn -d -a' - ' ' args: - list - load - unload - save - delete - copy - rename - paste - bind permissions: - admin - schematic tab complete: - determine 'li@' script: # /dwe schematic [list/load/unload/save/delete/copy/rename/paste/bind] - if ! { - define command 'schem' } - define prerun 'b' - inject s@dWE_Commands p:prerun - define n '' - define p '' - if '%p%' { - define p 'public' } else { - define pl 'li@' - define rm 'li@' - foreach '%args%' { - define a '%value%' - if { - define rm '' - if '%pl%' !contains '%a%' { - define pl ']>' } } } - define args ']>' - if { - define p '' } else { - if || { - define p '' } else { - define p '' } } } - define pRange '50' - define a ']:noair||>' - define d ']:delayed||>' - define o ']:%pos1%||]:||>>' - define args '' - define cmd '' - define cmds '' - if '%cmds%' !contains '%cmd%' { - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe schem <&lb><&rb> (-p)' - queue clear } - choose '%cmd%': - case 'list': - define entries 'li@' - define i '0' - foreach '': - define name '' - define v '' - define i '' - choose '%v%': - case '5': - define entry '%name%|.schem load ]:-p %name%||%name%>|<&a>Click to load <&b>%name%]>' - case '0': - define entry '%name%|.schem unload ]:-p %name%||%name%>|<&7>Height<&co><&6.pad_right[4]><&nl><&7>Length<&co><&6.pad_right[4]><&nl><&7>Width<&co><&6.pad_right[4]><&nl><&7>Total Size<&co><&6.pad_right[4]><&nl><&nl>Click to Unload]>]>' - default: - define entry '%name%|This is invalid!]>]>' - define entries '.<&sp>%entry%]>' - if { - define entries 'No schematics for you!]>' } - run s@msgBoxed instantly 'def:dwe|dWorldEditor|.help|<&a>Go back to main help]>|<&e>]:Public||> Schematic List|.schem ]:list -p||list %p%>||52|10|' - case 'load': - define name '' - define v '' - if '%v%' != '5' { - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%||%name%' - queue clear } - schematic load 'name:dWE_saves_%p%_%name%' 'filename:dWE/saves/%p%/%name%' - run s@msgPrefixed 'def:dWE|Loaded %name%' - case 'unload': - define name '' - define v '' - if '%v%' != '0' { - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%||%name%' - queue clear } - schematic unload 'name:dWE_saves_%p%_%name%' - run s@msgPrefixed 'def:dWE|Unloaded %name%' - case 'save': - define name '' - define v '' - if 'li@3|4' !contains '%v%' { - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%||%name%' - queue clear } - schematic create 'name:dWE_saves_%p%_%name%' '' '%cuboid%' - schematic save 'name:dWE_saves_%p%_%name%' 'filename:dWE/saves/%p%/%name%' - schematic unload 'name:dWE_saves_%p%_%name%' - run s@msgPrefixed 'def:dWE|Saved %name%' - case 'delete': - define name '' - define v '' - if '%v%' != '5' { - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%||%name%' - queue clear } - adjust server 'delete_file:schematics/dWE/saves/%p%/%name%.schematic' - run s@msgPrefixed 'def:dWE|Deleted %name%' - case 'copy': - define name '' - define v '' - if '%v%' == '5' { - schematic load 'name:dWE_saves_%p%_%name%' 'filename:dWE/saves/%p%/%name%' } else if '%v%' != '0' { - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%||%name%' - queue clear } - define copy '' - define v '' - if 'li@3|4' !contains '%v%' { - schematic unload 'name:dWE_saves_%p%_%name%' - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%||%copy%' - queue clear } - schematic save 'name:dWE_saves_%p%_%name%' 'filename:dWE/saves/%p%/%copy%' - schematic unload 'name:dWE_saves_%p%_%name%' - run s@msgPrefixed 'def:dWE|Copied %name% to %copy%' - case 'rename': - define name '' - define v '' - if '%v%' == '5' { - schematic load 'name:dWE_saves_%p%_%name%' 'filename:dWE/saves/%p%/%name%' } else if '%v%' != '0' { - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%||%name%' - queue clear } - define copy '' - define v '' - if 'li@3|4' !contains '%v%' { - schematic unload 'name:dWE_saves_%p%_%name%' - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%||%copy%' - queue clear } - schematic save 'name:dWE_saves_%p%_%name%' 'filename:dWE/saves/%p%/%copy%' - schematic unload 'name:dWE_saves_%p%_%name%' - adjust server 'delete_file:schematics/dWE/saves/%p%/%name%.schematic' - run s@msgPrefixed 'def:dWE|Renamed %name% to %copy%' - case 'paste': - define name '' - define v '' - if '%v%' != '0' { - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%||%name%' - queue clear } - define cuboid '' - if !|]> { - queue clear } # Save the existing area for undo history - define u '' - define t 'Undo' - inject s@dWE_ISN # I know i should do logic here, but damnit... empty args shouldn't be a problem if they are optional! - ~schematic paste 'name:dWE_saves_%p%_%name%' '%o%' '%cuboid%' %d% %a% - run s@msgPrefixed 'def:dWE|Pasted %name%' - case 'bind': - define name '' - define v '' - define item '' - if { - run instantly delay:1t 's@dWE_Error' 'def:bind|1||' } - if '%v%' == '5' { - schematic load 'name:dWE_saves_%p%_%name%' 'filename:dWE/saves/%p%/%name%' - run s@msgPrefixed 'def:dWE|Loaded %name%' } else if '%v%' != '0' { - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%||%name%' - queue clear } - define lore 'li@dWorldEditor Schematic|%name%|<&sp>|Length<&co>|Width<&co>|Height<&co>|Size<&co>' - inventory set 'd:' 'o:%item%[display_name=%name%;lore=%lore%;nbt=dWE_Tool/schem;nbt=dWE_Owner/%p%;nbt=dWE_Name/%name%;nbt=dWE_delayed/%d%;nbt=dWE_noair/%a%;flags=HIDE_ATTRIBUTES|HIDE_DESTROYS|HIDE_ENCHANTS|HIDE_PLACED_ON|HIDE_POTION_EFFECTS|HIDE_UNBREAKABLE]' 'slot:]>' # # # END dWE Command Scripts #-------------------------------------- # ################################################################################ # # dWorldEditor Other Utilities # # Other Utility functions used throughout dWorldEditor # #-------------------------------------- # # Command Permission Check Procedure script # - Used to check if a player has permission to use a command. # dWE_HasPerm_Command: # Usage: type: procedure speed: 0 debug: false definitions: command|player script: - if %player% == 'server' || || { - determine true } - define perms "" - if { - determine true } - foreach %perms% { - define perm '' - if { - determine true } } - determine false # #-------------------------------------- # # getFacing Procedure script # - Returns the cardinal direction the player is facing # getFacing: # Usage: type: procedure debug: false definitions: pitch|yaw script: - if determine d else if determine u else if || determine s else if determine se else if determine e else if determine ne else if determine n else if determine nw else if determine w else if determine sw else determine 0 # #-------------------------------------- # # Paste Schematic # # This task will load an existing schematic, save the existing area for undo/ # redo history, paste the loaded schematic to the specified origin, and unload # the schem from memory. # # %t% - Type of schematic (undo|redo|clipboard) # %u% - Player UUID # %o% - The origin location # %n% - The id number of the schematic to paste # dWE_PS: type: task debug: false limits: clipboard: 3 undo: 3 redo: 3 script: - define limit '' - if '%n%' > '%limit%' { - run instantly delay:1t s@dWE_Error 'def:history.%t%|2||%limit%' - queue clear } - define ct '' - if '%n%' > '%ct%' { - run instantly delay:1t s@dWE_Error 'def:history.%t%|]:0||1>||%ct%' - queue clear } - define entry '' - if '%entry%' == 'null' { - run instantly delay:1t s@dWE_Error 'def:history.generic|0||%t%|%entry%' - queue clear } - define schem 'dWE_%t%_%u%_%entry%' - if ! { - if { - schematic load 'name:%schem%' 'filename:dWE/%t%/%u%/%entry%' } else { - run instantly delay:1t s@dWE_Error 'def:history.generic|0||%t%|%entry%' - flag player 'dWE.History.%t%:<-:%entry%/' - queue clear } } - define cuboid '' - if !|]> { - schematic unload 'name:%schem%' - queue clear } # Save the existing area for undo history - define t ']:Redo||Undo>' - inject s@dWE_ISN # I know i should do logic here, but damnit... empty args shouldn't be a problem if they are optional! - ~schematic paste 'name:%schem%' '%o%' '%cuboid%' %d% %a% - schematic unload 'name:%schem%' # # END dWE_PS #-------------------------------------- # # Incremental Schematic Names # # Inject this task to create a new schematic. # Automatically increment the name value and remove the oldest based on limit. # Used for clipboard, undo, and redo schematics. # # %t% - Type of schematic (undo|redo|clipboard) # %u% - Player UUID # %o% - The origin location # %cuboid% - The cuboid object to make a schematic of # dWE_ISN: type: task debug: false limits: clipboard: 3 undo: 3 redo: 3 script: # The limit should be definable in the config.yml file - define limit '' - define last '' - define new '' - schematic create 'name:dWE_%t%_%u%_%new%' '%o%' '%cuboid%' - schematic save 'name:dWE_%t%_%u%_%new%' 'filename:dWE/%t%/%u%/%new%' - schematic unload 'name:dWE_%t%_%u%_%new%' - if '%new%' > '%limit%' { - define old '' - define on 'dWE_%t%_%u%_%old%' - define of 'dWE/%t%/%u%/%old%' - if { - schematic unload 'name:%on%' } - if { - adjust server 'delete_file:schematics/%of%.schematic' } - flag player 'dWE.History.%t%:<-:%old%/' } - flag player 'dWE.History.%t%:->:%new%/%o%' # # END dWE_ISN #-------------------------------------- # # Validate Schematic Names # dWE_SNV: # Usage: type: procedure debug: false definitions: n|p script: - if '%n%' == 'null' { - determine 1 } - if '' { - determine 2 } - if ! { - if '%p%' == 'public' { - determine 3 } else { - determine 4 } } - if ! { - determine 5 } - determine 0 # # END dWE_Validate_World #-------------------------------------- # # selectionSize Procedure script # - Returns the size of the players selection # selectionSize: # Usage: type: procedure debug: false definitions: pos1|pos2 script: - define x '].abs.add[1]||1>' - define y '].abs.add[1]||1>' - define z '].abs.add[1]||1>' - determine '' # # END dWE_selectionSize #-------------------------------------- # # selectionSize Procedure script # - Returns the size of the players selection # dWE_dRegionCheck: # Usage: type: procedure debug: false definitions: pos1|pos2 script: - if ! { - if ||]> { - if !> { - determine false } } } - determine true # # END dWE_dRegionCheck #--------------------------------------- # # dWorldEditor Error Messages # dWE_Error: type: task debug: false msgs: schem_name: 0: - '<&a><&o><&a> is currently loaded.' - '<&a>Maybe you want to unload|.schem unload |<&c>Click to unload ]> <&a>it?' 1: - '<&c>You didn<&sq>t enter a schematic name.' - '<&a>Maybe you want to see the list|.schem list|<&c>Click to list schematics]> <&a>of schematics?' 2: - '<&c>Schematic name may only contain letters, numbers, hyphen, and underscore!' 3: - '<&c>The public schematic <&o> <&c>does not exist!' - '<&a>Maybe you want to see the list|.schem list -p|<&c>Click to list public schematics]> <&a>of schematics?' 4: - '<&c><&o> <&c>does not exist!' - '<&a>Maybe you want to see the list|.schem list|<&c>Click to list schematics]> <&a>of schematics?' 5: - '<&c><&o> <&c>is not loaded!' - '<&a>Maybe you want to load|.schem load |<&c>Click to load ]> <&a>it?' bind: 1: - '<&c>Can not bind to <&o><&c>!' - '<&a>Try something that isn<&sq>t a placeable block.' history: generic: 0: - '<&c> does not exist in history!' undo: 0: - '<&c>Nothing left to Undo!' 1: - '<&c>There are only entries to undo.' 2: - '<&c>Undo history can only have entries.' redo: 0: - '<&c>Nothing left to Redo!' 1: - '<&c>There are only entries to redo.' 2: - '<&c>Redo history can only have entries.' clipboard: 0: - '<&c>Your Clipboard is empty!' 1: - '<&c>You only have entries in your clipboard.' 2: - '<&c>Clipboard history can only have entries.' script: - if '%3%' == 'server' { - announce to_console '<&4><&lb><&6>dWE<&4><&rb> ' } else { - define prefix '<&lb><&6>dWE<&4><&rb>|.help|<&6> dWE<&nl> <&nl><&d>Click for help]> ' - foreach '' { - narrate "%prefix%>" } } # # END dWE_Error #-------------------------------------- # # END dWE Other Utilities #-------------------------------------- # # dWorldEditor Author Banner Items # # Banner items representing the authors # dwe_Author_mcmonkey: type: item debug: false material: creeper_skull display name: <&2><&l>MCMONKEY text_name: 'MCMONKEY' url: 'http://mcmonkey.org' lore: - <&a>Click to visit http://mcmonkey.org dwe_Author_Morphan1: type: item debug: false material: creeper_skull display name: <&2><&l>Morphan1 text_name: 'Morphan1' url: 'http://en.wikipedia.org/wiki/Candy' lore: - <&a>pls2buymesome dwe_Author_Anthony: type: item debug: false material: i@human_skull display name: "<&f> &pipeAnthony&pipe" text_name: '|Anthony|' url: 'http://mineconomy.org' lore: - <&7> Owner<&co> <&e>M<&6>ine<&e>C<&6>onomy <&e>N<&6>etwork - <&5>------------------------- - <&7> - <&7> I<&sq>ve been playing minecraft - <&7> and running a server since - <&7> 2010. I have fun and share - <&7> what I do. - <&7> - <&9> Click To Visit # # END dWE Author Banner Items #--------------------------------------