dRegions_Events: type: world debug: false events: on player clicks block with i@dRegions_Tool: - determine passively CANCELLED - if ! { - take i@dRegions_Tool - run s@dRegions_Msg 'def:<&4><&l>ERROR<&co><&r> <&a>You should not have this!' instantly - queue stop } - define pos ']:POS1||POS2>' - run s@dRegions_Msg 'def:<&a>Set %pos% to ' - flag player dRegionTool%pos%: dRegions_Msg: type: item material: i@human_skull display name: "<&4>[<&6>dRegions<&4>]" lore: - <&5>Click for Info script: - ^define text '<&4>[<&6>dRegions<&4>] <&co>' - ^define hover '{}' - ^define click '/dregions' - ^define button "text:'%text%',clickEvent:{action:run_command,value:'%click%'},hoverEvent:{action:show_item,value:'%hover%'}" - ^define spacer "text:' '" - ^define msg "text:'%1%'" - ^execute as_server "tellraw {text:'',extra:[{%button%},{%spacer%},{%msg%}]}" dRegions_Tool: type: item debug: false material: m@wood_axe display name: dRegion Selector lore: - <&7><&o>Left<&7> click to set pos1 - <&7><&o>Right<&7> click to set pos2 dWE_Commands: type: command debug: false name: dwe description: Denizen World Editor usage: /dwe aliases: '' allowed help: - determine true script: - define arg1 '' - define args 'li@help|tool|expand|contract|inset|outset|outline|set|undo' - if ! inject locally help else inject locally %arg1% # # END dWE Command Script Basics #-------------------------------------- # # dWE Command Arguments # # Each of these subscripts is an argument for the root command. # help: - if inject locally msgsHelpAdmin instantly else inject locally msgsHelpUser instantly - define footerText '<&f><&sp><&sp>Authors<&co> <&7>|Anthony| <&7>calico-kid' - inject locally msgsFooter instantly - queue stop tool: - if { - give i@dRestaurantTool - run s@dRegions_Msg 'def:<&a>Right click to select pos1' - run s@dRegions_Msg 'def:<&a>Left click to select pos2' - queue stop } outline: - define POS1 '' - define POS2 '' - if run s@dRegions_Msg 'def:<&c>Must select corner 1 with left-click.' else if run s@dRegions_Msg 'def:Must select corner 2 with right-click.' else showfake m@wool to: d:10s set: # Need config options for maxblocks to change # Need config option for undo history size - define material '' - define POS1 '' - define POS2 '' - if %material% == null || %material% !matches material run s@dRegions_Msg 'def:<&c>Must specify a valid material.' else if run s@dRegions_Msg 'def:<&c>Must select corner 1 with left-click.' else if run s@dRegions_Msg 'def:Must select corner 2 with right-click.' else { - define blocks - define undoMaterials - modifyblock %blocks% %material% - flag player 'dWE_UndoHistory:->:set_blocks;;%undoMaterials%' } undo: - define last_action '' - if run s@dRegions_Msg 'def:<&6>Nothing to undo!' else { - inject locally 'p:undo_' - flag player 'dWE_UndoHistory:<-:%last_action%' } undo_set_blocks: - define cuboid '' - define materials '' - modifyblock %cuboid% %materials% - run s@dRegions_Msg 'def:<&a>Undo complete!' # # END dWE Command Arguments #-------------------------------------- # # dWE Command Messages # # These are not complete! They are mostly just stubs till the rest is fleshed out! # msgsHeader: - narrate "<&5>|----------------------------------------|" - narrate "<&5>|<&sp><&sp><&sp><&6>dWorldEditor <&7>%msgsHeaderTitle%" # - narrate "<&5>|<&sp><&sp><&sp><&e>MineConomy <&f>Exclusive" - narrate "<&5>|<&f>" msgsFooter: - define anthony "text:'<&7>|Anthony|',clickEvent:{action:open_url,value:'http://mineconomy.org'},hoverEvent:{action:show_item,value:'{}'}" - define morphan "text:'<&7>Morphan1',clickEvent:{action:open_url,value:'http://google.com'},hoverEvent:{action:show_item,value:'{}'}" - define spacer "text:' '" - define prefix "text:'<&5>| <&f>Authors: '" - execute as_server "tellraw {text:'',extra:[{%prefix%},{%anthony%},{%spacer%},{%morphan%}]}" - narrate "<&d>|-----------S-c-r-o-l-l---U-p-------------|" msgsHelpAdmin: - define msgsHeaderTitle 'Admin Help' - inject locally msgsHeader instantly - narrate "<&5>|<&sp><&sp><&sp><&f>" - narrate "<&5>|<&sp><&sp><&f>" - narrate "<&5>|<&sp><&sp><&f>" - narrate "<&5>|<&sp><&sp><&f>" - narrate "<&5>|<&sp><&sp><&f>" - narrate "<&5>|<&sp><&sp><&f>" - narrate "<&5>|<&sp><&f>" msgsHelpUser: - define msgsHeaderTitle 'User Help' - inject locally msgsHeader instantly - narrate "<&5>|<&sp><&sp><&sp><&sp><&f>" - narrate "<&5>|<&sp><&sp><&f>" - narrate "<&5>|<&sp><&sp><&f>" - narrate "<&5>|<&sp><&f>" # # END dWE Command Messages #--------------------------------------