################################################################################
#
# 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 <player.flag[dWEWand]> like so:
# - define pos1 '<player.flag[dWEWand].as_list.get[1]||null>'
# - define pos2 '<player.flag[dWEWand].as_list.get[2]||null>'
# - 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.<command> 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 (<arg> <#>) -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 [<#>] (<direction>) 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) (<direction>) 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 [<#>] (<direction>) 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 [<material>(%#)] dwe.admin Sets your current selection to the
# ([<x>],(<y>,<z>)) dwe.edit material specified. TAB completion works
# (-d, -g, -n, -l, -w, -p) dwe.set for material names.
#
# /dwe replace [<newMat>(%#)] dwe.admin Replace materials in an area with other
# [<newMat>(%#)] ([<x>],(<y>,<z>)) dwe.edit materials. TAB completion works for
# (-d, -g, -n, -l, -w, -p) dwe.set material names.
#
# /dwe sphere [<material>(%#)] dwe.admin Create an ellipsoid of the specified
# ([<x>],(<y>,<z>)) 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% = <player.uuid> || '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 !<c.item.scriptname.starts_with[dWE_]||false> {
- queue clear
}
- determine passively CANCELLED
- inject <c.item.scriptname.as_script> instantly
on server start:
- inject locally load
on reload scripts:
- run locally load delay:1t
on system time hourly:
# - if !<yaml[dWE_config].read[config.stats.useStats]||true> {
# - queue clear
# }
- if <queue.list> !contains 'q@dWE_UpdateCheck' {
- run locally delay:1t updateCheck 'id:dWE_UpdateCheck'
}
- if <queue.list> !contains 'q@dWE_SendMetrics' {
- run locally delay:1t sendMetrics 'id:dWE_SendMetrics'
}
load:
- if <queue.list> !contains 'q@dWE_UpdateCheck' {
- run locally delay:1t updateCheck 'id:dWE_UpdateCheck'
}
- flag server 'dWE.Command_List:!'
- flag server 'dWE.Command_List:|:<server.list_scripts.filter[starts_with[s@dWE_Commands_]].parse[name].parse[after[dWE_Commands_]].alphanumeric.to_lowercase||li@>'
updateCheck:
- ^if !<server.has_flag[dWE.Version.Repo]> {
- ~webget "http://one.denizenscript.com/denizen/repo/version/<s@dWE_Version.yaml_key[id]>" save:page
- ^flag server "dWE.Version.Repo:<entry[page].result||unknown>" d:1h
}
- ^define repoVersion '<server.flag[dWE.Version.Repo]||unknown>'
- ^define currentVersion '<s@dWE_Version.yaml_key[version]>'
- ^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=<s@dWE_Version.yaml_key[id]>&version=<s@dWE_Version.yaml_key[version]>&players=<server.list_online_players.size>&denizen_version=<server.denizen_version.replace[-SNAPSHOT].before[ ]>&jenkins_build=<server.denizen_version.after[(build ].before[)]>&bukkit_version=<server.bukkit_version>" 'save:send'
- if !<entry[send].result.starts_with[SUCCESS]||false> {
- 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><def[pos%pos%].replace[,].with[<&7>, <&3><&o>]> <&7>(<&o><proc[selectionSize].context[%pos1%|%pos2%]><&7>)'
set_pos1:
- run s@msgPrefixed 'def:dWE|<&f>Selection started at <&3><&o><def[cuboid].min.simple.replace[,].with[<&7>,<&3><&o>]>'
set_pos2:
- run s@msgPrefixed 'def:dWE|<&f>Selection expanded to include<&co> <&3><&o><context.location.simple.replace[,].with[<&7>,<&3><&o>]> <&7>(<&o><proc[selectionSize].context[%pos1%|%pos2%]><&7>)'
shift:
- run s@msgPrefixed 'def:dWE|<&f>Shifted<&f> <&7><&o>%direction% <&7>by <&o>%n% <&7>blocks (<&o><proc[selectionSize].context[%pos1%|%pos2%]><&7>)'
expand:
- define expandBy '<proc[selectionSize].context[%pos1%|%pos2%].sub[%oldSize%].as_int>'
- run s@msgPrefixed 'def:dWE|<&f>Expanded<&f> <&7><&o>%direction% <&7>by <&o>%expandBy% <&7>blocks (<&o><proc[selectionSize].context[%pos1%|%pos2%]><&7>)'
contract:
- define contractBy '<def[oldSize].sub[<proc[selectionSize].context[%pos1%|%pos2%]>].as_int>'
- run s@msgPrefixed 'def:dWE|<&f>Contracted<&f> <&7><&o>%direction% <&7>by <&o>%contractBy% <&7>blocks (<&o><proc[selectionSize].context[%pos1%|%pos2%]><&7>)'
inset:
- define insetBy '<def[oldSize].sub[<proc[selectionSize].context[%pos1%|%pos2%]>].as_int>'
- run s@msgPrefixed 'def:dWE|<&f>Inset<&f> <&7>by <&o>%insetBy% <&7>blocks (<&o><proc[selectionSize].context[%pos1%|%pos2%]><&7>)'
outset:
- define outsetBy '<proc[selectionSize].context[%pos1%|%pos2%].sub[%oldSize%].as_int>'
- run s@msgPrefixed 'def:dWE|<&f>Outset<&f> <&7>by <&o>%outsetBy% <&7>blocks (<&o><proc[selectionSize].context[%pos1%|%pos2%]><&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 !<player.has_permission[dwe.wand]||<player.is_op>> {
- take i@dWE_Wand
- run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&a>You should not have this!' instantly
- queue clear
}
- if <c.click_type.is[==].to[LEFT_CLICK_BLOCK]> {
- define pos 1
}
else if <c.click_type.is[==].to[RIGHT_CLICK_BLOCK]> {
- define pos 2
}
else {
- queue clear
}
- define pos1 '<player.flag[dWEWand].as_list.get[1]||null>'
- define pos2 '<player.flag[dWEWand].as_list.get[2]||null>'
- define type '<player.flag[dWEWand_Type]||cuboid>'
- if <li@cuboid|extender.contains[%type%]||false> {
- inject locally %type%
}
else {
- inject locally cuboid
}
cuboid:
- if <context.location.simple.is[==].to[<def[pos%pos%]>]||false> {
- run s@msgPrefixed 'def:dWE|<&c>pos%pos% is already set'
- queue clear
}
- define pos%pos% '<context.location.simple>'
- 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@<context.location.simple>|<context.location.simple>
}
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 <def[cuboid].include[<context.location.simple>]>
- if <def[cuboid_old]> == <def[cuboid]> {
- run s@msgPrefixed 'def:dWE|<&c>That position is already included.'
- queue clear
}
}
- define pos1 '<def[cuboid].min>'
- define pos2 '<def[cuboid].max>'
- 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 !<c.item.has_nbt[dWE_Tool]||false> {
- queue clear
}
- determine passively CANCELLED
- define tool '<c.item.nbt[dWE_Tool]>'
- if !<player.has_permission[dwe.tool.%tool%]||<player.is_op>> || 'li@public|<player.uuid>' !contains '<c.item.nbt[dWE_Owner]>' {
- take <c.item>
- run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&a>You should not have this!' instantly
- queue clear
}
- inject locally %tool%
schem:
- choose '<context.click_type.before[_]>':
- case 'left':
- if <player.is_sneaking> {
- define n '1'
- define entry '<player.flag[dWE.History.Undo].as_list.last.before[/]||null>'
- define o '<player.flag[dWE.History.Undo].as_list.map_get[%entry%]||null>'
- define u '<player.uuid>'
- define t 'Undo'
- inject s@dWE_PS
- flag player 'dWE.History.Undo:<-:%entry%/<player.flag[dWE.History.Undo].map_get[%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 '<player.location.cursor_on[50]||null>'
- if '%o%' == 'null' {
- queue clear
}
- if '<player.target||null>' != 'null' {
- queue clear
}
- define name '<c.item.nbt[dWE_Name]>'
- define p '<c.item.nbt[dWE_Owner]>'
- define d '<c.item.nbt[dWE_delayed]>'
- define a '<c.item.nbt[dWE_noair]>'
- define v '<proc[dWE_SNV].context[%name%|%p%]>'
- if '%v%' != '0' {
- run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%name%'
- queue clear
}
- define cuboid '<schematic[dWE_saves_%p%_%name%].cuboid[%o%]>'
- if !<proc[dWE_dRegionCheck].context[<def[cuboid].min>|<def[cuboid].max>]> {
- queue clear
}
# Save the existing area for undo history
- define u '<player.uuid>'
- 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 <player.has_permission[dwe.basic]||<player.is_op>>
script:
- define command '<c.args.get[1].escaped||help>'
- define commands '<server.flag[dWE.Command_List].as_list||li@>'
- define args '<c.args.get[2].to[<c.args.size>]||li@>'
- if !<def[commands].contains[%command%]> || !<proc[dWE_HasPerm_Command].context[%command%|<player||server>]> {
- inject s@dWE_Commands_Help
}
- inject s@dWE_Commands_%command%
tab complete:
- define command '<c.args.get[1]||>'
- define commands '<server.flag[dWE.Command_List].as_list||li@>'
- define args '<c.args.get[2].to[<c.args.size>]||li@>'
- define spaces '<c.raw_args.to_list.count[ ]||0>'
- if <def[commands].contains[%command%]> {
- inject s@dWE_Commands_%command% 'p:tab complete'
}
else {
- define commands '<def[commands].filter[starts_with[%command%]]||%commands%>'
}
- foreach %commands% {
- if !<proc[dWE_HasPerm_Command].context[%command%|<player||server>]> {
- define commands '<def[commands].exclude[%value%]||%commands%>'
}
}
- if <def[commands].is_empty||true> {
- determine 'li@'
}
- determine '<def[commands]||li@>'
# Preprocessors. Does some pre-processing and passes back to the calling command
prerun:
- if <c.server||false> {
- run s@msgPrefixed 'def:dWE|<&c>This command must be run as a player.'
- queue clear
}
- if <c.alias> == '.%command%' {
- if !<proc[dWE_HasPerm_Command].context[%command%|<player>]> {
- inject s@dWE_Commands_Help p:helpList
- queue clear
}
- define commands '<server.flag[dWE.Command_List].as_list||li@>'
- define args "<c.args>"
}
- if %preRun% == 'a' {
- goto 'END'
}
- define pos1 '<player.flag[dWEWand].get[1].as_location||null>'
- define pos2 '<player.flag[dWEWand].get[2].as_location||null>'
- if <def[pos1].is[==].to[null]>
|| <def[pos2].is[==].to[null]> {
Line with no clear purpose - missing a -dash- or :colon:?
- run s@msgPrefixed 'def:dWE|<&c>No region selected!'
- queue clear
}
- define oldSize '<proc[selectionSize].context[%pos1%|%pos2%]>'
- define cuboid 'cu@%pos1%|%pos2%'
- define center '<def[cuboid].center.simple.as_location>'
- if %preRun% == 'b' {
- goto 'END'
}
- define pRange '50'
- define d '<t[<def[args].filter[starts_with[-d]].is_empty.not||true>]:delayed||>'
- define g '<t[<def[args].filter[starts_with[-g]].is_empty.not||true>]:no_physics||>'
- define n '<t[<def[args].filter[starts_with[-n]].is_empty.not||true>]:naturally||>'
- define s '<def[args].filter[matches[^[0-9,.]+$]].get[1]||0>'
- define p '<def[args].filter[starts_with[-p]].is_empty.not||false>'
- define o '<t[<def[args].filter[starts_with[-w]].is_empty.not||true>]:%pos1%||<t[<def[args].filter[starts_with[-l]].is_empty.not||true>]:<player.location.cursor_on[%pRange%].simple>||0>>'
- define args '<def[args].exclude[-d|-g|-n|-p|-w|-l|%s%]||%args%>'
- define matlist '<def[args].get[1].split_by[/]||li@>'
- define mats 'li@'
- define pcts 'li@'
- foreach '%matlist%' {
- define mat '<def[value].split_by[<&pc>].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><parse:<s@dWE_Commands_%command%.yaml_key[data.usage]||No usage info available!>>'
- queue clear
}
- define mats '<def[mats].include[%mat%]>'
- define pct '<def[value].split_by[<&pc>].get[2]||<el@val[100].div[<def[matlist].size>].round_up||100>>'
- if '%pct%' matches number {
- define pcts '<def[pcts].include[<def[pct].abs.as_int>]>'
}
}
- if <def[mats].is_empty> {
- run s@msgPrefixed 'def:dWE|<&c>SYNTAX ERROR<&co> <&6> Missing Material'
- run s@msgPrefixed 'def: |<&6><parse:<s@dWE_Commands_%command%.yaml_key[data.usage]||No usage info available!>>'
- queue clear
}
- if '%s%' == '0' {
# Only specify material. Sizes are determined by wand selection.
- define s '<def[cuboid].size.sub[1,1,1].div[2].split_by[,].get[1].to[3].separated_by[,].replace[l@]>'
}
else {
- define s '<def[s].split_by[,].get[1].to[3]>'
- if <def[s].size> == 2 {
- run s@msgPrefixed 'def:dWE|<&c>SYNTAX ERROR<&co> <&6> Invalid Size'
- run s@msgPrefixed 'def: |<&6><parse:<s@dWE_Commands_%command%.yaml_key[data.usage]||No usage info available!>>'
- queue clear
}
- define x '<def[s].get[1].abs>'
- define y '<def[s].get[2].abs||%x%>'
- define z '<def[s].get[3].abs||%x%>'
- define s "%x%,%y%,%z%"
}
- mark 'END'
prerunB:
- if %p% {
- run s@msgPrefixed 'def:dWE|<&c><&o>Showing outline of effected area'
- showfake '<player.flag[dWE.show].split[/].get[1]||m@blue_stained_glass>' '<def[selection].outline>' to:<player> 'd:<player.flag[dWE.show].split[/].get[2]||10>s'
- queue clear
}
# If using dRegions, check for overlapping regions before editing.
- if !<server.list_scripts.filter[starts_with[s@dRegions]].is_empty> {
- if <proc[dRegions_RegionOverlaps].context[<def[selection].replace[cu@].as_list.separated_by[/]>|<def[selection].center.world.name>|<player>]> {
- run s@msgPrefixed 'def:dWE|<&c>Region selection contains unowned dRegions!'
- if !<player.permission[dRegions.admin]||<player.is_op||false>> {
- 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 '<def[o]||<def[cuboid].min>>'
- define t 'Undo'
- define u '<player.uuid>'
- 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 <player.has_permission[dwe.basic]||<player.is_op>>
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 !<def[command].exists> {
- define commands '<server.flag[dWE.Command_List].as_list||li@>'
- define args "<c.args>"
}
- define command '<def[args].get[1].escaped||>'
- if <def[commands].contains[%command%]> {
- determine 'li@'
}
else {
- define commands '<def[commands].filter[starts_with[%command%]]||%commands%>'
}
- foreach %commands% {
- if !<proc[dWE_HasPerm_Command].context[%command%|<player||server>]> {
- define commands '<def[commands].exclude[%value%]||%commands%>'
}
}
- if <def[commands].is_empty||true> {
- determine 'li@'
}
- determine '<def[commands]||li@>'
script:
- if !<def[command].exists> {
- define command 'help'
}
- define prerun 'a'
- inject s@dWE_Commands p:prerun
- define arg '<def[args].get[1].escaped||1>'
- if <def[arg].is[matches].to[number]> {
- define page '<def[arg].abs.round||1>'
- inject s@dWE_Commands_Help p:helpList
- queue clear
}
- if <def[commands].contains[%arg%]||false> {
- define command '%arg%'
- define page '<tern[<def[args].get[2].is[matches].to[number]||false>]:<def[args].get[2].abs.round>||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 '<server.flag[dWE.Command_List].as_list||li@>'
- define helpDoc 'li@'
- foreach %commands% {
- if !<proc[dWE_HasPerm_Command].context[%value%|<player||server>]> {
- define commands '<def[commands].exclude[%value%]>'
}
else {
- define usage '<parse:<s@dWE_Commands_%value%.yaml_key[data.usage]||No usage info available!>>'
- define usage '<proc[msgTrim].context[40|<def[usage].escaped>]>'
- define button '<proc[msgCommand].context[<def[value].to_titlecase><&co>|.help %value%|<&a>Click for <&b><def[value].to_titlecase> <&a>help]>'
- define helpDoc '<def[helpDoc].include[%button%<&sp><&7><parse:<s@dWE_Commands_%value%.yaml_key[description]||Short Description>>|<&e.pad_left[3].with[<&sp>]>%usage%]>'
}
}
- run s@msgBoxed instantly 'def:dwe|<proc[msgCommand].context[<&6>dWorldEditor|.about|<&a>Click to learn<&nl><&a>about the project!]>|<proc[msgCommand].context[<&e>Help|.help|<&a>Go back to main help]> Files|dwe help|<def[page]||1>|52|10|<def[helpDoc].separated_by[|]>'
helpCommand:
# Help for a specific command
- define short '<parse:<s@dWE_Commands_%command%.yaml_key[description]||A not so useless description should be here!>>'
- define desc '<parse:<s@dWE_Commands_%command%.yaml_key[data.description]||A not so useless description should be here!>>'
- define usage '<parse:<s@dWE_Commands_%command%.yaml_key[data.usage]||No help for you!>>'
- define examples '<parse:<s@dWE_Commands_%command%.yaml_key[data.examples]||No help for you!>>'
- 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|<proc[msgCommand].context[<&6>dWorldEditor|.about|<&a>Click to learn<&nl><&a>about the project!]>|<proc[msgCommand].context[<&e>Help|.help|<&a>Go back to main help]> - <def[arg].to_titlecase>|.help %arg%|<def[page]||1>|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 !<def[command].exists> {
- define command 'about'
}
- define prerun 'a'
- inject s@dWE_Commands p:prerun
- run s@msgBoxed instantly 'def:dwe|<proc[msgCommand].context[<&6>dWorldEditor|.help|<&a>Go back to main help]>|<&e>About|dwe about|<tern[<def[args].get[1].is[matches].to[number]||false>]:<def[args].get[1].abs.round>||1>|52|10|<&7><parse:<s@dWE_Commands_%command%.yaml_key[description]>>| |<parse:<s@dWE_Commands_%command%.yaml_key[data.description]>>'
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 !<def[command].exists> {
- define command 'show'
}
- define prerun 'b'
- inject s@dWE_Commands p:prerun
- showfake <player.flag[dWE.show].split[/].get[1]||m@blue_stained_glass> <cu@%pos1%|%pos2%.outline> to:<player> d:<player.flag[dWE.show].split[/].get[2]||10>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 !<def[command].exists> {
- if !<proc[dWE_HasPerm_Command].context[wand|<player||server>]> {
- determine 'li@'
}
- define args "<c.args>"
- define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
}
- choose '%spaces%':
- case '0':
- determine 'wand -type '
- case '1':
- define arg '<def[args].get[1]||>'
- if '%arg%' != '-type ' {
- determine '-type '
}
- case '2':
- define arg2 '<def[args].get[2]||>'
- define arg1 '<def[args].get[1]||>'
- if '%arg1%' != '-type' {
- determine 'li@'
}
- if 'li@cuboid|extender' contains '%arg2%' {
- determine 'li@'
}
else {
- determine '<li@cuboid|extender.filter[starts_with[<def[arg2]>]]||li@cuboid|extender>'
}
- default:
- determine 'li@'
script:
- if !<def[command].exists> {
- define command 'wand'
}
- define prerun 'a'
- inject s@dWE_Commands p:prerun
- if <def[args].find[-type].is[OR_MORE].than[0]||false> {
- define type <def[args].get[<def[args].find[-type].add[1].as_int>]||null>
- if <li@cuboid|extender.contains[%type%]||false> {
- 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 <player.inventory.find_imperfect[<i@dWE_Wand>]> != '-1' {
- run s@msgPrefixed 'def:dWE|<&c>You already have a wand!'
}
else {
- give i@dWE_Wand
}
- define type '<player.flag[dWEWand_Type]||cuboid>'
- 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 !<def[command].exists> {
- define command 'pos1'
}
- define prerun 'a'
- inject s@dWE_Commands p:prerun
- define pos1 '<player.flag[dWEWand].as_list.get[1]||null>'
- if <player.location.simple.is[==].to[%pos1%]> {
- run s@msgPrefixed 'def:dWE|<&c>pos1 is already set'
- queue clear
}
- define pos1 '<player.location.simple>'
- define pos2 '<player.flag[dWEWand].as_list.get[2]||null>'
- 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 !<def[command].exists> {
- define command 'pos2'
}
- define prerun 'a'
- inject s@dWE_Commands p:prerun
- define pos2 '<player.flag[dWEWand].as_list.get[2]||null>'
- if <player.location.simple.is[==].to[%pos2%]> {
- run s@msgPrefixed 'def:dWE|<&c>pos2 is already set'
- queue clear
}
- define pos1 '<player.flag[dWEWand].as_list.get[1]||null>'
- define pos2 '<player.location.simple>'
- 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 !<def[command].exists> {
- define command 'hpos1'
}
- define prerun 'a'
- inject s@dWE_Commands p:prerun
- define pos1 '<player.flag[dWEWand].as_list.get[1]||null>'
- if <player.location.cursor_on[160].simple.is[==].to[%pos1%]> {
- run s@msgPrefixed 'def:dWE|<&c>pos1 is already set'
- queue clear
}
- define pos1 '<player.location.cursor_on[160].simple>'
- define pos2 '<player.flag[dWEWand].as_list.get[2]||null>'
- 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 <player.has_permission[dwe.basic]||<player.is_op>>
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 !<def[command].exists> {
- define command 'hpos2'
}
- define prerun 'a'
- inject s@dWE_Commands p:prerun
- define pos2 '<player.flag[dWEWand].as_list.get[2]||null>'
- if <player.location.cursor_on[160].simple.is[==].to[%pos2%]> {
- run s@msgPrefixed 'def:dWE|<&c>pos2 is already set'
- queue clear
}
- define pos1 '<player.flag[dWEWand].as_list.get[1]||null>'
- define pos2 '<player.location.cursor_on[160].simple>'
- 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 !<def[command].exists> {
- define command 'chunk'
}
- define prerun 'a'
- inject s@dWE_Commands p:prerun
- define pos1 '<player.location.get_chunk.cuboid.min>'
- define pos2 '<player.location.get_chunk.cuboid.max>'
- flag player dWEWand:!
- flag player dWEWand:|:%pos1%|%pos2%
- run s@msgPrefixed 'def:dWE|<&f>Chunk selected<&co> <player.location.get_chunk.replace[ch@].split[,].get[1|2].comma_separated>'
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 !<def[command].exists> {
- if !<proc[dWE_HasPerm_Command].context[expand|<player||server>]> {
- determine 'li@'
}
- define args "<c.args>"
- define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
}
- choose '%spaces%':
- case '0':
- determine 'expand [<&ns>]/v '
- case '1':
- define arg1 '<def[args].get[1]||>'
- if '%arg1%' matches 'number' || '%arg1%' == 'v' {
- determine '%arg1% '
}
else {
- determine '[<&ns>]/v '
}
- case '2':
- define arg2 '<def[args].get[2]||>'
- define arg1 '<def[args].get[1]||>'
- 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 <amount/v> (n/s/e/w/u/d)
- if !<def[command].exists> {
- define command 'expand'
}
- if <c.server||false> {
- 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 <def[args].get[1].escaped.is[==].to[v]||false> {
- define pos1 '<def[pos1].sub[0,<def[pos1].y>,0].replace[l@]>'
- define pos2 '<def[pos2].add[0,<el@val[255].sub[<def[pos2].y>]>,0].replace[l@]>'
- define direction 'Vertically'
- goto 'end'
}
- define n '<def[args].get[1].escaped.round_up||0>'
- define d '<def[args].get[2].escaped||0>'
- if <def[n].is[OR_LESS].than[0]||true> {
- 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 <el@[li@n|e|s|w|u|d].contains[%d%].not||true> {
- define d '<proc[getFacing].context[<player.location.pitch.as_money>|<player.location.yaw.as_money>]>'
}
- if <el@[li@n|e|s|w|u|d].contains[%d%].not||true> {
- run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>Unknown direction!'
- queue clear
}
- choose '%d%':
- case 'n':
- if <def[pos1].z.is[OR_LESS].than[<def[pos2].z>]> {
- define pos1 '<def[pos1].sub[0,0,%n%]>'
}
else {
- define pos2 '<def[pos2].sub[0,0,%n%]>'
}
- define direction 'North'
- case 'e':
- if <def[pos1].x.is[OR_MORE].than[<def[pos2].x>]> {
- define pos1 '<def[pos1].add[%n%,0,0]>'
}
else {
- define pos2 '<def[pos2].add[%n%,0,0]>'
}
- define direction 'East'
- case 's':
- if <def[pos1].z.is[OR_MORE].than[<def[pos2].z>]> {
- define pos1 '<def[pos1].add[0,0,%n%]>'
}
else {
- define pos2 '<def[pos2].add[0,0,%n%]>'
}
- define direction 'South'
- case 'w':
- if <def[pos1].x.is[OR_LESS].than[<def[pos2].x>]> {
- define pos1 '<def[pos1].sub[%n%,0,0]>'
}
else {
- define pos2 '<def[pos2].sub[%n%,0,0]>'
}
- define direction 'West'
- case 'u':
- if <def[pos1].y.is[OR_MORE].than[<def[pos2].y>]> {
- define pos1 '<def[pos1].add[0,%n%,0]>'
}
else {
- define pos2 '<def[pos2].add[0,%n%,0]>'
}
- define direction 'Up'
- case 'd':
- if <def[pos1].y.is[OR_LESS].than[<def[pos2].y>]> {
- define pos1 '<def[pos1].sub[0,%n%,0]>'
}
else {
- define pos2 '<def[pos2].sub[0,%n%,0]>'
}
- 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 !<def[command].exists> {
- if !<proc[dWE_HasPerm_Command].context[contract|<player||server>]> {
- determine 'li@'
}
- define args "<c.args>"
- define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
}
- choose '%spaces%':
- case '0':
- determine 'contract [<&ns>] '
- case '1':
- define arg1 '<def[args].get[1]||>'
- if '%arg1%' matches 'number' {
- determine '%arg1% '
}
else {
- determine '[<&ns>] '
}
- case '2':
- define arg2 '<def[args].get[2]||>'
- define arg1 '<def[args].get[1]||>'
- 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 <amount/v> (n/s/e/w/u/d)
- if !<def[command].exists> {
- define command 'contract'
}
- define prerun 'b'
- inject s@dWE_Commands p:prerun
- define n '<def[args].get[1].escaped.round_up||0>'
- define d '<def[args].get[2].escaped||0>'
- if <def[n].is[OR_LESS].than[0]||true> {
- run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe contract <&6><&lb><&7>amount<&6><&rb> <&6>(<&7>direction<&6>)'
- queue clear
}
- if <el@[li@n|e|s|w|u|d].contains[%d%].not||true> {
- define d '<proc[getFacing].context[<player.location.pitch.as_money>|<player.location.yaw.as_money>]>'
}
- if <el@[li@n|e|s|w|u|d].contains[%d%].not||true> {
- run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>Unknown direction!'
- queue clear
}
- choose '%d%':
- case 'n':
- if <def[pos1].z.is[OR_LESS].than[<def[pos2].z>]> {
- define pos2 '<def[pos2].sub[0,0,%n%]>'
}
else {
- define pos1 '<def[pos1].sub[0,0,%n%]>'
}
- define direction 'North'
- case 'e':
- if <def[pos1].x.is[OR_MORE].than[<def[pos2].x>]> {
- define pos2 '<def[pos2].add[%n%,0,0]>'
}
else {
- define pos1 '<def[pos1].add[%n%,0,0]>'
}
- define direction 'East'
- case 's':
- if <def[pos1].z.is[OR_MORE].than[<def[pos2].z>]> {
- define pos2 '<def[pos2].add[0,0,%n%]>'
}
else {
- define pos1 '<def[pos1].add[0,0,%n%]>'
}
- define direction 'South'
- case 'w':
- if <def[pos1].x.is[OR_LESS].than[<def[pos2].x>]> {
- define pos2 '<def[pos2].sub[%n%,0,0]>'
}
else {
- define pos1 '<def[pos1].sub[%n%,0,0]>'
}
- define direction 'West'
- case 'u':
- if <def[pos1].y.is[OR_MORE].than[<def[pos2].y>]> {
- define pos2 '<def[pos2].add[0,%n%,0]>'
}
else {
- define pos1 '<def[pos1].add[0,%n%,0]>'
}
- define direction 'Up'
- case 'd':
- if <def[pos1].y.is[OR_LESS].than[<def[pos2].y>]> {
- define pos2 '<def[pos2].sub[0,%n%,0]>'
}
else {
- define pos1 '<def[pos1].sub[0,%n%,0]>'
}
- 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 !<def[command].exists> {
- if !<proc[dWE_HasPerm_Command].context[inset|<player||server>]> {
- determine 'li@'
}
- define args "<c.args>"
- define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
}
- choose '%spaces%':
- case '0':
- determine 'inset [<&ns>] -h '
- case '1':
- define arg1 '<def[args].get[1]||>'
- if '%arg1%' matches 'number' || '%arg1%' == '-h' {
- determine '%arg1% '
}
else {
- determine '[<&ns>] '
}
- case '2':
- define arg1 '<def[args].get[1]||>'
- define arg2 '<def[args].get[2]||>'
- if '%arg1%' matches 'number' {
- determine '-h'
}
- if '%arg1%' == '-h' {
- determine '<t[<def[arg2].is[MATCHES].to[NUMBER]>]:%arg2% || <&lb><&ns><&rb>>'
}
else {
- determine 'li@'
}
- default:
- determine 'li@'
script:
# /dwe inset <number> -h
- if !<def[command].exists> {
- define command 'inset'
}
- define prerun 'b'
- inject s@dWE_Commands p:prerun
- define n '<def[args].filter[is[matches].to[number]].get[1]||0>'
- if <def[n].is[OR_LESS].than[0]||true> {
- 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 '<def[args].contains[-h].not||false>' {
- define cuboid 'cu@<def[cuboid].min.add[0,%n%,0]>|<def[cuboid].max.sub[0,%n%,0]>'
}
- define cuboid 'cu@<def[cuboid].min.add[%n%,0,%n%]>|<def[cuboid].max.sub[%n%,0,%n%]>'
- define pos1 '<def[cuboid].min>'
- define pos2 '<def[cuboid].max>'
- 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 !<def[command].exists> {
- if !<proc[dWE_HasPerm_Command].context[outset|<player||server>]> {
- determine 'li@'
}
- define args "<c.args>"
- define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
}
- choose '%spaces%':
- case '0':
- determine 'outset [<&ns>] -h '
- case '1':
- define arg1 '<def[args].get[1]||>'
- if '%arg1%' matches 'number' || '%arg1%' == '-h' {
- determine '%arg1% '
}
else {
- determine '[<&ns>] '
}
- case '2':
- define arg1 '<def[args].get[1]||>'
- define arg2 '<def[args].get[2]||>'
- if '%arg1%' matches 'number' {
- determine '-h'
}
- if '%arg1%' == '-h' {
- determine '<t[<def[arg2].is[MATCHES].to[NUMBER]>]:%arg2% || <&lb><&ns><&rb>>'
}
else {
- determine 'li@'
}
- default:
- determine 'li@'
script:
# /dwe outset <number> -h
- if !<def[command].exists> {
- define command 'outset'
}
- define prerun 'b'
- inject s@dWE_Commands p:prerun
- define n '<def[args].filter[is[matches].to[number]].get[1]||0>'
- if <def[n].is[OR_LESS].than[0]||true> {
- 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 '<def[args].contains[-h].not||false>' {
- define cuboid 'cu@<def[cuboid].min.sub[0,%n%,0]>|<def[cuboid].max.add[0,%n%,0]>'
}
- define cuboid 'cu@<def[cuboid].min.sub[%n%,0,%n%]>|<def[cuboid].max.add[%n%,0,%n%]>'
- define pos1 '<def[cuboid].min>'
- define pos2 '<def[cuboid].max>'
- 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,-<def[n]>'
s: '0,0,<def[n]>'
w: '-<def[n]>,0,0'
e: '<def[n]>,0,0'
d: '0,-<def[n]>,0'
u: '0,<def[n]>,0'
d:
n: 'North'
s: 'South'
w: 'West'
e: 'East'
d: 'Down'
u: 'Up'
tab complete:
- if !<def[command].exists> {
- if !<proc[dWE_HasPerm_Command].context[shift|<player||server>]> {
- determine 'li@'
}
- define args "<c.args>"
- define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
}
- choose '%spaces%':
- case '0':
- determine 'shift [<&ns>] '
- case '1':
- define arg1 '<def[args].get[1]||>'
- if '%arg1%' matches 'number' || '%arg1%' == 'v' {
- determine '%arg1% '
}
else {
- determine '[<&ns>] '
}
- case '2':
- define arg2 '<def[args].get[2]||>'
- define arg1 '<def[args].get[1]||>'
- 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 <amount> (n/s/e/w/u/d)
- if !<def[command].exists> {
- define command 'shift'
}
- define prerun 'b'
- inject s@dWE_Commands p:prerun
- define n '<def[args].get[1].escaped.round_up||0>'
- define d '<def[args].get[2].escaped||0>'
- if <def[n].is[OR_LESS].than[0]||true> {
- run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe shift <&6><&lb><&7>amount<&6><&rb> <&6>(<&7>direction<&6>)'
- queue clear
}
- if <li@n|e|s|w|u|d.contains[%d%].not||true> {
- define d '<proc[getFacing].context[<player.location.pitch.as_money>|<player.location.yaw.as_money>]>'
}
- if <li@n|e|s|w|u|d.contains[%d%].not||true> {
- run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>Unknown direction!'
- queue clear
}
- define direction '<script.yaml_key[d.%d%]>'
- repeat 2 {
- define pos%value% '<def[pos%value%].add[<parse:<script.yaml_key[math.%d%]>>]>'
}
- 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 !<def[command].exists> {
- if !<proc[dWE_HasPerm_Command].context[set|<player||server>]> {
- determine 'li@'
}
- define args "<c.args>"
- define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
}
- choose '%spaces%':
- case '0':
- determine 'set <<>material<>>'
- case '1':
- define arg1 '<def[args].get[1]||>'
- if '%arg1%' matches 'material' {
- determine '%arg1%'
}
else {
- define blocks '<server.list_materials.parse[as_material].filter[is_block].parse[bukkit_enum]>'
- determine '<def[blocks].filter[starts_with[%arg1%]]||%blocks%>'
}
- default:
- determine 'li@'
script:
# /dwe set <material>
- if !<def[command].exists> {
- define command 'set'
}
- define prerun 'c'
- inject s@dWE_Commands p:prerun
- define selection 'cu@<def[center].as_location.sub[%s%]>|<def[center].as_location.add[%s%]>'
- if '%o%' == '0' {
- define o '<def[selection].min>'
}
else {
- define selection 'cu@%o%|<def[o].as_location.add[<def[selection].size.div[2].sub[1,1,1]>].as_location>'
}
- define blocks '<def[selection].blocks>'
- inject s@dWE_Commands p:prerunB
- ~modifyblock <def[blocks]> <def[mats]> <def[pcts]> %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 !<def[command].exists> {
- if !<proc[dWE_HasPerm_Command].context[replace|<player||server>]> {
- determine 'li@'
}
- define args "<c.args>"
- define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
}
- choose '%spaces%':
- case '0':
- determine 'set <<>material<>>'
- case '1':
- define arg1 '<def[args].get[1]||>'
- if '%arg1%' matches 'material' {
- determine '%arg1%'
}
else {
- define blocks '<server.list_materials.parse[as_material].filter[is_block].parse[bukkit_enum]>'
- determine '<def[blocks].filter[starts_with[%arg1%]]||%blocks%>'
}
- default:
- determine 'li@'
script:
# /dwe replace <nawMaterials> <oldMaterial>
- if !<def[command].exists> {
- define command 'replace'
}
- define prerun 'c'
- inject s@dWE_Commands p:prerun
- define oldMats '<def[args].get[2].split_by[/]||null>'
- foreach %oldMats% {
- if '%value%' !matches material {
- run s@msgPrefixed 'def:dWE|<&c>SYNTAX ERROR<&co> <&6> Invalid Material <&c><&o>%value%'
- narrate '<&6><parse:<s@dWE_Commands_%command%.yaml_key[data.usage]||No usage info available!>>'
- queue clear
}
}
- define selection 'cu@<def[center].as_location.sub[%s%]>|<def[center].as_location.add[%s%]>'
- if '%o%' == '0' {
- define o '<def[selection].min>'
}
else {
- define selection 'cu@%o%|<def[o].as_location.add[<def[selection].size.div[2].sub[1,1,1]>].as_location>'
}
- define blocks '<def[selection].blocks[%oldMats%]>'
- if <def[blocks].size> == '0' {
- run s@msgPrefixed 'def:dWE|<&c><&o><def[oldMats].formatted> <t[<def[oldMats].size.is[more].than[1]>]:are||is> not within your selection.'
- queue clear
}
- inject s@dWE_Commands p:prerunB
- ~modifyblock <def[blocks]> <def[mats]> <def[pcts]> %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 !<def[command].exists> {
- define command 'sphere'
}
- define prerun 'c'
- inject s@dWE_Commands p:prerun
- define s '<def[s].as_location.add[0.5,0.5,0.5]>'
- define ellipsoid 'ellipsoid@<def[center].replace[l@]>,<def[s].replace[l@]>'
- define selection 'cu@<def[center].as_location.sub[%s%]>|<def[center].as_location.add[%s%]>'
- if '%o%' == '0' {
- define o '<def[selection].min.simple>'
}
else {
- define selection 'cu@%o%|<def[o].as_location.add[<def[selection].size.div[2].sub[1,1,1]>].as_location>'
- define center '<def[selection].center.simple.as_location>'
- define ellipsoid 'ellipsoid@<def[center].replace[l@]>,<def[selection].size.div[2].replace[l@].split_by[,].get[1].to[3].separated_by[,]>'
}
- define blocks '<def[ellipsoid].blocks>'
- inject s@dWE_Commands p:prerunB
- ~modifyblock <def[blocks]> <def[mats]> <def[pcts]> %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 <x>,[<y>,<z>] <material>
# - if !<def[command].exists> {
# - define command 'cyl'
# }
# - define prerun 'c'
# - inject s@dWE_Commands p:prerun
# - define selection 'cu@<def[center].as_location.sub[%s%].add[1,1,1]>|<def[center].as_location.add[%s%]>'
# - if '%o%' == '0' {
# - define o '<def[selection].min>'
# }
# else {
# - define selection 'cu@%o%|<def[o].as_location.add[<def[selection].size.div[2].sub[1,1,1]>].as_location>'
# }
# - define location '<def[selection].center>'
# - narrate "%location%"
# - inject s@dWE_Commands p:prerunB
# - ~modifyblock <def[location]> <def[mats]> 'radius:<def[s].get[1]>' 'height:<def[s].get[2]>' 'depth:<def[s].get[3]>' <def[pcts]> %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 !<def[command].exists> {
- define command 'copy'
}
- define prerun 'b'
- inject s@dWE_Commands p:prerun
- define u '<player.uuid>'
- define t 'Clipboard'
- define o '<def[cuboid].min>'
- 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 !<def[command].exists> {
- 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 <def[args].filter[starts_with[-d]].is_empty.not||true> {
- ~modifyblock <def[cuboid].blocks> m@air delayed
}
else {
- ~modifyblock <def[cuboid].blocks> 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 <number>
- if !<def[command].exists> {
- 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 '<def[args].filter[is[matches].to[number]].get[1].abs.round||1>'
- define a '<t[<def[args].filter[starts_with[-a]].is_empty.not||true>]:noair||>'
- define d '<t[<def[args].filter[starts_with[-d]].is_empty.not||true>]:delayed||>'
- define p '<def[args].filter[starts_with[-p]].is_empty.not||false>'
- define o '<t[<def[args].filter[starts_with[-w]].is_empty.not||true>]:%pos1%||<t[<def[args].filter[starts_with[-l]].is_empty.not||true>]:<player.location.cursor_on[%pRange%].simple>||<player.location.simple>>>'
- define u '<player.uuid>'
- 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 !<def[command].exists> {
- 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 !<def[command].exists> {
- define command 'undo'
}
- define prerun 'a'
- inject s@dWE_Commands p:prerun
- define n '<def[args].filter[is[matches].to[number]].get[1]||1>'
- define a '<t[<def[args].filter[starts_with[-a]].is_empty.not||true>]:noair||>'
- define d '<t[<def[args].filter[starts_with[-d]].is_empty.not||true>]:delayed||>'
- define entry '<player.flag[dWE.History.Undo].as_list.last.before[/].add[1].sub[%n%].as_int||null>'
- define o '<player.flag[dWE.History.Undo].as_list.map_get[%entry%]||null>'
- define u '<player.uuid>'
- define t 'Undo'
- inject s@dWE_PS
- flag player 'dWE.History.Undo:<-:%entry%/<player.flag[dWE.History.Undo].map_get[%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 !<def[command].exists> {
- define command 'redo'
}
- define prerun 'a'
- inject s@dWE_Commands p:prerun
- define n '<def[args].filter[is[matches].to[number]].get[1]||1>'
- define a '<t[<def[args].filter[starts_with[-a]].is_empty.not||true>]:noair||>'
- define d '<t[<def[args].filter[starts_with[-d]].is_empty.not||true>]:delayed||>'
- define entry '<player.flag[dWE.History.Redo].as_list.last.before[/].add[1].sub[%n%].as_int||null>'
- define o '<player.flag[dWE.History.Redo].as_list.map_get[%entry%]||null>'
- define u '<player.uuid>'
- define t 'Redo'
- inject s@dWE_PS
- flag player 'dWE.History.Redo:<-:%entry%/<player.flag[dWE.History.Redo].map_get[%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 !<def[command].exists> {
- define command 'schem'
}
- define prerun 'b'
- inject s@dWE_Commands p:prerun
- define n '<def[args].filter[is[matches].to[number]].get[1]||1>'
- define p '<def[args].filter[starts_with[-p]].is_empty.not||false>'
- if '%p%' {
- define p 'public'
}
else {
- define pl 'li@'
- define rm 'li@'
- foreach '%args%' {
- define a '%value%'
- if <server.match_offline_player[%a%].name.is[==].to[%a%]||false> {
- define rm '<def[rm].include[%loop_index%]>'
- if '%pl%' !contains '%a%' {
- define pl '<def[pl].include[<server.match_offline_player[%a%]>]>'
}
}
}
- define args '<def[args].remove[<def[rm].separated_by[|]>]>'
- if <def[pl].is_empty> {
- define p '<player.uuid>'
}
else {
- if <player.is_op> || <player.permission[dwe.admin]||false> {
- define p '<def[pl].get[1].uuid>'
}
else {
- define p '<player.uuid>'
}
}
}
- define pRange '50'
- define a '<t[<def[args].filter[starts_with[-a]].is_empty.not||true>]:noair||>'
- define d '<t[<def[args].filter[starts_with[-d]].is_empty.not||true>]:delayed||>'
- define o '<t[<def[args].filter[starts_with[-w]].is_empty.not||true>]:%pos1%||<t[<def[args].filter[starts_with[-l]].is_empty.not||true>]:<player.location.cursor_on[%pRange%].simple>||<player.location.simple>>>'
- define args '<def[args].exclude[%n%|%p%|-p|-w|-l|-a|-d]>'
- define cmd '<def[args].get[1]||null>'
- define cmds '<script.yaml_key[data.args]>'
- if '%cmds%' !contains '%cmd%' {
- run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe schem <&lb><def[cmds].separated_by[/]><&rb> (-p)'
- queue clear
}
- choose '%cmd%':
- case 'list':
- define entries 'li@'
- define i '0'
- foreach '<server.list_files[schematics/dWE/saves/%p%].filter[ends_with[.schematic]]||li@>':
- define name '<def[value].before[.schematic]>'
- define v '<proc[dWE_SNV].context[%name%|%p%]>'
- define i '<def[i].add[1]>'
- choose '%v%':
- case '5':
- define entry '<proc[msgHint].context[<&7>%name%|.schem load <tern[<def[p].is[==].to[public]>]:-p %name%||%name%>|<&a>Click to load <&b>%name%]>'
- case '0':
- define entry '<proc[msgHint].context[<&f>%name%|.schem unload <tern[<def[p].is[==].to[public]>]:-p %name%||%name%>|<&7>Height<&co><&6.pad_right[4]><schematic[dWE_saves_%p%_%name%].height.as_int><&nl><&7>Length<&co><&6.pad_right[4]><schematic[dWE_saves_%p%_%name%].length.as_int><&nl><&7>Width<&co><&6.pad_right[4]><schematic[dWE_saves_%p%_%name%].width.as_int><&nl><&7>Total Size<&co><&6.pad_right[4]><schematic[dWE_saves_%p%_%name%].blocks><&nl><&nl><proc[msgCentered].context[30|<&a>Click to Unload]>]>'
- default:
- define entry '<proc[msgHover].context[<&8>%name%|<proc[msgCentered].context[20|<&c>This is invalid!]>]>'
- define entries '<def[entries].include[<&6><def[i].pad_left[2]>.<&sp>%entry%]>'
- if <def[entries].is_empty> {
- define entries '<def[entries].include[<&c>No schematics for you!]>'
}
- run s@msgBoxed instantly 'def:dwe|<proc[msgCommand].context[<&6>dWorldEditor|.help|<&a>Go back to main help]>|<&e><tern[<def[p].is[==].to[public]>]:Public||<def[p].as_player.name>> Schematic List|.schem <tern[<def[p].is[==].to[public]>]:list -p||list %p%>|<def[n]||1>|52|10|<def[entries].separated_by[|]||>'
- case 'load':
- define name '<def[args].get[2]||null>'
- define v '<proc[dWE_SNV].context[%name%|%p%]>'
- if '%v%' != '5' {
- run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%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 '<def[args].get[2]||null>'
- define v '<proc[dWE_SNV].context[%name%|%p%]>'
- if '%v%' != '0' {
- run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%name%'
- queue clear
}
- schematic unload 'name:dWE_saves_%p%_%name%'
- run s@msgPrefixed 'def:dWE|Unloaded %name%'
- case 'save':
- define name '<def[args].get[2]||null>'
- define v '<proc[dWE_SNV].context[%name%|%p%]>'
- if 'li@3|4' !contains '%v%' {
- run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%name%'
- queue clear
}
- schematic create 'name:dWE_saves_%p%_%name%' '<def[cuboid].min.simple>' '%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 '<def[args].get[2]||null>'
- define v '<proc[dWE_SNV].context[%name%|%p%]>'
- if '%v%' != '5' {
- run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%name%'
- queue clear
}
- adjust server 'delete_file:schematics/dWE/saves/%p%/%name%.schematic'
- run s@msgPrefixed 'def:dWE|Deleted %name%'
- case 'copy':
- define name '<def[args].get[2]||null>'
- define v '<proc[dWE_SNV].context[%name%|%p%]>'
- 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%|<player>|%name%'
- queue clear
}
- define copy '<def[args].get[3]||null>'
- define v '<proc[dWE_SNV].context[%copy%|%p%]>'
- if 'li@3|4' !contains '%v%' {
- schematic unload 'name:dWE_saves_%p%_%name%'
- run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%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 '<def[args].get[2]||null>'
- define v '<proc[dWE_SNV].context[%name%|%p%]>'
- 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%|<player>|%name%'
- queue clear
}
- define copy '<def[args].get[3]||null>'
- define v '<proc[dWE_SNV].context[%copy%|%p%]>'
- if 'li@3|4' !contains '%v%' {
- schematic unload 'name:dWE_saves_%p%_%name%'
- run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%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 '<def[args].get[2]||null>'
- define v '<proc[dWE_SNV].context[%name%|%p%]>'
- if '%v%' != '0' {
- run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%name%'
- queue clear
}
- define cuboid '<schematic[dWE_saves_%p%_%name%].cuboid[%o%]>'
- if !<proc[dWE_dRegionCheck].context[<def[cuboid].min>|<def[cuboid].max>]> {
- queue clear
}
# Save the existing area for undo history
- define u '<player.uuid>'
- 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 '<def[args].get[2]||null>'
- define v '<proc[dWE_SNV].context[%name%|%p%]>'
- define item '<player.item_in_hand.simple>'
- if <player.item_in_hand.material.is_block> {
- run instantly delay:1t 's@dWE_Error' 'def:bind|1|<player>|<player.item_in_hand.material>'
}
- 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%|<player>|%name%'
- queue clear
}
- define lore 'li@dWorldEditor Schematic|%name%|<&sp>|Length<&co>|Width<&co>|Height<&co>|Size<&co>'
- inventory set 'd:<player.inventory>' '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:<player.inventory.find[<player.item_in_hand>]>'
#
#
# 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: <proc[dWE_HasPerm_Command].context[command|player]>
type: procedure
speed: 0
debug: false
definitions: command|player
script:
- if %player% == 'server' || <def[player].is_op> || <def[player].permission[dwe.admin]||false> {
- determine true
}
- define perms "<s@dWE_Commands_%command%.yaml_key[data.permissions]||li@>"
- if <def[perms].is_empty> {
- determine true
}
- foreach %perms% {
- define perm '<parse:%value%>'
- if <def[player].permission[dwe.%perm%]> {
- determine true
}
}
- determine false
#
#--------------------------------------
#
# getFacing Procedure script
# - Returns the cardinal direction the player is facing
#
getFacing:
# Usage: <proc[getFacing].context[%pitch%|%yaw%]>
type: procedure
debug: false
definitions: pitch|yaw
script:
- if <def[pitch].is[OR_MORE].than[45]||false> determine d
else if <def[pitch].is[OR_LESS].than[-45]||false> determine u
else if <def[yaw].is[OR_MORE].than[337.5]||false> || <def[yaw].is[LESS].than[22.5]||false> determine s
else if <def[yaw].is[OR_MORE].than[292.5]||false> determine se
else if <def[yaw].is[OR_MORE].than[247.5]||false> determine e
else if <def[yaw].is[OR_MORE].than[202.5]||false> determine ne
else if <def[yaw].is[OR_MORE].than[157.5]||false> determine n
else if <def[yaw].is[OR_MORE].than[112.5]||false> determine nw
else if <def[yaw].is[OR_MORE].than[67.5]||false> determine w
else if <def[yaw].is[OR_MORE].than[22.5]||false> 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 '<script.yaml_key[limits.%t%]>'
- if '%n%' > '%limit%' {
- run instantly delay:1t s@dWE_Error 'def:history.%t%|2|<player>|%limit%'
- queue clear
}
- define ct '<player.flag[dWE.History.%t%].as_list.size||0>'
- if '%n%' > '%ct%' {
- run instantly delay:1t s@dWE_Error 'def:history.%t%|<tern[<def[ct].is[==].to[0]>]:0||1>|<player>|%ct%'
- queue clear
}
- define entry '<player.flag[dWE.History.%t%].as_list.last.before[/].add[1].sub[%n%].as_int||null>'
- if '%entry%' == 'null' {
- run instantly delay:1t s@dWE_Error 'def:history.generic|0|<player>|%t%|%entry%'
- queue clear
}
- define schem 'dWE_%t%_%u%_%entry%'
- if !<schematic.list.contains[%schem%]> {
- if <server.has_file[schematics/dWE/%t%/%u%/%entry%.schematic]> {
- schematic load 'name:%schem%' 'filename:dWE/%t%/%u%/%entry%'
}
else {
- run instantly delay:1t s@dWE_Error 'def:history.generic|0|<player>|%t%|%entry%'
- flag player 'dWE.History.%t%:<-:%entry%/<player.flag[dWE.History.%t%].map_get[%entry%]>'
- queue clear
}
}
- define cuboid '<schematic[%schem%].cuboid[%o%]>'
- if !<proc[dWE_dRegionCheck].context[<def[cuboid].min>|<def[cuboid].max>]> {
- schematic unload 'name:%schem%'
- queue clear
}
# Save the existing area for undo history
- define t '<tern[<def[t].is[==].to[Undo]>]: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 '<script.yaml_key[limits.%t%]>'
- define last '<server.list_files[schematics/dWE/%t%/%u%].parse[before[.schematic]].numerical.last||0>'
- define new '<def[last].add[1].as_int>'
- 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 '<def[new].sub[%limit%]>'
- define on 'dWE_%t%_%u%_%old%'
- define of 'dWE/%t%/%u%/%old%'
- if <schematic.list.contains[%on%]> {
- schematic unload 'name:%on%'
}
- if <server.has_file[schematics/%of%.schematic]> {
- adjust server 'delete_file:schematics/%of%.schematic'
}
- flag player 'dWE.History.%t%:<-:%old%/<player.flag[dWE.History.%t%].map_get[%old%]>'
}
- flag player 'dWE.History.%t%:->:%new%/%o%'
#
# END dWE_ISN
#--------------------------------------
#
# Validate Schematic Names
#
dWE_SNV:
# Usage: <proc[dWE_SNV].context[%name%|%player%]>
type: procedure
debug: false
definitions: n|p
script:
- if '%n%' == 'null' {
- determine 1
}
- if '<def[n].matches[^[a-zA-Z0-9-_]+$].not>' {
- determine 2
}
- if !<server.has_file[schematics/dWE/saves/%p%/%n%.schematic]> {
- if '%p%' == 'public' {
- determine 3
}
else {
- determine 4
}
}
- if !<schematic[dWE_saves_%p%_%n%].exists> {
- determine 5
}
- determine 0
#
# END dWE_Validate_World
#--------------------------------------
#
# selectionSize Procedure script
# - Returns the size of the players selection
#
selectionSize:
# Usage: <proc[selectionSize].context[%pos1%|%pos2%]>
type: procedure
debug: false
definitions: pos1|pos2
script:
- define x '<def[pos1].as_location.x.sub[<def[pos2].as_location.x||0>].abs.add[1]||1>'
- define y '<def[pos1].as_location.y.sub[<def[pos2].as_location.y||0>].abs.add[1]||1>'
- define z '<def[pos1].as_location.z.sub[<def[pos2].as_location.z||0>].abs.add[1]||1>'
- determine '<def[x].mul[%y%].mul[%z%].as_int||0>'
#
# END dWE_selectionSize
#--------------------------------------
#
# selectionSize Procedure script
# - Returns the size of the players selection
#
dWE_dRegionCheck:
# Usage: <proc[dWE_dRegionCheck].context[%pos1%|%pos2%]>
type: procedure
debug: false
definitions: pos1|pos2
script:
- if !<server.list_scripts.filter[starts_with[s@dRegions]].is_empty> {
- if <proc[dRegions_RegionOverlaps].context[<cu@%pos1%|%pos2%.replace[cu@].as_list.separated_by[/]>|<cu@%pos1%|%pos2%.center.world.name>|<player>]> {
- if !<player.permission[dRegions.admin]||<player.is_op||false>> {
- determine false
}
}
}
- determine true
#
# END dWE_dRegionCheck
#---------------------------------------
#
# dWorldEditor Error Messages
#
dWE_Error:
type: task
debug: false
msgs:
schem_name:
0:
- '<&a><&o><def[4]><&a> is currently loaded.'
- '<&a>Maybe you want to <proc[msgHint].context[<&b>unload|.schem unload <def[4]>|<&c>Click to unload <def[4]>]> <&a>it?'
1:
- '<&c>You didn<&sq>t enter a schematic name.'
- '<&a>Maybe you want to see the <proc[msgCommand].context[<&b>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><def[4]> <&c>does not exist!'
- '<&a>Maybe you want to see the <proc[msgCommand].context[<&b>list|.schem list -p|<&c>Click to list public schematics]> <&a>of schematics?'
4:
- '<&c><&o><def[4]> <&c>does not exist!'
- '<&a>Maybe you want to see the <proc[msgCommand].context[<&b>list|.schem list|<&c>Click to list schematics]> <&a>of schematics?'
5:
- '<&c><&o><def[4]> <&c>is not loaded!'
- '<&a>Maybe you want to <proc[msgHint].context[<&b>load|.schem load <def[4]>|<&c>Click to load <def[4]>]> <&a>it?'
bind:
1:
- '<&c>Can not bind to <&o><def[4]><&c>!'
- '<&a>Try something that isn<&sq>t a placeable block.'
history:
generic:
0:
- '<&c><def[5]> does not exist in <def[4]> history!'
undo:
0:
- '<&c>Nothing left to Undo!'
1:
- '<&c>There are only <def[4]> entries to undo.'
2:
- '<&c>Undo history can only have <def[4]> entries.'
redo:
0:
- '<&c>Nothing left to Redo!'
1:
- '<&c>There are only <def[4]> entries to redo.'
2:
- '<&c>Redo history can only have <def[4]> entries.'
clipboard:
0:
- '<&c>Your Clipboard is empty!'
1:
- '<&c>You only have <def[4]> entries in your clipboard.'
2:
- '<&c>Clipboard history can only have <def[4]> entries.'
script:
- if '%3%' == 'server' {
- announce to_console '<&4><&lb><&6>dWE<&4><&rb> <script.yaml_key[msgs.%1%.%2%].get[1]>'
}
else {
- define prefix '<proc[msgCommand].context[<&4><&lb><&6>dWE<&4><&rb>|.help|<&6> dWE<&nl> <&nl><&d>Click for help]> '
- foreach '<script.yaml_key[msgs.%1%.%2%]>' {
- narrate "%prefix%<parse:<def[value]>>"
}
}
#
# 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
#--------------------------------------