################################################################################
#
# d R e g i o n s
#
#
# Authors: |Anthony|
# Version: 0.40
# dScript Version: 0.9.8-DEV_b646
#
#
# Dependencies:
#
# - dWorldEditor
# - Integrates with region selection wand
# - https://github.com/AnthonyAMC/Public-Denizen-Scripts/blob/master/dWE/dWorldEditor.yml
#
# - MessageConstructorLibrary
# - Library for messaging system.
# - https://github.com/AnthonyAMC/Public-Denizen-Scripts/blob/master/MessageConstructors.yml
#
# - ConfigFileGenerator
# - Used to build default config files and data storage.
# - https://github.com/AnthonyAMC/Public-Denizen-Scripts/blob/master/ConfigFileGenerator.yml
#
# - Flags
# - All the flags for dRegions. It is bundled in the repo releases.
# - https://github.com/AnthonyAMC/Public-Denizen-Scripts/blob/master/dRegions/flags.yml
#
# - Commands
# - All the commands for dRegions. It is bundled in the repo releases.
# - https://github.com/AnthonyAMC/Public-Denizen-Scripts/blob/master/dRegions/commands.yml
#
# 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
#_______________________________________________________________________________
#
#--- About dRegions
#
# dRegions is an advanced region management and world protection system written
# with the Denizen Scripting Engine. Heavily inspired by WorldGuard, the goal is
# to have an extremely efficient events system supporting an exhaustive set of
# region flags and configuration options. dRegions offers an intuitive command
# interface and provides thorough TAB completion.
#
#
#--- Installation & Setup
#
# Install Flags, ConfigFileGenerator, dWorldEditor, and dRegions to your scripts
# folder and reload scripts. /denizen reload scripts
#
# All config and data storage files will be automatically generated in your
# Denizen plugin folder. /plugins/Denizen/dRegions
#
#
#--- Permissions & Commands
#
# Here's a list of all the permissions and commands with a brief description
# of each. More verbose usage info can be found in game. /drg help
#
# dRegions provides thorough TAB completion! Use this to your benefit!
#
# The permissions system isn't fully realized yet. Meanwhile, we have a list of
# generic permissions to get you by.
#
# Command Permission Description
#
# /drg help [arg/#] dregions.help Specify a page number or command arg
# /drg define dregions.define Define a region
# /drg redefine dregions.redefine Update region to new selection
# /drg claim dregions.claim Claim the selected region
# /drg select dregions.select Select a region by id
# /drg remove dregions.remove Remove a region
# /drg list dregions.list List regions
# /drg info dregions.info See info on a region
# /drg addowner dregions.addowner Add a player or perm group as a region owner
# /drg removeowner dregions.removeowner Remove a player or perm group from region owner
# /drg addmember dregions.addmember Add a player or perm group as a region member
# /drg removemember dregions.removemember Remove a player or perm group from region member
# /drg flag dregions.flag Set region flags
# /drg setpriority dregions.setpriority Set region priority
# /drg setparent dregions.setparent Set region parent
# /drg teleport dregions.teleport Teleport to region
# /drg reload dregions.reload Reload all config files
# /drg restart dregions.restart Restart dRegions for whatever reason
# dregions.admin Override permission for all things dRegions
#
# dregions.invincible Makes the player totally invincible
# dregions.invincible.<cause> Player can't be damaged by specific cause(s)
#
#--- Basic Usage Tutorial
#
# After you've gotten installed, setup, and permissions assigned (op-only mode
# is fine too), you will need to give yourself a region wand. /dwe wand
#
# Mark your region selection using the wand as directed.
#
# Define your region noting any owners (player or -g group) you want
# - /drg define myRegion notch herobrine -g members -g vip
#
# Your region is now protected!
#
# Set region priority
# - /drg setpriority myRegion 10
#
# Set any region flags you need
# - /drg flag myRegion greeting Hello <player.name>!
#
#--- TODO
#
# - Make sure players can't exit a vehicle if they do not have permission to
# get back into it.
# - Add vehicle-enter and vehicle-exit flags and respective list flags.
# - Add vehicle-placelist flag.
# - Make all minecarts work with entity-interactlist flag.
# - Make the player-damage flag cover the hurt command
# - Fix eating in regions with the hunger flag set
#
#
#
################################################################################
#
# dRegions Version
#
# Handles dRegions Versioning Checks
#
dRegions_Version:
type: version
author: Anthony
name: dRegions
version: 0.40
description: Denizen Region Management and Protection
id: 23
#
# END dRegions Version
#--------------------------------------
#
dRegions:
type: world
debug: false
events:
on server prestart:
- inject locally loadGlobalConfig
- run locally start instantly
- flag server 'dRegions.loadworlds:|:<server.list_worlds>'
on server start:
- foreach '<server.flag[dRegions.loadworlds].as_list>':
- define world '<def[value].name.to_lowercase>'
- inject locally loadWorldConfig instantly
- flag server 'dRegions.loadworlds:!'
on shutdown:
- define globalCache '<yaml[dRegions_global_config].read[config.clear_cache_on_restart]>'
- foreach <server.list_worlds.parse[name.to_lowercase]> {
- if %globalCache% || '<yaml[dRegions_%value%_config].read[config.clear_cache_on_restart]>' {
- if <server.has_file[dRegions/worlds/%value%/cache.yml]> {
- run instantly s@msgPrefixed 'dRegions|<&3>Removing %value% cache.yml'
- adjust server 'delete_file:dRegions/worlds/%value%/cache.yml'
}
}
else {
- yaml 'savefile:dRegions/worlds/%value%/cache.yml' 'id:dRegions_%value%_cache'
}
}
on world loads:
- if <context.world.name.starts_with[instancing/instances]> {
- queue clear
}
- define world '<c.world.name.to_lowercase>'
- inject locally loadWorldConfig instantly
on script reload:
- inject locally loadGlobalConfig
- run locally start instantly
- foreach '<server.list_worlds>':
- define world '<def[value].name.to_lowercase>'
- inject locally loadWorldConfig instantly
on player joins:
- flag <player> dRegions.cache:!
- flag <player> dRegions.rateLimit:!
on player respawns:
- if <player.has_flag[dRegions.Respawn]> {
- determine passively '<player.flag[dRegions.Respawn].as_location||<player.location>>'
- adjust <player> 'health:<player.health.max>'
- wait 10t
- flag <player> 'dRegions.Respawn:!'
}
on entity enters portal:
- define world '<c.location.world.name.to_lowercase>'
- define readPath 'portal.<tern[<c.entity.is_player>]:player||entity>-enter'
- inject s@dRegions p:event_PreProc_Config-NoTarget
on portal created:
- define world '<c.world.name.to_lowercase>'
- define readPath 'portal.create'
- inject s@dRegions p:event_PreProc_Config-NoTarget
on system time hourly:
- wait 1t
- if !<yaml[dRegions_global_config].read[config.stats.useStats]||true> {
- queue clear
}
- if <queue.list> !contains 'q@dRegions_UpdateCheck' {
- run locally delay:1t updateCheck 'id:dRegions_UpdateCheck'
}
- if <queue.list> !contains 'q@dRegions_SendMetrics' {
- run locally delay:1t sendMetrics 'id:dRegions_SendMetrics'
}
start:
- if <queue.list> !contains 'q@dRegions_UpdateCheck' {
- run locally delay:1t updateCheck 'id:dRegions_UpdateCheck'
}
- foreach '<server.list_flags[dRegions]>':
- flag server '%value%:!'
- define flags '<server.list_scripts.filter[starts_with[s@dRegions_Flag_]].parse[name.after[dRegions_Flag_].to_lowercase].alphanumeric||li@>'
- flag server 'dRegions.Flags:|:%flags%'
- if <yaml.list.contains[dRegions_eventmap]> {
- yaml unload 'id:dRegions_eventmap'
}
- yaml create 'id:dRegions_eventmap'
- foreach '%flags%':
- define flag '%value%'
- foreach '<s@dRegions_Flag_%flag%.yaml_key[event_hooks].as_list||li@none>':
- yaml set '%value%:->:<s@dRegions_Flag_%flag%.yaml_key[event_priority]||0>/%flag%' 'id:dRegions_eventmap'
- yaml set 'none:!' 'id:dRegions_eventmap'
- foreach '<yaml[dRegions_eventmap].list_keys[]>':
- define e '<yaml[dRegions_eventmap].read[%value%].as_list>'
- yaml set '%value%:!' 'id:dRegions_eventmap'
- yaml set '%value%:|:<def[e].alphanumeric.parse[after[/]]>' 'id:dRegions_eventmap'
- if <queue.exists[dRegions_saveCache]> {
- queue q@dRegions_saveCache stop
}
- run locally saveCache delay:5s id:dRegions_saveCache
updateCheck:
- ^if !<server.has_flag[dRegions.Version.Repo]> {
- ~webget "http://one.denizenscript.com/denizen/repo/version/<s@dRegions_Version.yaml_key[id]>" save:page
- ^flag server "dRegions.Version.Repo:<entry[page].result||unknown>" d:1h
}
- ^define repoVersion '<server.flag[dRegions.Version.Repo]||unknown>'
- ^define currentVersion '<s@dRegions_Version.yaml_key[version]>'
- ^if '%repoVersion%' == 'unknown' {
- run s@msgPrefixed instantly 'def:dRegions|<&7>Unable to check for update! <&7><&o>%currentVersion%<&7> is installed!'
}
else if '%repoVersion%' > '%currentVersion%' {
- run s@msgPrefixed instantly 'def:dRegions|<&7>Update from version <&o>%currentVersion%<&7> to <&o>%repoVersion%<&7>!'
}
else if '%repoVersion%' != '%currentVersion%' {
- run s@msgPrefixed instantly 'def:dRegions|<&7>What happened? You are on version <&o>%currentVersion%<&7> and the repo says <&o>%repoVersion%<&7>!'
}
sendMetrics:
# - run s@msgPrefixed 'def:dRegions|<&3>Sending usage metrics...'
- ~webget "http://morphanone.space/webizen.aspx/tracker?script=<s@dRegions_Version.yaml_key[id]>&version=<s@dRegions_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:dRegions|<&c>Metrics failed!'
}
loadGlobalConfig:
# Reloads the global config file and generates default files if they don't exist.
# Rewrites config file that does not match internal version number!
- run s@msgPrefixed instantly 'def:dRegions|<&3>Loading system config file...'
- define version '<s@dRegions_Configurations.yaml_key[config.version]>'
- define world 'global'
- define file 'config'
- define hasFile '<server.has_file[dRegions/config.yml]>'
- if %hasFile% {
- yaml 'load:dRegions/config.yml' 'id:dRegions_global_config'
- define isUpdate '<yaml[dRegions_global_config].read[config.version].is[!=].to[%version%]||false>'
}
else {
- define isUpdate 'false'
}
- if !%hasFile% || %isUpdate% {
- inject locally createConfigFile
- run s@msgPrefixed instantly 'def:dRegions|<&7><&o><t[%isUpdate%]:Updated||Created> <&f><&o>%world%<&7><&o> config file!'
}
- if <yaml.list.contains[dRegions_global_config]> {
- yaml unload 'id:dRegions_global_config'
}
- yaml 'load:dRegions/config.yml' 'id:dRegions_global_config'
loadWorldConfig:
- run s@msgPrefixed instantly 'def:dRegions|<&7>Preparing <&f><&o>%world%<&7> files...'
- define version '<s@dRegions_Configurations.yaml_key[config.version]>'
- foreach 'li@config|regions|inventories|cache':
- define this '%value%'
- define file 'worlds/%world%/%this%'
- define hasFile '<server.has_file[dRegions/worlds/%world%/%this%.yml]>'
- if %hasFile% {
- yaml 'load:dRegions/worlds/%world%/%this%.yml' 'id:dRegions_%world%_%this%'
- define isUpdate '<yaml[dRegions_%world%_%this%].read[%this%.version].is[!=].to[%version%]||false>'
}
else {
- define isUpdate 'false'
}
- if !%hasFile% || %isUpdate% {
- inject locally create%this%File
- run s@msgPrefixed instantly 'def:dRegions|<&7><&o><t[%isUpdate%]:Updated||Created> <&f><&o>%world%<&7><&o> %this% file!'
}
- if <yaml.list.contains[dRegions_%world%_%this%]> {
- yaml unload 'id:dRegions_%world%_%this%'
}
- yaml 'load:dRegions/worlds/%world%/%this%.yml' 'id:dRegions_%world%_%this%'
# Recreate notables if they don't exist for some reason
- define notables '<server.list_notables[cuboids]>'
- foreach '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__]||li@>':
- define region '%value%'
- if '%notables%' !contains 'cu@dregions_%world%_%region%' {
- note 'cu@<yaml[dRegions_%world%_regions].read[regions.%region%.min].as_location>|<yaml[dRegions_%world%_regions].read[regions.%region%.max].as_location>' 'as:dregions_%world%_%region%'
}
reloadYaml:
# A simpler reload
- run s@msgPrefixed instantly 'def:dRegions|<&7><&o>Reloading system config files...'
- if <yaml.list.contains[dRegions_global_config]> {
- yaml unload 'id:dRegions_global_config'
}
- yaml 'load:dRegions/config.yml' 'id:dRegions_global_config'
- foreach <server.list_worlds.parse[name.to_lowercase]> {
- define world '<def[value]>'
- foreach 'li@config|regions|inventories|cache' {
- if <yaml.list.contains[dRegions_%world%_%value%]> {
- yaml unload 'id:dRegions_%world%_%value%'
}
- yaml 'load:dRegions/worlds/%world%/%value%.yml' 'id:dRegions_%world%_%value%'
}
}
- run s@msgPrefixed instantly 'def:dRegions|<&7><&o>System config files reloaded!'
createConfigFile:
- define readID 'dRegions_Configurations'
- define writeID 'dRegions_%world%_config'
- if !<yaml.list.contains[%readID%]> {
- yaml fix_formatting 'load:<script.relative_filename>' 'id:%readID%'
}
- yaml create 'id:%writeID%'
- define readPath '%readID%.config'
- define writePath 'config'
- run s@ConfigFileGenerator def:%readID%|%writeID%|%readPath%|%writePath%|false|false|<def[isUpdate]||false> instantly
- yaml unload 'id:%readID%'
- yaml 'savefile:dRegions/%file%.yml' 'id:%writeID%'
createRegionsFile:
- define readID 'dRegions_Configurations'
- define writeID 'dRegions_%world%_regions'
- if !<yaml.list.contains[%readID%]> {
- yaml fix_formatting 'load:<script.relative_filename>' 'id:%readID%'
}
- yaml create 'id:%writeID%'
- define readPath '%readID%.regions.__global__'
- define writePath 'regions.<def[region]||__global__>'
- run s@ConfigFileGenerator def:%readID%|%writeID%|%readPath%|%writePath%|false|false|false instantly
- yaml unload 'id:%readID%'
- yaml 'savefile:dRegions/%file%.yml' 'id:%writeID%'
createInventoriesFile:
- define readID 'dRegions_Configurations'
- define writeID 'dRegions_%world%_inventories'
- if !<yaml.list.contains[%readID%]> {
- yaml fix_formatting 'load:<script.relative_filename>' 'id:%readID%'
}
- yaml create 'id:%writeID%'
- define readPath '%readID%.inventories'
- define writePath 'inventories'
- run s@ConfigFileGenerator def:%readID%|%writeID%|%readPath%|%writePath%|false|false|false instantly
- yaml unload 'id:%readID%'
- yaml 'savefile:dRegions/%file%.yml' 'id:%writeID%'
createRegionEntry:
- if !<yaml.list.contains[dRegions_%world%_regions]> {
- yaml 'load:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
}
- yaml set 'regions.%name%.type:cuboid' 'id:dRegions_%world%_regions'
- yaml set 'regions.%name%.min:<def[selectedCuboid].min.simple>' 'id:dRegions_%world%_regions'
- yaml set 'regions.%name%.max:<def[selectedCuboid].max.simple>' 'id:dRegions_%world%_regions'
- yaml set 'regions.%name%.priority:0' 'id:dRegions_%world%_regions'
- yaml set 'regions.%name%.flags:|:' 'id:dRegions_%world%_regions'
- yaml set 'regions.%name%.owners:|:' 'id:dRegions_%world%_regions'
- foreach <def[ownerGroups]||li@> {
- yaml set 'regions.%name%.owners.groups:->:%value%' 'id:dRegions_%world%_regions'
}
- foreach <def[ownerPlayers]||li@> {
- yaml set 'regions.%name%.owners.players:->:%value%' 'id:dRegions_%world%_regions'
}
- yaml set 'regions.%name%.members:|:' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- note cu@<def[selectedCuboid].min.simple>|<def[selectedCuboid].max.simple> 'as:dregions_%world%_%name%'
createCacheFile:
- define readID 'dRegions_Configurations'
- define writeID 'dRegions_%world%_cache'
- if !<yaml.list.contains[%readID%]> {
- yaml fix_formatting 'load:<script.relative_filename>' 'id:%readID%'
}
- yaml create 'id:%writeID%'
- define readPath '%readID%.cache'
- define writePath 'cache'
- run s@ConfigFileGenerator def:%readID%|%writeID%|%readPath%|%writePath%|false|false|<def[isReset].exists||false> instantly
- yaml unload 'id:%readID%'
- yaml 'savefile:dRegions/%file%.yml' 'id:%writeID%'
clearCache:
- ^define region '%1%'
- ^define world '%2%'
- ^define flag '%3%'
- ^define type '<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
- ^if '%type%' == 'list' {
- define type '<s@dRegions_Flag_%flag%.yaml_key[flag_parent].as_script.yaml_key[flag_type]>'
- define flag '<s@dRegions_Flag_%flag%.yaml_key[flag_parent].after_last[_]>'
}
- ^define children '<yaml[dRegions_%world%_regions].read[regions.%region%.children]||li@>'
- ^foreach '<def[children].include[%region%]>':
- yaml set 'cache.%type%.%value%.%flag%:!' 'id:dRegions_%world%_cache'
- if <def[flag].ends_with[-overRide]> {
- yaml set 'cache.%type%.%value%.<def[flag].before[-overRide]>:!' 'id:dRegions_%world%_cache'
}
else {
- yaml set 'cache.%type%.%value%.%flag%-overRide:!' 'id:dRegions_%world%_cache'
}
- ^yaml 'savefile:dRegions/worlds/%world%/cache.yml' 'id:dRegions_%world%_cache'
- ^if '%region%' == '__global__' {
- define plist '<def[world].as_world.players>'
}
else {
- define plist '<def[region].replace[regex:^].with[cu@dregions_%world%_].as_cuboid.list_players>'
}
- ^foreach '%plist%':
- flag %value% 'dRegions.%world%.%region%.%flag%:!'
- flag %value% 'dRegions.rateLimit.%flag%:!'
- if <def[flag].ends_with[-overRide]> {
- flag %value% 'dRegions.%world%.%region%.<def[flag].before[-overRide]>:!'
- flag %value% 'dRegions.rateLimit.<def[flag].before[-overRide]>:!'
}
else {
- flag %value% 'dRegions.%world%.%region%.%flag%-overRide:!'
- flag %value% 'dRegions.rateLimit.%flag%-overRide:!'
}
saveCache:
- while 'true':
- wait 5m
- foreach '<server.list_worlds.parse[name.to_lowercase]>':
- if !<yaml.list.contains[dRegions_%value%_cache]> {
- yaml 'load:dRegions/worlds/%value%/cache.yml' 'id:dRegions_%value%_cache'
}
- yaml 'savefile:dRegions/worlds/%value%/cache.yml' 'id:dRegions_%value%_cache'
# Event Preprocessors
#
# This pre-processor handles events in the global and world config files before
# any regions even get a chance. World configs are processed before global.
# This way worlds can deny events that global allows, but global has ultimate
# control for denying events. Denying an event takes precedence over allowing.
# Default is 'true' on most events for this reason.
#
# Events that take a block list are handled here as well. Blocklists can
# operate in whitelist or blacklist modes.
#
# Blacklist mode.
# When an event is set to 'false' and no blocks are specified in the
# blocklist, it will always cancel the event. If there are blocks specified,
# it will only cancel events involving those blocks listed.
#
# Whitelist mode.
# When an event is set to 'true' and no blocks are specified in the blocklist,
# it will always allow the event. If there are blocks specifed, it will only
# allow events involving those blocks listed.
#
event_PreProc_Config:
- define targetList '<yaml[dRegions_%world%_config].read[config.%readPath%-list]||li@>'
# - if '<t[<yaml[dRegions_%world%_config].read[config.%readPath%]||true>]:<def[targetList].is_empty.not.and[<def[targetList].contains[%target%].not>]>||<def[targetList].is_empty.or[<def[targetList].contains[%target%]>]>>' {
# - determine cancelled
# }
- if '<yaml[dRegions_%world%_config].read[config.%readPath%]||true>' {
- if '<def[targetList].is_empty.not>' && '%targetList%' !contains '%target%' {
- determine cancelled
}
}
else {
- if '<def[targetList].is_empty>' || '%targetList%' contains '%target%' {
- determine cancelled
}
}
- define targetList '<yaml[dRegions_global_config].read[config.%readPath%-list]||li@>'
# - if '<t[<yaml[dRegions_global_config].read[config.%readPath%]||true>]:<def[targetList].is_empty.not.and[<def[targetList].contains[%target%].not>]>||<def[targetList].is_empty.or[<def[targetList].contains[%target%]>]>>' {
# - determine cancelled
# }
- if '<yaml[dRegions_global_config].read[config.%readPath%]||true>' {
- if '<def[targetList].is_empty.not>' && '%targetList%' !contains '%target%' {
- determine cancelled
}
}
else {
- if '<def[targetList].is_empty>' || '%targetList%' contains '%target%' {
- determine cancelled
}
}
event_PreProc_Config-NoTarget:
- if <yaml[dRegions_%world%_config].read[config.%readPath%].not||false> || <yaml[dRegions_global_config].read[config.%readPath%].not||false> {
- determine cancelled
}
#
#
#
#
################################################################################
#
# Player/Entity Events
#
dRegions_Events_Player_Interact_Entity:
type: world
debug: false
eventHooks: player_interact_entity
events:
on player right clicks entity:
- if <c.entity.is_player> || <c.entity.is_npc> || <c.entity.entity_type> == item_frame {
- queue clear
}
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define object '<c.entity>'
- define target '<c.entity.entity_type>'
- define eLoc '<def[object].location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_interact_entity]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Interact_NPC:
type: world
debug: false
eventHooks: player_interact_npc
events:
on player right clicks npc:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define object '<c.entity>'
- define target '<c.entity.entity_type>'
- define eLoc '<def[object].location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_interact_npc]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Enters_Region:
type: world
debug: false
eventHooks: player_teleports_toRegion|player_enters_region
events:
on player enters notable cuboid:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- define overRide ''
}
- define player '<player>'
- define eLoc '<c.to>'
- define world '<def[eLoc].world.name>'
- define oldworld '<c.from.world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- define oldRegions 'li@<yaml[dRegions_%oldworld%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<c.from.cuboids.filter[starts_with[cu@dregions_%oldworld%]].parse[after[cu@dregions_%oldworld%_]]>':
- define oldRegions '%oldRegions%|<yaml[dRegions_%oldworld%_regions].read[regions.%value%.priority]||0>/%value%'
- define oldRegions '<def[oldRegions].alphanumeric.reverse.parse[after[/]]>'
# Ignore crossing into lower priority region and non-dRegion cuboids
- if '%world%_<def[orderedRegions].get[1]>' == '%oldworld%_<def[oldRegions].get[1]>' {
- queue clear
}
# Should we fire an event when the player exits the global region?
- if '<def[oldRegions].get[1]>' == '__global__' {
- if '<def[orderedRegions].get[1]>' != '__global__' {
- event 'player exits notable cuboid' 'player:%player%' 'context:cuboids|<c.from.cuboids.escaped>|from|<c.from>|to|<c.to>|cause|<c.cause>' save:exit
- if <entry[exit].determinations.get[1]||null> == cancelled {
- determine cancelled
}
}
}
- define events 'li@'
- if '<c.cause>' == 'TELEPORT' {
- define events '<def[events].include[<yaml[dRegions_eventmap].read[player_teleports_toRegion]||li@>]>'
}
- define events '<def[events].include[<yaml[dRegions_eventmap].read[player_enters_region]||li@>]>'
- foreach '%events%':
- define flag '%value%'
- if <def[player].has_flag[dRegions.%world%.<def[orderedRegions].get[1]>.%flag%-override]> {
- define overRide ''
}
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
- define overRide:!
- event 'player entered dregion' 'player:%player%' 'context:orderedregions|<def[orderedRegions].separated_by[/]>|to|<c.to>|from|<c.from>'
dRegions_Events_Player_Entered_dRegion:
type: world
debug: false
eventHooks: player_entered_dregion
events:
on player entered dregion:
- define player '<player>'
- define eLoc '<c.to>'
- define world '<def[eLoc].world.name>'
- define orderedRegions '<c.orderedregions.split_by[/]>'
- define noCancel ''
- define isEnter 'true'
- foreach '<yaml[dRegions_eventmap].read[player_entered_dregion]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Exits_Region:
type: world
debug: false
eventHooks: player_teleports_fromRegion|player_exits_region
events:
on player exits notable cuboid:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- define overRide ''
}
- define player '<player>'
- define eLoc '<c.from>'
- define world '<def[eLoc].world.name>'
- define newworld '<c.to.world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- define newRegions 'li@<yaml[dRegions_%newworld%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<c.to.cuboids.filter[starts_with[cu@dregions_%newworld%]].parse[after[cu@dregions_%newworld%_]]>':
- define newRegions '%newRegions%|<yaml[dRegions_%newworld%_regions].read[regions.%value%.priority]||0>/%value%'
- define newRegions '<def[newRegions].alphanumeric.reverse.parse[after[/]]>'
# Ignore crossing into lower priority region and non-dRegion cuboids
- if '%world%_<def[orderedRegions].get[1]>' == '%newworld%_<def[newRegions].get[1]>' {
- queue clear
}
- define events 'li@'
- if '<c.cause>' == 'TELEPORT' {
- define events '<def[events].include[<yaml[dRegions_eventmap].read[player_teleports_fromRegion]||li@>]>'
}
- define events '<def[events].include[<yaml[dRegions_eventmap].read[player_exits_region]||li@>]>'
- foreach '%events%':
- define flag '%value%'
- if <def[player].has_flag[dRegions.%world%.<def[orderedRegions].get[1]>.%flag%-overRide]> {
- define overRide ''
}
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
- define overRide:!
# Should we fire an event when the player enters the global region?
- if '<def[newRegions].get[1]>' == '__global__' {
- if '<def[orderedRegions].get[1]>' != '__global__' {
- event 'player enters notable cuboid' 'player:%player%' 'context:cuboids|<c.to.cuboids.escaped>|from|<c.from>|to|<c.to>|cause|<c.cause>' save:enter
- if <entry[enter].determinations.get[1]||null> == cancelled {
- determine cancelled
}
}
}
- event 'player exited dregion' 'player:%player%' 'context:orderedregions|<def[orderedRegions].separated_by[/]>|to|<c.to>|from|<c.from>'
dRegions_Events_Player_Exited_dRegion:
type: world
debug: false
eventHooks: player_exited_dregion
events:
on player exited dregion:
- define player '<player>'
- define eLoc '<c.from>'
- define world '<def[eLoc].world.name>'
- define orderedRegions '<c.orderedregions.split_by[/]>'
- define noCancel ''
- define isEnter 'false'
- foreach '<yaml[dRegions_eventmap].read[player_exited_dregion]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Place_Block:
type: world
debug: false
eventHooks: player_place_block
events:
on player places block:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define target '<c.material.bukkit_enum>'
- define eLoc '<context.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_place_block]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Break_Block:
type: world
debug: false
eventHooks: player_break_block
events:
on player breaks block:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define target '<c.material.bukkit_enum>'
- define eLoc '<context.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_break_block]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Right_Click:
type: world
debug: false
# eventHooks: These are mapped in s@dRegions_Map_Interactions
events:
on player right clicks:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define target '<c.location.material.bukkit_enum||air>'
- define item '<c.item.material.bukkit_enum||air>'
- define eventObj '<s@dRegions_Map_Interactions.yaml_key[block_withItem.%target%]||li@>'
# - define event '<t[<def[eventObj].after[/].as_list.contains[%item%]||false>]:<def[eventObj].before[/]>||<s@dRegions_Map_Interactions.yaml_key[block.%target%]||null>>'
- if '<def[eventObj].after[/].as_list>' contains '%item%' {
- define event '<def[eventObj].before[/]>'
}
else {
- define event '<s@dRegions_Map_Interactions.yaml_key[block.%target%]||null>'
}
- if '%event%' == 'null' {
- queue clear
}
- define player '<player>'
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[%event%]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Damaged:
type: world
debug: false
eventHooks: player_damaged
events:
on player damaged:
- if ( <player.permission[dregions.invincible]||false> || <player.permission[dregions.invincible.<c.cause>]||false> ) && !<player.is_op> {
- adjust <player> 'fire_time:0'
- determine cancelled
}
- if '<c.cause>' == 'FALL' && <player.has_flag[dRegions.fly.noFallDamage]> {
- flag <player> 'dRegions.fly.noFallDamage:!'
- determine cancelled
}
- define player '<c.entity>'
- define target '<c.cause>'
- define eLoc '<def[player].location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_damaged]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Chat:
type: world
debug: false
eventHooks: player_chats
events:
on player chats:
- if <player.permission[dregions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define eLoc '<def[player].location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_chats]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Break_Vehicle:
type: world
debug: false
eventHooks: player_break_vehicle
events:
on player destroys vehicle:
- if <player.permission[dregions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define object '<c.vehicle>'
- define eLoc '<def[object].location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_break_vehicle]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Place_Boat:
type: world
debug: false
eventHooks: player_place_vehicle
events:
on player right clicks block with boat:
- if <player.permission[dregions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define object '<c.vehicle>'
- define eLoc '<def[object].location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_place_vehicle]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Stands_On:
type: world
debug: false
eventHooks: player_interact_switches
events:
on player stands on:
- if <player.permission[dregions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define target '<c.location.material.bukkit_enum>'
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_interact_switches]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Throws_Potion:
type: world
debug: false
eventHooks: player_throw_potion
events:
on player right clicks with potion:
- if !<c.item.potion_effect.is_splash||false> || <player.permission[dregions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_throw_potion]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Drinks_Potion:
type: world
debug: false
eventHooks: player_throw_potion
events:
on player consumes potion:
- if <player.permission[dregions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define eLoc '<def[player].location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_drink_potion]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Place_Armorstand:
type: world
debug: false
eventHooks: player_place_armorstand
events:
on player right clicks block with armor_stand:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define target '<c.item.material.bukkit_enum>'
- define eLoc '<context.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_place_armorstand]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Use_Monsteregg:
type: world
debug: false
eventHooks: player_use_spawnegg
events:
on player right clicks block with monster_egg:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define target '<c.item.spawn_egg_entity>'
- define eLoc '<context.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_use_spawnegg]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Throw_Egg:
type: world
debug: false
eventHooks: player_throw_hatchingegg|player_throw_egg
events:
on player throws egg:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define object '<c.egg>'
- define eLoc '<def[object].location>'
- define world '<def[eLoc].world.name>'
- if <c.is_hatching> {
- define type 'hatchingegg'
}
else {
- define type 'egg'
}
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
# - foreach '<yaml[dRegions_eventmap].read[player_throw_<t[<context.is_hatching>]:hatchingegg||egg>]||li@>':
- foreach '<yaml[dRegions_eventmap].read[player_throw_%type%]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Enters_Bed:
type: world
debug: false
eventHooks: player_enters_bed
events:
on player enters bed:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define eLoc '<context.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_enters_bed]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Empties_Bucket:
type: world
debug: false
eventHooks: player_empty_bucket|build
events:
on player empties bucket:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define eLoc '<context.relative>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_empty_bucket]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Fills_Bucket:
type: world
debug: false
eventHooks: player_fill_bucket|build
events:
on player fills bucket:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_fill_bucket]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Drops_Item:
type: world
debug: false
eventHooks: player_drops_item
events:
on player drops item:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define object '<c.entity>'
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_drops_item]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Pickup_Item:
type: world
debug: false
eventHooks: player_pickup_item
events:
on player picks up item:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define object '<c.entity>'
- define eLoc '<def[player].location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_pickup_item]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Place_Hanging:
type: world
debug: false
eventHooks: player_place_hanging
events:
on player places hanging:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define object '<c.hanging>'
- define eLoc '<c.hanging.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_place_hanging]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Break_Hanging:
type: world
debug: false
eventHooks: player_break_hanging
events:
on player breaks hanging:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define object '<c.entity>'
- define object '<c.hanging>'
- define eLoc '<c.hanging.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_break_hanging]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Interact_Armorstand:
type: world
debug: false
eventHooks: player_interact_armorstand
events:
on player right clicks at armor_stand:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define object '<c.entity>'
- define eLoc '<c.entity.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_interact_armorstand]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Interact_Itemframe:
type: world
debug: false
eventHooks: player_interact_itemframe
events:
on player right clicks item_frame:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define object '<c.entity>'
- define eLoc '<c.entity.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_interact_itemframe]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Extinguish_BlockFire:
type: world
debug: false
eventHooks: player_extinguish_blockfire
events:
on player left clicks block:
- if <c.relative.material.name> != fire {
- queue clear
}
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define eLoc '<c.relative>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_extinguish_blockfire]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Use_Bonemeal:
type: world
debug: false
eventHooks: player_use_bonemeal
events:
on player clicks block with bone_meal:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define eLoc '<c.relative>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_use_bonemeal]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_Changes_Foodlevel:
type: world
debug: false
eventHooks: player_change_foodlevel
events:
on player changes food level:
- if <c.food> >= <player.food_level> queue clear
- define player '<player>'
- define eLoc '<def[player].location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[player_change_foodlevel]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Player_ChangeWorld:
# This is here to catch teleports between global regions as there's no other event for it.
type: world
debug: false
eventHooks: player_changeworld
events:
on player teleports:
- if '<c.origin.world>' == '<c.destination.world>' || '<c.cause>' == 'UNKNOWN' || <player.has_flag[dRegions.rateLimit.changeworld]> || ( !<c.origin.cuboids.is_empty> || !<c.destination.cuboids.is_empty> ) {
- queue clear
}
- flag <player> 'dRegions.rateLimit.changeworld' d:10t
- event 'player exits notable cuboid' 'context:cuboids|li&at|from|<c.origin>|to|<c.destination>|cause|teleport' save:exit
- if <entry[exit].determinations.get[1]||null> == cancelled {
- determine cancelled
}
- flag <player> dRegions.cache:!
- flag <player> dRegions.rateLimit:!
- event 'player enters notable cuboid' 'context:cuboids|li&at|from|<c.origin>|to|<c.destination>|cause|teleport' save:enter
- if <entry[enter].determinations.get[1]||null> == cancelled {
- determine cancelled
}
dRegions_Events_Player_Teleports:
# %cause% can be any of the known bukkit causes. Be sure to remove the '_'.
# CHORUSFRUIT|COMMAND|ENDGATEWAY|ENDPORTAL|ENDERPEARL|NETHERPORTAL|PLUGIN|SPECTATE|UNKNOWN
type: world
debug: false
eventHooks: player_teleports|player_teleport_via_%cause%
events:
on player teleports:
- if <player.permission[dRegions.admin]||false> || <player.is_op> {
- queue clear
}
- define player '<player>'
- define eLoc '<def[player].location>'
- define world '<def[eLoc].world.name>'
- define cuboids '<c.origin.cuboids.include[<c.destination.cuboids>].deduplicate>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[cuboids].filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- define events '<yaml[dRegions_eventmap].read[player_teleports]||li@>'
- define events '<def[events].include[<yaml[dRegions_eventmap].read[player_teleport_via_<c.cause.replace[_]>]||li@>]>'
- foreach '%events%':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Entity_Spawn:
type: world
debug: false
eventHooks: entity_spawn
events:
on entity spawns:
- define object '<c.entity>'
- define target '<c.entity.entity_type>'
- define eLoc '<c.entity.location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[entity_spawn]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Entity_Damage_Entity:
type: world
debug: false
eventHooks: player_damage_player|player_damage_entity|player_damage_npc|player_damage_armorstand|player_damage_itemframe|entity_damage_entity|entity_damage_player|entity_damage_npc|entity_damage_armorstand|entity_damage_itemframe|npc_damage_npc|npc_damage_player|npc_damage_entity|npc_damage_itemframe|npc_damage_armorstand
events:
on entity damages entity:
- if !<c.entity.is_spawned> || !<c.damager.is_spawned> {
- queue clear
}
# - define atype '<t[<c.damager.is_npc>]:npc||<c.damager.prefix>>'
- if <c.damager.is_npc> {
- define atype 'npc'
}
else {
- define atype '<c.damager.prefix>'
}
# - define dtype '<t[<c.entity.is_npc>]:npc||<t[<li@armor_stand|item_frame.contains[<c.entity.entity_type>]>]:<c.entity.entity_type.replace[_]>||<c.entity.prefix>>>'
- if <c.entity.is_npc> {
- define dtype 'npc'
}
else if <c.entity.entity_type> == armor_stand {
- define dtype 'armorstand'
}
else if <c.entity.entity_type> == item_frame {
- define dtype 'itemframe'
}
else {
- define dtype '<c.entity.prefix>'
}
- define attacker '<c.damager>'
- define defender '<c.entity>'
- define world '<c.damager.world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[attacker].location.cuboids.include[<def[defender].location.cuboids>].deduplicate.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[%atype%_damage_%dtype%]||li@>':
- define flag '%value%'
- define object '<def[<s@dRegions_Flag_%flag%.yaml_key[event_target]>]>'
- define player '<def[<s@dRegions_Flag_%flag%.yaml_key[event_player]||object>]>'
- define target '<def[object].entity_type>'
- define eLoc '<def[object].location>'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Entity_Target_Entity:
type: world
debug: false
eventHooks: entity_target_entity|entity_target_player|entity_target_npc|entity_target_armorstand|entity_target_itemframe|npc_target_npc|npc_target_player|npc_target_entity|npc_target_itemframe|npc_target_armorstand
events:
on entity targets entity:
# - define atype '<t[<c.entity.is_npc>]:npc||<c.entity.prefix>>'
- if !<c.entity.is_spawned> || !<c.target.is_spawned> {
- queue clear
}
- if <c.entity.is_npc> {
- define atype 'npc'
}
else {
- define atype '<c.entity.prefix>'
}
# - define dtype '<t[<c.target.is_npc>]:npc||<t[<li@armor_stand|item_frame.contains[<c.target.entity_type>]>]:<c.target.entity_type.replace[_]>||<c.target.prefix>>>'
- if <c.target.is_npc> {
- define dtype 'npc'
}
else if <c.target.entity_type> == armor_stand {
- define dtype 'armorstand'
}
else if <c.target.entity_type> == item_frame {
- define dtype 'itemframe'
}
else {
- define dtype '<c.target.prefix>'
}
- define attacker '<c.entity>'
- define defender '<c.target>'
- define world '<c.target.world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[attacker].location.cuboids.include[<def[defender].location.cuboids>].deduplicate.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[%atype%_target_%dtype%]||li@>':
- define flag '%value%'
- define object '<def[<s@dRegions_Flag_%flag%.yaml_key[event_target]>]>'
- define player '<def[<s@dRegions_Flag_%flag%.yaml_key[event_player]||object>]>'
- define target '<def[object].entity_type>'
- define eLoc '<def[object].location>'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Entity_Explode:
type: world
debug: false
events:
on entity explodes:
- define readPath 'entity.explode'
- define target '<c.entity.entity_type>'
- define eLoc '<c.entity.location>'
- define world '<def[eLoc].world.name>'
- inject s@dRegions p:event_PreProc_Config
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[entity_explode]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Entity_Change_Block:
type: world
debug: false
events:
on entity changes block:
# Maybe we want to check block changes here for explosions?
# It's currently disabled because even if the explosion is cancelled, the block
# change event(s) still fire (yes, one explosion can have multiple block changes)
- if <c.old_material.bukkit_enum> == soil || li@player|falling_block|creeper|primed_tnt|unknown contains <c.entity.entity_type||unknown> {
- queue clear
}
# This is generic rateLimiter and does not run a full allow/deny flag process. It is required due to the high frequency of snowmen.
- if <c.entity.is_spawned.not> queue clear
- if <c.entity.has_flag[dRegions.EntityGrief]> {
- if <c.entity.flag[dRegions.EntityGrief]> {
- queue clear
}
- determine cancelled
}
- define object '<c.entity>'
- define target '<c.entity.entity_type>'
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define readPath 'entity.changeBlock'
- inject s@dRegions p:event_PreProc_Config
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[entity_change_block]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Fallingblock_Change_Block:
type: world
debug: false
eventHooks: falling_sand|falling_gravel
events:
on falling_block changes block:
- if <c.entity.is_spawned.not> queue clear
- if <c.entity.has_flag[dRegions.EntityGrief]> {
- if <c.entity.flag[dRegions.EntityGrief]> {
- queue clear
}
- determine cancelled
}
- define mat '<c.entity.fallingblock_material.bukkit_enum>'
# - if li@sand|gravel !contains %mat% queue clear
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define readPath 'physics.%mat%'
- inject s@dRegions p:event_PreProc_Config-NoTarget
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- flag <c.entity> 'pl:<c.location.simple>'
- flag <c.entity> 'pr:<def[orderedRegions].get[1]>'
- run locally delay:1t instantly track 'def:<c.entity>|<def[orderedRegions].get[1]>|%world%|%mat%'
- foreach '<yaml[dRegions_eventmap].read[falling_%mat%]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
track:
- define or 'li@<yaml[dRegions_%3%_regions].read[regions.__global__.priority]||0>/__global__'
- while '<def[1].is_spawned||false>':
- if '<def[1].flag[pl]>' == '<def[1].location.simple>' {
- wait 1t
- while next
}
- define orderedRegions '%or%'
- foreach '<def[1].location.cuboids.filter[starts_with[cu@dregions_%3%]].parse[after[cu@dregions_%3%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%3%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- if '<def[1].flag[pr]>' != '<def[orderedRegions].get[1]>' {
- modifyblock <def[1].flag[pl]> %4% no_physics
- remove %1%
- queue clear
}
- flag %1% 'pl:<def[1].location.simple>'
- wait 1t
dRegions_Events_Entity_Form_Block:
type: world
debug: false
events:
on entity forms block:
- if <c.entity.has_flag[dRegions.EntityGrief]> {
- if <c.entity.flag[dRegions.EntityGrief]> {
- queue clear
}
- determine cancelled
}
- define readPath 'entity.changeBlock'
- define object '<c.entity>'
- define target '<c.entity.entity_type>'
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- inject s@dRegions p:event_PreProc_Config
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[entity_form_block]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
# Handles 3 events: npc_dies entity_dies player_dies
dRegions_Events_Entity_Dies:
type: world
debug: false
eventHooks: npc_dies|entity_dies|player_dies
events:
on entity dies:
# - define target '<t[<c.entity.is_npc>]:npc||<c.entity.prefix>>'
- if <c.entity.is_npc> {
- define target 'npc'
}
else {
- define target '<c.entity.prefix>'
}
# - define player '<t[<def[target].equals_case_sensitive[Player]>]:<c.entity>||null>'
- if '%target%' == 'Player' {
- define player '<c.entity>'
}
else {
- define player 'null'
}
- define object '<c.entity>'
- define eLoc '<def[object].location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[%target%_dies]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Entity_Trample_Crops:
type: world
debug: false
eventHooks: entity_trample_crops|player_trample_crops
events:
on entity changes soil:
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define type '<c.entity.prefix>'
- define readPath 'trample-crops.%type%'
- inject s@dRegions p:event_PreProc_Config-NoTarget
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[%type%_trample_crops]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Entity_Break_Hanging:
type: world
debug: false
eventHooks: entity_break_itemframe|entity_break_painting
events:
on entity breaks hanging:
- if <c.entity.prefix> == player {
- queue clear
}
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define type '<c.hanging.entity_type.replace[_]>'
- define readPath 'entity-break-%type%'
- inject s@dRegions p:event_PreProc_Config-NoTarget
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[entity_break_%type%]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
#
################################################################################
#
# World Events
#
dRegions_Events_Block_Ignites:
type: world
debug: false
eventHooks: lava_fire|fire_spread
events:
on block ignites:
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define target '<c.material.bukkit_enum>'
- define readPath 'fire.<c.cause>'
- choose '<c.cause>':
- case 'ENDER_CRYSTAL':
- define entity '<c.entity>'
- inject s@dRegions p:event_PreProc_Config-NoTarget
- case 'EXPLOSION':
- define entity '<c.entity>'
- inject s@dRegions p:event_PreProc_Config-NoTarget
- case 'FIREBALL':
- define entity '<c.entity>'
- inject s@dRegions p:event_PreProc_Config-NoTarget
- case 'FLINT_AND_STEEL':
- define player '<c.entity>'
- if <def[player].permission[dregions.admin]||false> || <def[player].is_op> {
- queue clear
}
- inject s@dRegions p:event_PreProc_Config-NoTarget
- case 'LAVA':
- inject s@dRegions p:event_PreProc_Config
- case 'SPREAD':
- inject s@dRegions p:event_PreProc_Config
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[fireFrom_<c.cause>]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Block_Burns:
type: world
debug: false
eventHooks: block_burns
events:
on block burns:
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define target '<c.material.bukkit_enum>'
- define readPath 'fire.destroyBlocks'
- inject s@dRegions p:event_PreProc_Config
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[block_burns]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Ice_Forms:
type: world
debug: false
eventHooks: blockform_ice
events:
on ice forms:
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define readPath 'blockform.ice'
- inject s@dRegions p:event_PreProc_Config-NoTarget
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[blockform_ice]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Snow_Form:
type: world
debug: false
eventHooks: blockform_snow
events:
on snow forms:
# This tries to account for snowmen but can result in snow forming on restricted blocks as the entity grief flag is effectively responsible for the event.
- define cub 'cu@<c.location>|<c.location.add[0,1,0]>'
- if !<def[cub].list_entities[snowman].is_empty> {
- queue clear
}
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define target '<def[eLoc].sub[0,1,0].material.bukkit_enum>'
- define readPath 'blockform.snow'
- inject s@dRegions p:event_PreProc_Config
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[blockform_snow]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Soil_Fades:
type: world
debug: false
eventHooks: blockfade_soil
events:
on soil fades:
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define readPath 'blockfade.soil'
- inject s@dRegions p:event_PreProc_Config-NoTarget
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[blockfade_soil]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Ice_Fades:
type: world
debug: false
eventHooks: blockfade_ice
events:
on ice fades:
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define readPath 'blockfade.ice'
- inject s@dRegions p:event_PreProc_Config-NoTarget
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[blockfade_ice]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Snow_Fades:
type: world
debug: false
eventHooks: blockfade_snow
events:
on snow fades:
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define readPath 'blockfade.snow'
- inject s@dRegions p:event_PreProc_Config-NoTarget
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[blockfade_snow]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Block_Spread:
type: world
debug: false
eventHooks: blockspread_grass|blockspread_mycel|blockspread_mushroom|blockspread_vines
events:
on block spreads:
- define mat '<c.material.bukkit_enum.split[_].last>'
- if li@grass|mycel|mushroom|vines !contains %mat% queue clear
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define readPath 'spread.%mat%'
- inject s@dRegions p:event_PreProc_Config-NoTarget
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[blockspread_%mat%]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Liquid_Spread:
type: world
debug: false
eventHooks: water_spreads|lava_spreads
events:
on liquid spreads:
- if '<c.location.material.bukkit_enum>' == '<c.destination.material.bukkit_enum>' queue clear
- define mat '<c.location.material.bukkit_enum.split[_].last>'
- if li@water|lava !contains %mat% queue clear
- define eLoc '<c.destination>'
- define target '<c.destination.material.bukkit_enum>'
- define world '<c.location.world.name>'
- define readPath 'spread.%mat%'
- inject s@dRegions p:event_PreProc_Config
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
# Block liquid from crossing region borders
- if '<c.location.cuboids>' != '<c.destination.cuboids>' {
- define regionPri 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<c.location.cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>' {
- define regionPri '%regionPri%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
}
- if '<def[orderedRegions].get[1]>' != '<def[regionPri].alphanumeric.reverse.parse[after[/]].get[1]>' {
- determine cancelled
}
}
- foreach '<yaml[dRegions_eventmap].read[%mat%_spread]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Lightning_Strikes:
type: world
debug: false
eventHooks: lightning_strikes
events:
on lightning strikes:
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define target '<c.location.below.material.bukkit_enum>'
- define readPath 'lightning-strike'
- inject s@dRegions p:event_PreProc_Config
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[lightning_strikes]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Leaf_Decay:
type: world
debug: false
eventHooks: blockfade_leaves
events:
on leaves decay:
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define readPath 'blockfade.leaves'
- inject s@dRegions p:event_PreProc_Config-NoTarget
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[blockfade_leaves]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Item_Spawn:
type: world
debug: false
eventHooks: '%item%_spawn'
events:
on item spawns:
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define target '<c.item.material.bukkit_enum>'
- define object '<c.entity>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- define events '<yaml[dRegions_eventmap].read[item_spawn]||li@>'
- define events '<def[events].include[<yaml[dRegions_eventmap].read[%target%_spawn]||li@>]>'
- foreach '%events%':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Potion_Splash:
type: world
debug: false
eventHooks: potion_splash
events:
on potion splash:
- define player 'null'
- define eLoc '<c.location>'
- define cuboids '<c.entities.parse[location.cuboids].deduplicate>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<c.entities.parse[location.cuboids.separated_by[|]].as_list.deduplicate.filter[starts_with[cu@dregions_%world%_]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '<yaml[dRegions_eventmap].read[potion_splash]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Pistons:
type: world
debug: false
eventHooks: piston_extend|piston_retract
events:
on piston extends:
# - define lastBlock '<tern[<c.length.is[==].to[0]||true>]:<c.relative>||<c.relative.sub[<c.location>].add[<c.blocks.last>]>>'
- if <c.length||0> == 0 {
- define lastBlock <c.relative>
}
else {
- define lastBlock <c.relative.sub[<c.location>].add[<c.blocks.last>]>
}
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define originRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define originRegions '%originRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define originRegions '<def[originRegions].alphanumeric.reverse.parse[after[/]]>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<c.blocks.include[%lastBlock%].parse[cuboids.separated_by[|]].as_list.deduplicate.filter[starts_with[cu@dregions_%world%_]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
# Block piston blocks from crossing region borders
- if '<def[orderedRegions].get[1]>' != '<def[originRegions].get[1]>' {
- determine cancelled
}
- foreach '<yaml[dRegions_eventmap].read[piston_extend]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
on piston retracts:
# - define lastBlock '<tern[<c.length.is[==].to[0]||true>]:<c.relative>||<c.relative.sub[<c.location>].add[<c.blocks.last>]>>'
- if <c.length||0> == 0 {
- define lastBlock <c.relative>
}
else {
- define lastBlock <c.relative.sub[<c.location>].add[<c.blocks.last>]>
}
- define eLoc '<c.location>'
- define world '<def[eLoc].world.name>'
- define originRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define originRegions '%originRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define originRegions '<def[originRegions].alphanumeric.reverse.parse[after[/]]>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<c.blocks.include[%lastBlock%].parse[cuboids.separated_by[|]].as_list.deduplicate.filter[starts_with[cu@dregions_%world%_]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
# Block piston blocks from crossing region borders
- if '<def[orderedRegions].get[1]>' != '<def[originRegions].get[1]>' {
- determine cancelled
}
- foreach '<yaml[dRegions_eventmap].read[piston_retract]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
dRegions_Events_Issue_Command:
type: world
debug: false
eventHooks: player_command|server_command
events:
on command:
# - define type '<t[<c.server||false>]:server||player>'
- define target '<c.command.to_lowercase> <c.raw_args.to_lowercase>'
- define target '<def[target].escaped>'
- define delimiter ' ; '
- if <c.server> {
- define type 'server'
- goto 'FLAGS'
}
- define type 'player'
- define player '<player>'
- define eLoc '<def[player].location>'
- define world '<def[eLoc].world.name>'
- define orderedRegions 'li@<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[eLoc].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- mark 'FLAGS'
- foreach '<yaml[dRegions_eventmap].read[%type%_command]||li@>':
- define flag '%value%'
- inject 's@dRegions_Flags_Processors_<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
#
################################################################################
#
# dRegions Other Utilities
#
# Other Utility functions used throughout dRegions
#
#--------------------------------------
#
dRegions_GetInheritedFlag:
# Get a region flag value. Start at current child and ascend through parents
# until a value is set or you reach the origin ancestor.
# Since this method is shared by highestOnly and orderedRegions lookups we can not return the default flag value.
# Doing so would interfere with the orderedRegions lookup. Flag processors are responsible for looking up defaults
# after they have traversed all applicable regions.
# <proc[dRegions_GetInheritedFlag].context[world|region|flag]>
type: procedure
definitions: world|region|flag
debug: false
script:
- define return '<yaml[dRegions_%world%_regions].read[regions.%region%.flags.%flag%]||none>'
- while '<def[return].equals_case_sensitive[none]>':
- if <yaml[dRegions_%world%_regions].contains[regions.%region%.parent]> {
- define region '<yaml[dRegions_%world%_regions].read[regions.%region%.parent]>'
- define return '<yaml[dRegions_%world%_regions].read[regions.%region%.flags.%flag%]||none>'
- while next
}
- while stop
- determine '%return%'
# - determine '<t[<def[return].equals_case_sensitive[n].not>]:%return%||<s@dRegions_Flag_%flag%.yaml_key[flag_<t[<def[region].equals_case_sensitive[__global__]>]:global||region>Default]||none>>'
# - if %return% == 'none' {
# - if %region% == '__global__' {
# - determine '<s@dRegions_Flag_%flag%.yaml_key[flag_globalDefault]||none>'
# }
# - determine '<s@dRegions_Flag_%flag%.yaml_key[flag_regionDefault]||none>'
# }
#--------------------------------------
#
dRegions_FlagLookup_H:
# Get a flag value at a location. For use with flags that set highestOnly.
# If the location does not set the flag value, lookup the default set in the flagscript.
# <proc[dRegions_FlagLookup_H].context[flag|location]>
type: procedure
definitions: flag|loc
debug: false
script:
- define w '<def[loc].world.name>'
# - define orderedRegions '<def[loc].cuboids.filter[starts_with[cu@dregions_%w%_]].parse[after[cu@dregions_%w%_]].include[<yaml[dRegions_%w%_regions].read[regions.__global__.priority]||0>/__global__]>'
# - define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- define orderedRegions 'li@<yaml[dRegions_%w%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[loc].cuboids.filter[starts_with[cu@dregions_%w%]].parse[after[cu@dregions_%w%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%w%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- define region '<def[orderedRegions].get[1]>'
- define return '<yaml[dRegions_%w%_regions].read[regions.%region%.flags.%flag%]||none>'
- define child '%region%'
- while '<def[return].equals_case_sensitive[none]>':
- if <yaml[dRegions_%w%_regions].contains[regions.%child%.parent]> {
- define child '<yaml[dRegions_%w%_regions].read[regions.%child%.parent]>'
- define return '<yaml[dRegions_%w%_regions].read[regions.%child%.flags.%flag%]||none>'
}
else {
- while stop
}
- if '%return%' == 'none' {
- if '%region%' == '__global__' {
- determine '<s@dRegions_Flag_%flag%.yaml_key[flag_globalDefault]||none>/%region%'
}
- determine '<s@dRegions_Flag_%flag%.yaml_key[flag_regionDefault]||none>/%region%'
}
- determine '%return%/%region%'
#
#---------------------------------------
#
dRegions_FlagLookup_O:
# Get a flag value at a location. For use with flags that traverse orderedRegions.
# If the location does not set the flag value, lookup the default set in the flagscript.
# <proc[dRegions_FlagLookup_O].context[flag|location]>
type: procedure
definitions: flag|loc
debug: false
script:
- define w '<def[loc].world.name>'
# - define orderedRegions '<def[loc].cuboids.filter[starts_with[cu@dregions_%w%_]].parse[after[cu@dregions_%w%_]].include[<yaml[dRegions_%w%_regions].read[regions.__global__.priority]||0>/__global__]>'
# - define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- define orderedRegions 'li@<yaml[dRegions_%w%_regions].read[regions.__global__.priority]||0>/__global__'
- foreach '<def[loc].cuboids.filter[starts_with[cu@dregions_%w%]].parse[after[cu@dregions_%w%_]]>':
- define orderedRegions '%orderedRegions%|<yaml[dRegions_%w%_regions].read[regions.%value%.priority]||0>/%value%'
- define orderedRegions '<def[orderedRegions].alphanumeric.reverse.parse[after[/]]>'
- foreach '%orderedRegions%':
- define region '%value%'
- define return '<yaml[dRegions_%w%_regions].read[regions.%region%.flags.%flag%]||none>'
- define child '%region%'
- while '<def[return].equals_case_sensitive[none]>':
- if <yaml[dRegions_%w%_regions].contains[regions.%child%.parent]> {
- define child '<yaml[dRegions_%w%_regions].read[regions.%child%.parent]>'
- define return '<yaml[dRegions_%w%_regions].read[regions.%child%.flags.%flag%]||none>'
}
else {
- while stop
}
- if '%return%' != 'none' {
- foreach stop
}
- if '%return%' == 'none' {
- if '%region%' == '__global__' {
- determine '<s@dRegions_Flag_%flag%.yaml_key[flag_globalDefault]||none>/%region%'
}
- determine '<s@dRegions_Flag_%flag%.yaml_key[flag_regionDefault]||none>/%region%'
}
- determine '%return%/%region%'
#
#---------------------------------------
#
dRegions_PlayerMatchRegionGroup:
# Check if a player matches a region flag group setting.
# <proc[dRegions_PlayerMatchRegionGroup].context[group|region|world|player]>
type: procedure
definitions: group|region|world|player
debug: false
script:
- define playerUUID '<def[player].uuid>'
- define playerGroups '<def[player].groups||li@>'
- choose '%group%':
- case 'all':
- determine 'true'
- case 'members':
# - determine '<proc[dRegions_isMember].context[%region%|%world%|%player%]>'
- if <yaml[dRegions_%world%_regions].read[regions.%region%.members.players].contains[%playerUUID%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.members.groups].contains_any[%playerGroups%]||false> {
- determine 'true'
}
- while '<yaml[dRegions_<def[world]>_regions].contains[regions.<def[region]>.parent]>':
- define region '<yaml[dRegions_%world%_regions].read[regions.%region%.parent]>'
- if <yaml[dRegions_%world%_regions].read[regions.%region%.members.players].contains[%playerUUID%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.members.groups].contains_any[%playerGroups%]||false> {
- determine 'true'
}
- determine 'false'
- case 'nonmembers':
# - determine '<proc[dRegions_isOwner].context[%region%|%world%|%player%].or[<proc[dRegions_isMember].context[%region%|%world%|%player%]>].not>'
- if <yaml[dRegions_%world%_regions].read[regions.%region%.members.players].contains[%playerUUID%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.members.groups].contains_any[%playerGroups%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.owners.players].contains[%playerUUID%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.owners.groups].contains_any[%playerGroups%]||false> {
- determine 'false'
}
- while '<yaml[dRegions_<def[world]>_regions].contains[regions.<def[region]>.parent]>':
- define region '<yaml[dRegions_%world%_regions].read[regions.%region%.parent]>'
- if <yaml[dRegions_%world%_regions].read[regions.%region%.members.players].contains[%playerUUID%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.members.groups].contains_any[%playerGroups%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.owners.players].contains[%playerUUID%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.owners.groups].contains_any[%playerGroups%]||false> {
- determine 'false'
}
- determine 'true'
- case 'owners':
# - determine '<proc[dRegions_isOwner].context[%region%|%world%|%player%]>'
- if <yaml[dRegions_%world%_regions].read[regions.%region%.owners.players].contains[%playerUUID%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.owners.groups].contains_any[%playerGroups%]||false> {
- determine 'true'
}
- while '<yaml[dRegions_<def[world]>_regions].contains[regions.<def[region]>.parent]>':
- define region '<yaml[dRegions_%world%_regions].read[regions.%region%.parent]>'
- if <yaml[dRegions_%world%_regions].read[regions.%region%.owners.players].contains[%playerUUID%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.owners.groups].contains_any[%playerGroups%]||false> {
- determine 'true'
}
- determine 'false'
- case 'nonowners':
# - determine '<proc[dRegions_isOwner].context[%region%|%world%|%player%].not>'
- if <yaml[dRegions_%world%_regions].read[regions.%region%.owners.players].contains[%playerUUID%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.owners.groups].contains_any[%playerGroups%]||false> {
- determine 'false'
}
- while '<yaml[dRegions_<def[world]>_regions].contains[regions.<def[region]>.parent]>':
- define region '<yaml[dRegions_%world%_regions].read[regions.%region%.parent]>'
- if <yaml[dRegions_%world%_regions].read[regions.%region%.owners.players].contains[%playerUUID%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.owners.groups].contains_any[%playerGroups%]||false> {
- determine 'false'
}
- determine 'true'
#
#---------------------------------------
#
dRegions_IsOwner:
# A procedure script to check if a player is a region owner
# <proc[dRegions_IsOwner].context[region|world|player]>
type: procedure
definitions: region|world|player
debug: false
script:
- define playerUUID '<def[player].uuid>'
- define playerGroups '<def[player].groups||li@>'
- if <yaml[dRegions_%world%_regions].read[regions.%region%.owners.players].contains[%playerUUID%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.owners.groups].contains_any[%playerGroups%]||false> {
- determine 'true'
}
# Regions inherit members and owners.
- while '<yaml[dRegions_<def[world]>_regions].contains[regions.<def[region]>.parent]>':
- define region '<yaml[dRegions_%world%_regions].read[regions.%region%.parent]>'
- if <yaml[dRegions_%world%_regions].read[regions.%region%.owners.players].contains[%playerUUID%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.owners.groups].contains_any[%playerGroups%]||false> {
- determine 'true'
}
- determine 'false'
#
#---------------------------------------
#
dRegions_IsMember:
# A procedure script to check if a player is a region member
# <proc[dRegions_IsMember].context[region|world|player]>
type: procedure
definitions: region|world|player
debug: false
script:
- define playerUUID '<def[player].uuid>'
- define playerGroups '<def[player].groups||li@>'
- if <yaml[dRegions_%world%_regions].read[regions.%region%.members.players].contains[%playerUUID%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.members.groups].contains_any[%playerGroups%]||false> {
- determine 'true'
}
# Regions inherit members and owners.
- while '<yaml[dRegions_<def[world]>_regions].contains[regions.<def[region]>.parent]>':
- define region '<yaml[dRegions_%world%_regions].read[regions.%region%.parent]>'
- if <yaml[dRegions_%world%_regions].read[regions.%region%.members.players].contains[%playerUUID%]||false> || <yaml[dRegions_%world%_regions].read[regions.%region%.members.groups].contains_any[%playerGroups%]||false> {
- determine 'true'
}
- determine 'false'
#
#--------------------------------------
#
# Command Permission Check Procedure script
#
# Used to check if a player has permission to use a command.
#
# I have to think about this more...
# # A procedure script to check if a player has any of the required permissions for a command
# # <proc[dRegions_HasPerm_Command].context[command|player|region|option]>
#
dRegions_HasPerm_Command:
type: procedure
debug: false
definitions: command|player|region|option
script:
- if <player.permission[a]||null> == null {
- if <player.is_op> {
- determine true
}
else {
- determine false
}
}
- if %option% == null {
- inject locally permCheck
}
else {
- inject locally permCheck-%command%
}
permCheck:
- narrate "permCheck <s@dRegions_Commands.yaml_key[commandArgs.%command%.permissions]||li@>"
- if <player.is_op> || <player.permission[dregions.admin]> {
- determine true
}
- define perms "<s@dRegions_Commands.yaml_key[commandArgs.%command%.permissions]||li@>"
- foreach %perms% {
- define perm '<parse:%value%>'
- if <player.permission[%perm%]> {
- determine true
}
}
- determine false
permCheck-flag:
- define flag '%option%'
- narrate "permCheck-flag <parse:<s@dRegions_Commands.yaml_key[commandArgs.%command%.permissions]||li@>>"
- if <player.is_op> || <player.permission[dregions.admin]> {
- determine true
}
- define perms "<s@dRegions_Commands.yaml_key[commandArgs.%command%.permissions]||li@>"
- foreach %perms% {
- define perm '<parse:%value%>'
- narrate "<player.permission[%perm%]> %perm%"
- if <player.permission[%perm%]> {
- determine true
}
}
- determine false
#
#---------------------------------------
#
# Simple Instancing API Hook
#
# Support for simple instancing API by BlackCoyote
# - http://one.denizenscript.com/denizen/repo/entry/94
#
# Instanced worlds will be an exact replica of the blueprint world.
# Completely configure your blueprint world with any world configs, regions,
# and flags, and every instance cloned from the blueprint will have all of the
# same settings. dRegions data will be removed when the instance is destroyed.
#
dRegions_SIAPI_Hook:
type: world
debug: false
events:
on instance created:
- run instantly s@dRegions_CopyWorld 'def:<c.blueprint_world>|<c.instance>'
on instance closed:
- run instantly s@dRegions_DestroyWorld 'def:<c.instance>'
#
#---------------------------------------
#
# Copy all dRG world data from one world to another and create notable cuboids.
#
# Usage:
# - run instantly s@dRegions_CopyWorld 'def:original|copy'
#
dRegions_CopyWorld:
type: task
debug: false
definitions: orig|world
script:
- if !<server.has_file[dRegions/worlds/%orig%]> {
- run s@msgPrefixed instantly delay:1t 'def:dRegions|<&c>%orig% is an unknown world!'
- queue clear
}
- foreach 'li@config|regions|inventories|cache':
- define this '%value%'
- define file 'worlds/%orig%/%this%'
- if <server.has_file[dRegions/%file%.yml]> {
- define readID 'dRegions_%orig%_%this%'
- if !<yaml.list.contains[%readID%]> {
- yaml 'load:dRegions/%file%.yml' 'id:%readID%'
}
- define writeID 'dRegions_%world%_%this%'
- define readPath '%this%'
- define writePath '%this%'
- yaml create 'id:%writeID%'
- run s@ConfigFileGenerator instantly 'def:%readID%|%writeID%|%readPath%|%writePath%|false|false|false'
- yaml 'savefile:dRegions/worlds/%world%/%this%.yml' 'id:%writeID%'
}
else {
- inject s@dRegions create%this%File
}
- if <yaml.list.contains[%writeID%]> {
- yaml unload 'id:%writeID%'
}
- yaml 'load:dRegions/worlds/%world%/%this%.yml' 'id:%writeID%'
- foreach '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__]>':
- note 'cu@<yaml[dRegions_%world%_regions].read[regions.%value%.min]>|<yaml[dRegions_%world%_regions].read[regions.%value%.max]>' 'as:dregions_%world%_%value%'
#
#---------------------------------------
#
# Destroy all dRG data for a world
#
# Usage:
# - run instantly s@dRegions_DestroyWorld 'def:world'
#
dRegions_DestroyWorld:
type: task
debug: false
definitions: world
script:
- if !<server.has_file[dRegions/worlds/%world%]> {
- run s@msgPrefixed instantly delay:1t 'def:dRegions|<&c>%world% is an unknown world!'
- queue clear
}
- foreach '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__]>':
- note remove 'as:dregions_%world%_%value%'
- foreach 'li@config|regions|inventories|cache':
- define this '%value%'
- define file 'dRegions/worlds/%world%/%this%'
- define readID 'dRegions_%world%_%this%'
- if <yaml.list.contains[%readID%]> {
- yaml unload 'id:%readID%'
}
- if <server.has_file[%file%.yml]> {
- adjust server 'delete_file:%file%.yml'
}
#
#---------------------------------------
#
dRegions_RegionSort:
# An attempt to sort regions by priority. The existing method is faster.
# Keeping for reference and lulz.
type: procedure
definitions: region1|region2
debug: false
script:
- define region1pri '<def[region1].split[/].get[1]>'
- define region2pri '<def[region2].split[/].get[1]>'
- if %region1pri% > %region2pri% {
- determine -1
}
- if %region1pri% < %region2pri% {
- determine 1
}
- if %region1pri% == %region2pri% {
- determine 0
}
#
#---------------------------------------
#
dRegions_RegionExists:
# A procedure script to check if a region exists
# <proc[dRegions_RegionExists].context[region|world]>
type: procedure
definitions: region|world
debug: false
script:
- if %region% == '__global__' {
- determine true
}
# - define notables '<cu@dregions_%world%_%region%.is[!=].to[null].not||true>'
- define notables '<server.list_notables[cuboids].contains[cu@dregions_%world%_%region%].not||true>'
- define regions '<yaml[dRegions_%world%_regions].contains[regions.%region%].not||true>'
- if %notables% && %regions% {
- determine false
}
else if %notables% || %regions% {
- determine orphan
}
else {
- determine true
}
#
#---------------------------------------
#
dRegions_HighestPriority:
# Used sparingly in some commands. Events implement this method directly.
# Filter a list of regions by priority in descending order
# <proc[dRegions_HighestPriority].context[world|region1,...]>
type: procedure
definitions: world|regions
debug: false
script:
- define regions '<def[regions].split[,]||li@>'
- define regionPri 'li@'
- foreach %regions% {
- define regionPri '%regionPri%<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%|'
}
- determine '<def[regionPri].alphanumeric.reverse.parse[split[/].get[2]]>'
#
#---------------------------------------
#
dRegions_RegionOverlaps:
# A procedure script to check if a region overlaps other (un)owned regions
# <proc[dRegions_RegionOverlaps].context[<def[selectedCuboid].separated_by[/].replace[cu@]>|%name%|%world%|<player>]>
# NOTE: If for some reason the selected cuboid overlaps an unowned region that is a lower priority than
# a region that the player does own and is completely within, it will not be considered as an overlap!
# - But why would there be a lower priority region inside a higher priority region... that's not
# how priorities should be used!
type: procedure
definitions: selectedCuboid|world|player
debug: false
script:
- define selectedCuboid '<def[selectedCuboid].split[/].as_cuboid>'
- define regions '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__]||li@>'
- define notables '<def[regions].parse[replace[regex:^].with[cu@dregions_%world%_]].filter[as_cuboid.is[!=].to[null]]||li@>'
- define overlaps '<def[notables].filter[intersects[<def[selectedCuboid].as_cuboid>]].parse[replace[cu@dregions_%world%_]]||li@>'
- define orderedRegions '<proc[dRegions_HighestPriority].context[%world%|<def[overlaps].separated_by[,]>]||li@>'
- foreach '%orderedRegions%':
- if <proc[dRegions_IsOwner].context[%value%|%world%|<player>].not> {
- determine true
}
- if <def[selectedCuboid].is_within[<def[value].replace[regex:^].with[cu@dregions_%world%_].as_cuboid>]> {
- determine false
}
# By this point, we've determined that the player either owns all the regions at this cuboid location
# or that the new cuboid is completely within a region that he does own.
- determine false
#
#---------------------------------------
#
dRegions_CuboidIsWithinCuboid:
# Not used anywhere since Denizen implemented its own which is faster.
# Keeping for reference.
# Checks if one cuboid is completely within another cuboid
# <proc[dRegions_CuboidIsWithinCuboid].context[inner|outer]>
type: procedure
definitions: inner|outer
debug: false
script:
- define innerCuboid '<def[inner].split[/].as_cuboid>'
- define outerCuboid '<def[outer].split[/].as_cuboid>'
- if <def[innerCuboid].min.x.is[OR_MORE].than[<def[outerCuboid].min.x>]>
&& <def[innerCuboid].min.y.is[OR_MORE].than[<def[outerCuboid].min.y>]>
Line with no clear purpose - missing a -dash- or :colon:?
&& <def[innerCuboid].min.z.is[OR_MORE].than[<def[outerCuboid].min.z>]>
Line with no clear purpose - missing a -dash- or :colon:?
&& <def[innerCuboid].max.x.is[OR_LESS].than[<def[outerCuboid].max.x>]>
Line with no clear purpose - missing a -dash- or :colon:?
&& <def[innerCuboid].max.y.is[OR_LESS].than[<def[outerCuboid].max.y>]>
Line with no clear purpose - missing a -dash- or :colon:?
&& <def[innerCuboid].max.z.is[OR_LESS].than[<def[outerCuboid].max.z>]> {
Line with no clear purpose - missing a -dash- or :colon:?
- determine true
}
else {
- determine false
}
#
#---------------------------------------
#
dRegions_CanUse_Block:
# Not used internally. It's intended as part of an API for external scripts.
# Procedure script to determine if a player can use a block at a location.
# Will work for any block that can be interacted with (chests, doors, levers, etc.)
# <proc[dRegions_CanUse_Block].context[player|location]>
type: procedure
debug: false
definitions: player|location
script:
- define world '<def[location].world.name>'
- define target '<def[location].material.bukkit_enum>'
- define FlagScript '<s@dRegions_Map_Interactions.yaml_key[block.%target%]||s@dRegions_Map_Interactions>'
- define flag '<def[FlagScript].yaml_key[flag_name]||null>'
- if %flag% == null determine false
- if <def[player].permission[dregions.admin]||<def[player].is_op>> determine true
- define flag-targetList '<def[FlagScript].yaml_key[flag_targetList]||null>'
- if <def[location].cuboids.is_empty||true> {
- inject locally check-global
- determine 'true'
- queue clear
}
- define regionPri 'li@'
- foreach <def[location].cuboids.parse[notable_name].filter[starts_with[dRegions_]].parse[after[dregions_%world%_]].include[__global__]> {
- define regionPri '%regionPri%<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%|'
}
- define orderedRegions '<def[regionPri].alphanumeric.reverse.parse[split[/].get[2]]>'
- inject locally check-region
- determine 'true'
check-global:
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|__global__|%flag%]>'
- if %flagObj% == null {
- define flagObj '<def[FlagScript].yaml_key[flag_globalDefault]||none>'
}
- if %flagObj% != none {
- if <def[flagObj].split[/].get[1]> == allow {
- if !<proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].split[/].get[2]||all>|__global__|%world%|%player%]> {
# - inject %FlagScript% p:event-cleanup
- determine false
}
- define targetList '<proc[dRegions_GetInheritedFlag].context[%world%|__global__|%flag-targetList%].replace[, ].with[|].as_list>'
- if ( %targetList% != li@null ) && ( %targetList% != li@all ) && ( %targetList% !contains %target% ) {
# - inject %FlagScript% p:event-cleanup
- determine false
}
}
else {
- if <proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].split[/].get[2]||all>|__global__|%world%|%player%]> {
- define targetList '<proc[dRegions_GetInheritedFlag].context[%world%|__global__|%flag-targetList%].replace[, ].with[|].as_list>'
- if ( %targetList% == li@null ) || ( %targetList% == li@all ) || ( %targetList% contains %target% ) {
# - inject %FlagScript% p:event-cleanup
- determine false
}
}
}
}
check-region:
- if <def[FlagScript].yaml_key[region_highestOnly]||false> {
- define region '<def[orderedRegions].get[1]>'
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%region%|%flag%]>'
}
else {
- foreach %orderedRegions% {
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%value%|%flag%]>'
- define region '%value%'
- if %flagObj% != null {
- foreach stop
}
}
}
- if %flagObj% == null {
- define flagObj '<def[FlagScript].yaml_key[flag_defaultValue]||none>'
}
- if %flagObj% != none {
- if <def[flagObj].split[/].get[1]> == allow {
- if !<proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].split[/].get[2]||all>|<def[orderedRegions].get[1]>|%world%|%player%]> {
# - inject %FlagScript% p:event-cleanup
- determine false
}
- define targetList '<proc[dRegions_GetInheritedFlag].context[%world%|%region%|%flag-targetList%].replace[, ].with[|].as_list>'
- if ( %targetList% != li@null ) && ( %targetList% != li@all ) && ( %targetList% !contains %target% ) {
# - inject %FlagScript% p:event-cleanup
- determine false
}
}
else {
- if <proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].split[/].get[2]||all>|<def[orderedRegions].get[1]>|%world%|%player%]> {
- define targetList '<proc[dRegions_GetInheritedFlag].context[%world%|%region%|%flag-targetList%].replace[, ].with[|].as_list>'
- if ( %targetList% == li@null ) || ( %targetList% == li@all ) || ( %targetList% contains %target% ) {
# - inject %FlagScript% p:event-cleanup
- determine false
}
}
}
}
#
#---------------------------------------
#
dRegions_getRelativeLocation:
# Not used anywhere, but still fun to look at, though totally bonkers.
# A procedure script to get a location relative to another location.
# Specify the direction as n s e w u d
# <proc[dRegions_getRelativeLocation].context[location|direction|distance]>
type: procedure
definitions: l|d|n
debug: false
n_math: sub
n_coord: '0,0,<def[n]>'
s_math: add
s_coord: '0,0,<def[n]>'
w_math: sub
w_coord: '<def[n]>,0,0'
e_math: add
e_coord: '<def[n]>,0,0'
d_math: sub
d_coord: '0,<def[n]>,0'
u_math: add
u_coord: '0,<def[n]>,0'
script:
- define math '<script.yaml_key[%d%_math]>'
- define coord '<script.yaml_key[%d%_coord]>'
- determine "<def[l].as_location.%math%[%coord%]>"
#
#---------------------------------------
#
dRegions_LineWrap:
# This should mostly be unused since <proc[lineWrap].context[string|targetLen]>
# exists in MessageConstructorLibrary
# Turn a long string into a list of smaller strings
type: procedure
definitions: string|targetLen
debug: false
script:
- define stringLen '<def[string].length>'
- if <def[stringLen].is[MORE].than[%targetLen%]> {
- define lines 'li@'
- while <def[stringLen].is[MORE].than[0]> {
- define low '<def[increment].add[1].as_int||1>'
- define hi '<def[increment].add[<def[targetLen].add[1]>].as_int||%targetLen%>'
- define pass '<def[string].substring[%low%,%hi%]>'
- if <def[pass].length.is[==].to[%stringLen%]> {
- define lines '<def[lines].include[%pass%]||<def[lines]>>'
- while stop
}
else {
- define brake '<t[<def[pass].contains[<&nl>]>]:<def[pass].index_of[<&nl>]>||<def[pass].last_index_of[ ]>>'
# - define brake '<def[pass].last_index_of[ ]>'
- define increment '<def[increment].add[%brake%]||%brake%>'
- define passtrim '<def[pass].substring[1,<t[<def[brake].is[MORE].than[0]>]:%brake%||<def[pass].length>>]>'
- define lines '<def[lines].include[%passtrim%]||<def[lines]>>'
- define stringLen '<def[stringLen].sub[%brake%]>'
}
- if <def[loop_index].is[MORE].than[10]> {
- while stop
}
}
- determine '<def[lines].as_list>'
}
else {
- determine '<def[string].as_list>'
}
#
# END other utilities
#--------------------------------------
#
# dRegions author banner items
#
# Banner items representing the authors
#
dRegions_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 dRegions author banner items
#-------------------------------------------------------------------------------
#
# dRegions Interaction Mapping
#
# Mapping eventHooks to right clicks
#
dRegions_Map_Interactions:
type: yaml data
debug: false
block:
# Containers
chest: player_interact_container
ender_chest: player_interact_container
locked_chest: player_interact_container
trapped_chest: player_interact_container
dispenser: player_interact_container
hopper: player_interact_container
dropper: player_interact_container
# Doors
trap_door: player_interact_door
iron_trapdoor: player_interact_door
wooden_door: player_interact_door
iron_door_block: player_interact_door
spruce_door: player_interact_door
birch_door: player_interact_door
jungle_door: player_interact_door
dark_oak_door: player_interact_door
acacia_door: player_interact_door
fence_gate: player_interact_door
spruce_fence_gate: player_interact_door
birch_fence_gate: player_interact_door
jungle_fence_gate: player_interact_door
dark_oak_fence_gate: player_interact_door
acacia_fence_gate: player_interact_door
# Switches
lever: player_interact_switches
wood_button: player_interact_switches
stone_button: player_interact_switches
wood_plate: player_interact_switches
stone_plate: player_interact_switches
iron_plate: player_interact_switches
gold_plate: player_interact_switches
# Utility Blocks
workbench: player_interact_utilityBlocks
furnace: player_interact_utilityBlocks
burning_furnace: player_interact_utilityBlocks
brewing_stand: player_interact_utilityBlocks
enchantment_table: player_interact_utilityBlocks
anvil: player_interact_utilityBlocks
beacon: player_interact_utilityBlocks
jukebox: player_interact_utilityBlocks
note_block: player_interact_utilityBlocks
# cauldron: useUtility
# tnt: useUtility
# Other blocks that change when clicked regardless of item in hand
flower_pot: player_interact_blocks
cake_block: player_interact_blocks
diode_block_on: player_interact_blocks
diode_block_off: player_interact_blocks
redstone_comparator_off: player_interact_blocks
redstone_comparator_on: player_interact_blocks
block_withItem:
# jukebox: player_interact_utilityBlocks/air/gold_record|green_record|record_3|record_4|record_5|record_6|record_7|record_8|record_9|record_10|record_11|record_12
cauldron: player_interact_utilityBlocks/bucket|water_bucket|glass_bottle
tnt: player_interact_utilityBlocks/flint_and_steel
activator_rail: player_place_vehicle/minecart|storage_minecart|powered_minecart|explosive_minecart|hopper_minecart|command_minecart
detector_rail: player_place_vehicle/minecart|storage_minecart|powered_minecart|explosive_minecart|hopper_minecart|command_minecart
powered_rail: player_place_vehicle/minecart|storage_minecart|powered_minecart|explosive_minecart|hopper_minecart|command_minecart
rails: player_place_vehicle/minecart|storage_minecart|powered_minecart|explosive_minecart|hopper_minecart|command_minecart
stationary_water: player_place_vehicle/boat
water: player_place_vehicle/boat
mob_spawner: player_interact_blocks/monster_egg
item:
gold_record: jukebox
glass_bottle: cauldron
flint_and_steel: tnt
dye_colors:
black: 0
red: 1
green: 2
brown: 3
blue: 4
purple: 5
cyan: 6
silver: 7
gray: 8
pink: 9
lime: 10
yellow: 11
light_blue: 12
magenta: 13
orange: 14
white: 15
#
# END dRegions Interaction Mapping
#--------------------------------------
#
################################################################################
# #
# Configuration Files #
# #
# These are the default config files. They will be used to build the default #
# configuration and data storage files. #
# #
#______________________________________________________________________________#
# #
#______________________________DO_NOT_EDIT_THIS_DATA___________________________#
#______________________________________________________________________________#
dRegions_Configurations:
type: yaml data
config:
version: 0.29
clear_cache_on_restart: false
stats:
About: This allows sending basic dRegions usage info to the Script Tracker system created by BlackCoyote. Doing this helps me focus my development efforts. Please enable webget in the Denizen config.yml file and here to participate.
useStats: true
regions:
enable: true
invincibility-removes-mobs: false
invincibility-confuses-mobs: false
wand: dWE_Wand
ownerOnDefine: false
claim:
max-volume: 0
only-inside-existing-regions: true
max-region-count-per-player:
default: 7
spread:
water: true
water-list: []
lava: true
lava-list: []
mycel: true
grass: true
mushroom: true
vines: true
physics:
gravel: true
sand: true
portal:
create: true
entity-enter: true
player-enter: true
fire:
ender_crystal: true
explosion: true
fireball: true
flint_and_steel: true
lava: true
spread: true
spread-list: []
destroyBlocks: true
destroyBlocks-list: []
entity:
changeBlocks: true
changeBlocks-list: []
explode: true
explode-list: []
entity-break-item_frame: true
entity-break-painting: true
blockform:
ice: true
snow: true
snow-list: []
blockfade:
ice: true
snow: true
leaves: true
lightning-strike: true
lightning-strike-list: []
trample-crops:
player: true
entity: true
player-damage: true
player-damage-list: []
# auto-invincible: false
# protection:
# item-durability: true
# remove-infinite-stacks: false
# disable-xp-orb-drops: false
# disable-obsidian-generators: true
# weather:
# prevent-lightning-strike-blocks: []
# disable-lightning-strike-fire: false
# disable-thunderstorm: false
# disable-weather: false
# disable-pig-zombification: false
# disable-powered-creepers: false
# always-raining: false
# always-thundering: false
regions:
__global__:
type: global
priority: 0
flags: []
owners: []
members: []
inventories:
info:
- This is the inventory save file.
- DO NOT EDIT!
example:
region:
entry:
kit:
equip: []
inv: []
players:
player:
equip: []
inv: []
exit:
players:
player:
equip: []
inv: []
cache:
b: []
sg: []
st: []
stg: []
stsg: []
info:
- This is the cache file. We use this file to cache individual specific events so that we can reduce the number of flag lookups later on.
- Expect it to grow to a considerable size!
#################################################################################
#
# Region flag pre-processors
#
# * NOTES *
# - Entity flags exist in denizen now and can be used as rate limiters
# - NIGHTMARE flag - enter bed transport to nightmare. Creates a pseudorandom instance. Hunt for a bed to get out.
#
#---------------------------------------
#
# State-withTarget-withGroup
#
dRegions_Flags_Processors_stg:
type: task
debug: false
script:
- define thisRegion '<def[orderedRegions].get[1]>'
# This is a rate limiter implemented BEFORE caching. The idea here is that if the player and event are in
# the same region (even Global) we can safely expect that the values will be consistent (because we clear
# rateLimit values on region enter/exit). Normal processing will follow if the rateLimit value is stale.
# rateLimit value is stored as a boolean.
# Rate limiter
- if '<def[eLoc].cuboids>' == '<def[player].location.cuboids>' {
- define sameRegion 'true'
- if <def[player].has_flag[dRegions.rateLimit.%flag%.%target%]> {
- define a '<def[player].flag[dRegions.rateLimit.%flag%.%target%]>'
- goto 'b'
}
}
else {
- define sameRegion 'false'
}
# Cache values can be none, true, or false. If the cache is set that means we have already done a flag
# lookup once before and can skip the lookup. Cache values are cleared when regions are modified, and
# optionally on server restart.
# A cache value of none is treated as true, but will allow the lookup process to continue. A cache value
# of true or false stops the lookup process and goes to the determination.
# Return format for %flagObj% is action/group actions: allow deny none group: all members nonmembers owners nonowners
# The /all is added on to the end of the flag object just in case someone doesn't specify the group. It is safely ignored if it is set.
# The uuid and prefix are used to help create a yaml friendly node structure for the cache
- define uuid '<def[player].uuid>'
- define prefix '<def[uuid].substring[1,2]>'
- define listflag '<s@dRegions_Flag_%flag%.yaml_key[flag_targetList]||null>'
# First we check the flag if it only wants the highest priority region.
- if '<s@dRegions_Flag_%flag%.yaml_key[region_highestOnly]||false>' {
- if <yaml[dRegions_%world%_cache].contains[cache.stg.%thisRegion%.%flag%.%target%.%prefix%.%uuid%]> {
- define a '<yaml[dRegions_%world%_cache].read[cache.stg.%thisRegion%.%flag%.%target%.%prefix%.%uuid%]>'
- goto 'a'
}
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%flag%]>/all'
- define targetList '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%listflag%].split_by[, ]>'
# - define default '<tern[<def[thisRegion].is[==].to[__global__]>]:globalDefault||regionDefault>'
- if '%thisRegion%' == '__global__' {
- define default 'globalDefault'
}
else {
- define default 'regionDefault'
}
- if <def[flagObj].starts_with[none]> {
- define flagObj '<s@dRegions_Flag_%flag%.yaml_key[flag_%default%]||none>/all'
}
- if '%targetList%' == 'li@none' {
- define targetList '<s@dRegions_Flag_%listflag%.yaml_key[flag_%default%].split_by[, ]||none>'
}
- define c '<def[targetList].contains_any[none|all|%target%].and[<proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].after[/].before[/]>|%thisRegion%|%world%|%player%]>]>'
# - if '<def[targetList].contains_any[none|all|%target%]>' && '<proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].after[/].before[/]>|%thisRegion%|%world%|%player%]>' {
# - define c 'true'
# }
# else {
# - define c 'false'
# }
# - define a '<t[<def[flagObj].starts_with[deny]>]:<def[c].not>||%c%>'
- if <def[flagObj].starts_with[deny]> {
- define a '<def[c].not>'
}
else {
- define a '%c%'
}
- yaml set 'cache.stg.%thisRegion%.%flag%.%target%.%prefix%.%uuid%:%a%' 'id:dRegions_%world%_cache'
- goto 'a'
}
# Parse %orderedRegions% until the %flagObj% has a value. Not sure if %targetList% should be filled independently, only in
# relation to %thisRegion%, or as it is now where it settles on the first none empty value.
- define targetlist 'li@none'
- define s '<def[orderedRegions].size>'
- foreach '%orderedRegions%':
- define thisRegion '%value%'
- if <yaml[dRegions_%world%_cache].contains[cache.stg.%thisRegion%.%flag%.%target%.%prefix%.%uuid%]> {
- define a '<yaml[dRegions_%world%_cache].read[cache.stg.%thisRegion%.%flag%.%target%.%prefix%.%uuid%]>'
- if '%a%' == 'none' {
- define a 'true'
- foreach next
}
- goto 'a'
}
# - define targetList '<t[<def[targetList].is[==].to[li@none]>]:<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%listflag%].split_by[, ]>||%targetList%>'
- if '%targetList%' == 'li@none' {
- define targetList '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%listflag%].split_by[, ]>'
}
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%flag%]>/all'
- if %loop_index% != %s% {
- if <def[flagObj].starts_with[none]> {
- define a 'true'
- yaml set 'cache.stg.%thisRegion%.%flag%.%target%.%prefix%.%uuid%:none' 'id:dRegions_%world%_cache'
- foreach next
}
}
# - define default '<tern[<def[thisRegion].is[==].to[__global__]>]:globalDefault||regionDefault>'
- if '%thisRegion%' == '__global__' {
- define default 'globalDefault'
}
else {
- define default 'regionDefault'
}
- if <def[flagObj].starts_with[none]> {
- define flagObj '<s@dRegions_Flag_%flag%.yaml_key[flag_%default%]||none>/all'
}
- if '%targetList%' == 'li@none' {
- define targetList '<s@dRegions_Flag_%listflag%.yaml_key[flag_%default%].split_by[, ]||none>'
}
- define c '<def[targetList].contains_any[none|all|%target%].and[<proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].after[/].before[/]>|%thisRegion%|%world%|%player%]>]>'
# - if '<def[targetList].contains_any[none|all|%target%]>' && '<proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].after[/].before[/]>|%thisRegion%|%world%|%player%]>' {
# - define c 'true'
# }
# else {
# - define c 'false'
# }
# - define a '<t[<def[flagObj].starts_with[deny]>]:<def[c].not>||%c%>'
- if <def[flagObj].starts_with[deny]> {
- define a '<def[c].not>'
}
else {
- define a '%c%'
}
- yaml set 'cache.stg.%thisRegion%.%flag%.%target%.%prefix%.%uuid%:%a%' 'id:dRegions_%world%_cache'
- foreach stop
# Set the rateLimit if applicable
- mark 'a'
- if %sameRegion% {
- flag %player% 'dRegions.rateLimit.%flag%.%target%:%a%'
}
# Process determinations
- mark 'b'
- if '%a%' || <def[overRide].exists> {
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'event-allowed' {
- inject 's@dRegions_Flag_%flag%' 'p:event-allowed'
}
- foreach next
- queue clear
}
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'msg_cancelled' {
- if <def[player].has_flag[dRegions.Message_Cooldown].not> {
- flag %player% dRegions.Message_Cooldown duration:3s
- run s@msgPrefixed delay:1t 'player:%player%' 'def:dRegions|<&c><&o><parse:<s@dRegions_Flag_%flag%.yaml_key[msg_cancelled]||null>>'
}
}
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'event-cancelled' {
- inject 's@dRegions_Flag_%flag%' 'p:event-cancelled'
}
- if <def[noCancel].exists> {
- foreach next
- queue clear
}
- determine cancelled
#
# END stg
#---------------------------------------
#
# State-withTarget
#
dRegions_Flags_Processors_st:
type: task
debug: false
script:
- define thisRegion '<def[orderedRegions].get[1]>'
- define listflag '<s@dRegions_Flag_%flag%.yaml_key[flag_targetList]||null>'
- if '<s@dRegions_Flag_%flag%.yaml_key[region_highestOnly]||false>' {
- if <yaml[dRegions_%world%_cache].contains[cache.st.%thisRegion%.%flag%.%target%]> {
- define a '<yaml[dRegions_%world%_cache].read[cache.st.%thisRegion%.%flag%.%target%]>'
- goto 'a'
}
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%flag%]>'
- define targetList '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%listflag%].split_by[, ]>'
# - define default '<tern[<def[thisRegion].is[==].to[__global__]>]:globalDefault||regionDefault>'
- if '%thisRegion%' == '__global__' {
- define default 'globalDefault'
}
else {
- define default 'regionDefault'
}
- if <def[flagObj].starts_with[none]> {
- define flagObj '<s@dRegions_Flag_%flag%.yaml_key[flag_%default%]||none>/all'
}
- if '%targetList%' == 'li@none' {
- define targetList '<s@dRegions_Flag_%listflag%.yaml_key[flag_%default%].split_by[, ]||none>'
}
- define c '<def[targetList].contains_any[none|all|%target%]>'
- if '%flagObj%' == 'deny' {
- define a '<def[c].not>'
}
else {
- define a '%c%'
}
- yaml set 'cache.st.%thisRegion%.%flag%.%target%:%a%' 'id:dRegions_%world%_cache'
- goto 'a'
}
- define targetlist 'li@none'
- define s '<def[orderedRegions].size>'
- foreach '%orderedRegions%':
- define thisRegion '%value%'
- if <yaml[dRegions_%world%_cache].contains[cache.st.%thisRegion%.%flag%.%target%]> {
- define a '<yaml[dRegions_%world%_cache].read[cache.st.%thisRegion%.%flag%.%target%]>'
- if '%a%' == 'none' {
- define a 'true'
- foreach next
}
- goto 'a'
}
- if '%targetList%' == 'li@none' {
- define targetList '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%listflag%].split_by[, ]>'
}
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%flag%]>'
- if %loop_index% != %s% {
- if '%flagObj%' == 'none' {
- define a 'true'
- yaml set 'cache.st.%thisRegion%.%flag%.%target%:none' 'id:dRegions_%world%_cache'
- foreach next
}
}
# - define default '<tern[<def[thisRegion].is[==].to[__global__]>]:globalDefault||regionDefault>'
- if '%thisRegion%' == '__global__' {
- define default 'globalDefault'
}
else {
- define default 'regionDefault'
}
- if <def[flagObj].starts_with[none]> {
- define flagObj '<s@dRegions_Flag_%flag%.yaml_key[flag_%default%]||none>/all'
}
- if '%targetList%' == 'li@none' {
- define targetList '<s@dRegions_Flag_%listflag%.yaml_key[flag_%default%].split_by[, ]||none>'
}
- define c '<def[targetList].contains_any[none|all|%target%]>'
- if '%flagObj%' == 'deny' {
- define a '<def[c].not>'
}
else {
- define a '%c%'
}
- yaml set 'cache.st.%thisRegion%.%flag%.%target%:%a%' 'id:dRegions_%world%_cache'
- foreach stop
- mark 'a'
- if '%a%' || <def[overRide].exists> {
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'event-allowed' {
- inject 's@dRegions_Flag_%flag%' 'p:event-allowed'
}
- foreach next
- queue clear
}
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'msg_cancelled' {
- if <def[player].has_flag[dRegions.Message_Cooldown].not> {
- flag %player% dRegions.Message_Cooldown duration:3s
- run s@msgPrefixed delay:1t 'player:%player%' 'def:dRegions|<&c><&o><parse:<s@dRegions_Flag_%flag%.yaml_key[msg_cancelled]||null>>'
}
}
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'event-cancelled' {
- inject 's@dRegions_Flag_%flag%' 'p:event-cancelled'
}
- if <def[noCancel].exists> {
- foreach next
- queue clear
}
- determine cancelled
#
# END st
#---------------------------------------
#
# State-withGroup
#
dRegions_Flags_Processors_sg:
type: task
debug: false
script:
- define thisRegion '<def[orderedRegions].get[1]>'
- if '<def[eLoc].cuboids>' == '<def[player].location.cuboids>' {
- define sameRegion 'true'
- if <def[player].has_flag[dRegions.rateLimit.%flag%]> {
- define a '<def[player].flag[dRegions.rateLimit.%flag%]>'
- goto 'b'
}
}
else {
- define sameRegion 'false'
}
- define uuid '<def[player].uuid>'
- define prefix '<def[uuid].substring[1,2]>'
- if '<s@dRegions_Flag_%flag%.yaml_key[region_highestOnly]||false>' {
- if <yaml[dRegions_%world%_cache].contains[cache.sg.%thisRegion%.%flag%.%prefix%.%uuid%]> {
- define a '<yaml[dRegions_%world%_cache].read[cache.sg.%thisRegion%.%flag%.%prefix%.%uuid%]>'
- goto 'a'
}
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%flag%]>/all'
- if <def[flagObj].starts_with[none]> {
- if '%thisRegion%' == '__global__' {
- define flagObj '<s@dRegions_Flag_%flag%.yaml_key[flag_globalDefault]||none>/all'
}
else {
- define flagObj '<s@dRegions_Flag_%flag%.yaml_key[flag_regionDefault]||none>/all'
}
}
- define c '<proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].after[/].before[/]>|%thisRegion%|%world%|%player%]>'
# - define a '<t[<def[flagObj].starts_with[deny]>]:<def[c].not>||%c%>'
- if <def[flagObj].starts_with[deny]> {
- define a '<def[c].not>'
}
else {
- define a '%c%'
}
- yaml set 'cache.sg.%thisRegion%.%flag%.%prefix%.%uuid%:%a%' 'id:dRegions_%world%_cache'
- goto 'a'
}
- define s '<def[orderedRegions].size>'
- foreach '%orderedRegions%':
- define thisRegion '%value%'
- if <yaml[dRegions_%world%_cache].contains[cache.sg.%thisRegion%.%flag%.%prefix%.%uuid%]> {
- define a '<yaml[dRegions_%world%_cache].read[cache.sg.%thisRegion%.%flag%.%prefix%.%uuid%]>'
- if '%a%' == 'none' {
- define a 'true'
- foreach next
}
- goto 'a'
}
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%flag%]>/all'
- if %loop_index% != %s% {
- if <def[flagObj].starts_with[none]> {
- define a 'true'
- yaml set 'cache.sg.%thisRegion%.%flag%.%prefix%.%uuid%:none' 'id:dRegions_%world%_cache'
- foreach next
}
}
- if <def[flagObj].starts_with[none]> {
- if '%thisRegion%' == '__global__' {
- define flagObj '<s@dRegions_Flag_%flag%.yaml_key[flag_globalDefault]||none>/all'
}
else {
- define flagObj '<s@dRegions_Flag_%flag%.yaml_key[flag_regionDefault]||none>/all'
}
}
- define c '<proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].after[/].before[/]>|%thisRegion%|%world%|%player%]>'
# - define a '<t[<def[flagObj].starts_with[deny]>]:<def[c].not>||%c%>'
- if <def[flagObj].starts_with[deny]> {
- define a '<def[c].not>'
}
else {
- define a '%c%'
}
- yaml set 'cache.sg.%thisRegion%.%flag%.%prefix%.%uuid%:%a%' 'id:dRegions_%world%_cache'
- foreach stop
- mark 'a'
- if %sameRegion% {
- flag %player% 'dRegions.rateLimit.%flag%:%a%'
}
- mark 'b'
- if '%a%' || <def[overRide].exists> {
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'event-allowed' {
- inject 's@dRegions_Flag_%flag%' 'p:event-allowed'
}
- foreach next
- queue clear
}
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'msg_cancelled' {
- if <def[player].has_flag[dRegions.Message_Cooldown].not> {
- flag %player% dRegions.Message_Cooldown duration:3s
- run s@msgPrefixed delay:1t 'player:%player%' 'def:dRegions|<&c><&o><parse:<s@dRegions_Flag_%flag%.yaml_key[msg_cancelled]||null>>'
}
}
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'event-cancelled' {
- inject 's@dRegions_Flag_%flag%' 'p:event-cancelled'
}
- if <def[noCancel].exists> {
- foreach next
- queue clear
}
- determine cancelled
#
# END sg
#---------------------------------------
#
# State-withTargetString-withGroup
#
dRegions_Flags_Processors_stsg:
type: task
debug: false
script:
- define thisRegion '<def[orderedRegions].get[1]>'
- if '<def[eLoc].cuboids>' == '<def[player].location.cuboids>' {
- define sameRegion 'true'
- if <def[player].has_flag[dRegions.rateLimit.%flag%.%target%]> {
- define a '<def[player].flag[dRegions.rateLimit.%flag%.%target%]>'
- goto 'b'
}
}
else {
- define sameRegion 'false'
}
- define uuid '<def[player].uuid>'
- define prefix '<def[uuid].substring[1,2]>'
- define listflag '<s@dRegions_Flag_%flag%.yaml_key[flag_targetList]||null>'
- if '<s@dRegions_Flag_%flag%.yaml_key[region_highestOnly]||false>' {
- if <yaml[dRegions_%world%_cache].contains[cache.stsg.%thisRegion%.%flag%.%target%.%prefix%.%uuid%]> {
- define a '<yaml[dRegions_%world%_cache].read[cache.stsg.%thisRegion%.%flag%.%target%.%prefix%.%uuid%]>'
- goto 'a'
}
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%flag%]>/all'
- define targetList '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%listflag%].split_by[<def[delimiter]||, >]>'
# - define default '<tern[<def[thisRegion].is[==].to[__global__]>]:globalDefault||regionDefault>'
- if '%thisRegion%' == '__global__' {
- define default 'globalDefault'
}
else {
- define default 'regionDefault'
}
- if <def[flagObj].starts_with[none]> {
- define flagObj '<s@dRegions_Flag_%flag%.yaml_key[flag_%default%]||none>/all'
}
- if '%targetList%' == 'li@none' {
- define targetList '<s@dRegions_Flag_%listflag%.yaml_key[flag_%default%].split_by[<def[delimiter]||, >]||none>'
}
- define c '<def[targetList].contains_any[none|all|%target%].and[<proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].after[/].before[/]>|%thisRegion%|%world%|%player%]>]>'
- if <def[flagObj].starts_with[deny]> {
- define a '<def[c].not>'
}
else {
- define a '%c%'
}
- yaml set 'cache.stsg.%thisRegion%.%flag%.%target%.%prefix%.%uuid%:%a%' 'id:dRegions_%world%_cache'
- goto 'a'
}
- define targetlist 'li@none'
- define s '<def[orderedRegions].size>'
- foreach '%orderedRegions%':
- define thisRegion '%value%'
- if <yaml[dRegions_%world%_cache].contains[cache.stsg.%thisRegion%.%flag%.%target%.%prefix%.%uuid%]> {
- define a '<yaml[dRegions_%world%_cache].read[cache.stsg.%thisRegion%.%flag%.%target%.%prefix%.%uuid%]>'
- if '%a%' == 'none' {
- define a 'true'
- foreach next
}
- goto 'a'
}
- if '%targetList%' == 'li@none' {
- define targetList '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%listflag%].split_by[<def[delimiter]||, >]>'
}
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%flag%]>/all'
- if %loop_index% != %s% {
- if <def[flagObj].starts_with[none]> {
- define a 'true'
- yaml set 'cache.stsg.%thisRegion%.%flag%.%target%.%prefix%.%uuid%:none' 'id:dRegions_%world%_cache'
- foreach next
}
}
# - define default '<tern[<def[thisRegion].is[==].to[__global__]>]:globalDefault||regionDefault>'
- if '%thisRegion%' == '__global__' {
- define default 'globalDefault'
}
else {
- define default 'regionDefault'
}
- if <def[flagObj].starts_with[none]> {
- define flagObj '<s@dRegions_Flag_%flag%.yaml_key[flag_%default%]||none>/all'
}
- if '%targetList%' == 'li@none' {
- define targetList '<s@dRegions_Flag_%listflag%.yaml_key[flag_%default%].split_by[<def[delimiter]||, >]||none>'
}
- define c '<def[targetList].contains_any[none|all|%target%].and[<proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].after[/].before[/]>|%thisRegion%|%world%|%player%]>]>'
- if <def[flagObj].starts_with[deny]> {
- define a '<def[c].not>'
}
else {
- define a '%c%'
}
- yaml set 'cache.stsg.%thisRegion%.%flag%.%target%.%prefix%.%uuid%:%a%' 'id:dRegions_%world%_cache'
- foreach stop
- mark 'a'
- if %sameRegion% {
- flag %player% 'dRegions.rateLimit.%flag%.%target%:%a%'
}
- mark 'b'
- if '%a%' || <def[overRide].exists> {
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'event-allowed' {
- inject 's@dRegions_Flag_%flag%' 'p:event-allowed'
}
- foreach next
- queue clear
}
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'msg_cancelled' {
- if <def[player].has_flag[dRegions.Message_Cooldown].not> {
- flag %player% dRegions.Message_Cooldown duration:3s
- run s@msgPrefixed delay:1t 'player:%player%' 'def:dRegions|<&c><&o><parse:<s@dRegions_Flag_%flag%.yaml_key[msg_cancelled]||null>>'
}
}
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'event-cancelled' {
- inject 's@dRegions_Flag_%flag%' 'p:event-cancelled'
}
- if <def[noCancel].exists> {
- foreach next
- queue clear
}
- determine cancelled
#
# END stsg
#---------------------------------------
#
# Testing an alternate method. This process took an average of 1ms longer AND lackd the ability to set a cache at every level.
# test_boolean:
# - if '<s@dRegions_Flag_%flag%.yaml_key[region_highestOnly]||false>' {
# - define f '<proc[dRegions_FlagLookup_H].context[%flag%|%eLoc%]>'
# }
# else {
# - define f '<proc[dRegions_FlagLookup_O].context[%flag%|%eLoc%]>'
# }
# - define a '<def[f].before[/]>'
# - define thisRegion '<def[f].after[/]>'
# - if '%a%' == 'false' {
# - yaml set 'cache.test_boolean.%thisRegion%.%flag%:false' 'id:dRegions_%world%_cache'
# - if '<s@dRegions_Flag_%flag%.list_keys>' contains 'event-cancelled' {
# - inject 's@dRegions_Flag_%flag%' 'p:event-cancelled'
# }
# - if <def[noCancel].exists> {
# - foreach next
# - queue clear
# }
# - determine cancelled
# }
# - yaml set 'cache.test_boolean.%thisRegion%.%flag%:true' 'id:dRegions_%world%_cache'
# - if '<s@dRegions_Flag_%flag%.list_keys>' contains 'event-allowed' {
# - inject 's@dRegions_Flag_%flag%' 'p:event-allowed'
# }
#
#dRegions_Flags_Processors_b:
# type: task
# debug: false
# script:
# - if '<s@dRegions_Flag_%flag%.yaml_key[region_highestOnly]||false>' {
# - define thisRegion '<def[orderedRegions].get[1]>'
# - if <yaml[dRegions_%world%_cache].contains[cache.b.%thisRegion%.%flag%]> {
# - define a '<yaml[dRegions_%world%_cache].read[cache.b.%thisRegion%.%flag%]>'
# - goto 'a'
# }
# - define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%flag%]>'
# - if '%flagObj%' == 'none' {
# - if '%thisRegion%' == '__global__' {
# - define flagObj '<s@dRegions_Flag_%flag%.yaml_key[flag_globalDefault]||none>'
# }
# else {
# - define flagObj '<s@dRegions_Flag_%flag%.yaml_key[flag_regionDefault]||none>'
# }
# }
# - if '%flagObj%' == 'false' {
# - define a 'false'
# }
# else {
# - define a 'true'
# }
# - yaml set 'cache.b.%thisRegion%.%flag%:%a%' 'id:dRegions_%world%_cache'
# - goto 'a'
# }
# - define s '<def[orderedRegions].size>'
# - foreach '%orderedRegions%':
# - define thisRegion '%value%'
# - if <yaml[dRegions_%world%_cache].contains[cache.b.%thisRegion%.%flag%]> {
# - define a '<yaml[dRegions_%world%_cache].read[cache.b.%thisRegion%.%flag%]>'
# - if '%a%' == 'none' {
# - define a 'true'
# - foreach next
# }
# - goto 'a'
# }
# - define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%flag%]>'
# - if '%loop_index%' != '%s%' {
# - if '%flagObj%' == 'none' {
# - define a 'true'
# - yaml set 'cache.b.%thisRegion%.%flag%:none' 'id:dRegions_%world%_cache'
# - foreach next
# }
# - define a '%flagObj%'
# - yaml set 'cache.b.%thisRegion%.%flag%:%a%' 'id:dRegions_%world%_cache'
# - goto 'a'
# }
# - if '%flagObj%' == 'none' {
# - if '%thisRegion%' == '__global__' {
# - define flagObj '<s@dRegions_Flag_%flag%.yaml_key[flag_globalDefault]||none>'
# }
# else {
# - define flagObj '<s@dRegions_Flag_%flag%.yaml_key[flag_regionDefault]||none>'
# }
# }
# - if '%flagObj%' == 'false' {
# - define a 'false'
# }
# else {
# - define a 'true'
# }
# - yaml set 'cache.b.%thisRegion%.%flag%:%a%' 'id:dRegions_%world%_cache'
# - mark 'a'
# - if '%a%' {
# - if '<s@dRegions_Flag_%flag%.list_keys>' contains 'event-allowed' {
# - inject 's@dRegions_Flag_%flag%' 'p:event-allowed'
# }
# - foreach next
# - queue clear
# }
# - if '<s@dRegions_Flag_%flag%.list_keys>' contains 'msg_cancelled' {
# - if <def[player].has_flag[dRegions.Message_Cooldown].not> {
# - flag %player% dRegions.Message_Cooldown duration:3s
# - run s@msgPrefixed delay:1t 'player:%player%' 'def:dRegions|<&c><&o><parse:<s@dRegions_Flag_%flag%.yaml_key[msg_cancelled]||null>>'
# }
# }
# - if '<s@dRegions_Flag_%flag%.list_keys>' contains 'event-cancelled' {
# - inject 's@dRegions_Flag_%flag%' 'p:event-cancelled'
# }
# - if <def[noCancel].exists> {
# - foreach next
# - queue clear
# }
# - determine cancelled
#---------------------------------------
#
# Boolean
#
dRegions_Flags_Processors_b:
type: task
debug: false
script:
- define thisRegion '<def[orderedRegions].get[1]>'
- if '<s@dRegions_Flag_%flag%.yaml_key[region_highestOnly]||false>' {
- define a '<yaml[dRegions_%world%_cache].read[cache.b.%thisRegion%.%flag%]||a>'
- goto '%a%'
- mark 'a'
- define a '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%flag%]>'
- if '%a%' == 'none' {
- if '%thisRegion%' == '__global__' {
- define a '<s@dRegions_Flag_%flag%.yaml_key[flag_globalDefault]||none>'
}
else {
- define a '<s@dRegions_Flag_%flag%.yaml_key[flag_regionDefault]||none>'
}
}
- if '%a%' != 'false' {
- define a 'true'
}
- yaml set 'cache.b.%thisRegion%.%flag%:%a%' 'id:dRegions_%world%_cache'
- goto '%a%'
}
- define s '<def[orderedRegions].size>'
- foreach '%orderedRegions%':
- define thisRegion '%value%'
- define a '<yaml[dRegions_%world%_cache].read[cache.b.%thisRegion%.%flag%]||b>'
- goto '%a%'
- mark 'none'
- define a 'true'
- foreach next
- mark 'b'
- define a '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%flag%]>'
- if '%loop_index%' != '%s%' {
- yaml set 'cache.b.%thisRegion%.%flag%:%a%' 'id:dRegions_%world%_cache'
- goto '%a%'
- mark 'none'
- define a 'true'
- foreach next
}
- if '%a%' == 'none' {
- if '%thisRegion%' == '__global__' {
- define a '<s@dRegions_Flag_%flag%.yaml_key[flag_globalDefault]||none>'
}
else {
- define a '<s@dRegions_Flag_%flag%.yaml_key[flag_regionDefault]||none>'
}
}
- if '%a%' != 'false' {
- define a 'true'
}
- yaml set 'cache.b.%thisRegion%.%flag%:%a%' 'id:dRegions_%world%_cache'
- goto '%a%'
- mark 'false'
- if <def[overRide].exists> {
- goto 'true'
}
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'msg_cancelled' {
- if <def[player].has_flag[dRegions.Message_Cooldown].not> {
- flag %player% dRegions.Message_Cooldown duration:3s
- run s@msgPrefixed delay:1t 'player:%player%' 'def:dRegions|<&c><&o><parse:<s@dRegions_Flag_%flag%.yaml_key[msg_cancelled]||null>>'
}
}
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'event-cancelled' {
- inject 's@dRegions_Flag_%flag%' 'p:event-cancelled'
}
- if <def[noCancel].exists> {
- foreach next
- queue clear
}
- determine cancelled
- mark 'true'
- if '<s@dRegions_Flag_%flag%.list_keys>' contains 'event-allowed' {
- inject 's@dRegions_Flag_%flag%' 'p:event-allowed'
}
#
# END boolean
#---------------------------------------
#
dRegions_Flags_Processors_string:
type: task
debug: false
script:
# It is possible to send messages for /any/ dRegions event. Just make a new string flag.
- define thisRegion '<def[orderedRegions].get[1]>'
- if '<s@dRegions_Flag_%flag%.yaml_key[region_highestOnly]||false>' {
- define val '<proc[dRegions_GetInheritedFlag].context[%world%|%thisRegion%|%flag%]>'
- if '%val%' != 'none' {
- goto 'DISPLAY'
}
- goto 'END'
}
- foreach '%orderedRegions%' {
- define thisRegion '%value%'
- define val '<proc[dRegions_GetInheritedFlag].context[%world%|%value%|%flag%]>'
- if '%val%' != 'none' {
- goto 'DISPLAY'
}
}
- if '%val%' == 'none' {
- goto 'END'
}
- mark 'DISPLAY'
- define val '<def[val].replace[<&pc>name<&pc>].with[<def[player].name>].parse_color.replace[<<>].replace[<>>]>'
- choose '<s@dRegions_Flag_%flag%.yaml_key[string_type]||narrate>':
- case 'narrate':
- run s@msgPrefixed 'def:dRegions|%val%'
- case 'bossbar':
- adjust %player% 'action_bar:%val%'
- case 'console':
- announce to_console '<&4>[<&6>dRegions<&4>] %val%'
- case 'title':
- define title '<def[val].before[/]>'
- define sub '<def[val].after[/]>'
- title 'title:<def[title]>' 'subtitle:<def[sub]>'
- mark 'END'
#
# END string
#---------------------------------------
#
dRegions_Flags_Processors_custom:
type: task
debug: false
script:
- inject 's@dRegions_Flag_%flag%' 'p:event'
#
#
# END custom
#---------------------------------------
#
dRegions_Flags_Processors_number:
type: task
debug: false
script:
- inject 's@dRegions_Flag_%flag%' 'p:event'
#
#
# END number
#---------------------------------------
#
dRegions_Flags_Processors_location:
type: task
debug: false
script:
- inject 's@dRegions_Flag_%flag%' 'p:event'
#
#
# END location
#---------------------------------------
#
#
#
# END Region Flag Processors
#---------------------------------------
#
################################################################################
#
# stg Flag Scripts
#
dRegions_Flag_PVE:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>PVE<&4>]"
lore:
- <&5>Can players damage mobs
event_hooks: player_damage_entity
event_priority: 10
event_player: attacker
event_target: defender
region_highestOnly: true
flag_type: stg
flag_name: PVE
flag_targetList: PVE-Moblist
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to damage mobs in this region. Defaults to allow all. Use pve-moblist flag to specify mob types. Takes the -g group switch.
msg_cancelled: 'You can not attack <def[target].to_lowercase.replace[_].with[ ]>s here!'
event-cancelled:
- remove <c.projectile||li@>
dRegions_Flag_Mob-Damage:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Mob-Damage<&4>]"
lore:
- <&5>Can mobs damage players
event_hooks: entity_damage_player
event_priority: 10
event_player: defender
event_target: attacker
region_highestOnly: true
flag_type: stg
flag_name: Mob-Damage
flag_targetList: Mob-DamageList
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether mobs will be able to damage players in this region. Defaults to allow all. Use mob-damagelist flag to specify mob types. Takes the -g group switch.
event-cancelled:
- remove <c.projectile||li@>
- attack %object% target:cancel
- if <yaml[dRegions_global_config].read[config.regions.invincibility-confuses-mobs]||false> && <yaml[dRegions_%world%_config].read[config.regions.invincibility-confuses-mobs]||false> {
- run delay:1t locally wander 'def:%object%|%world%'
}
else if <yaml[dRegions_global_config].read[config.regions.invincibility-removes-mobs]||false> && <yaml[dRegions_%world%_config].read[config.regions.invincibility-removes-mobs]||false> {
- remove %object%
}
wander:
- ^adjust %1% has_ai:false
- ^repeat 5 {
- ^if !<def[1].is_spawned||false> {
- queue clear
}
- ~walk %1% '<def[1].location.find.surface_blocks.within[10].filter[distance[<def[1].location>].horizontal.is[more].than[5]].random.add[0,1,0]>'
}
- ^if !<def[1].is_spawned||false> queue clear
- ^if <yaml[dRegions_global_config].read[config.regions.invincibility-removes-mobs]||false> && <yaml[dRegions_%2%_config].read[config.regions.invincibility-removes-mobs]||false> {
- remove %object%
}
else {
- adjust %1% has_ai:false
}
dRegions_Flag_Mob-Target:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Mob-Target<&4>]"
lore:
- <&5>Can mobs target players
event_hooks: entity_target_player
event_priority: 0
event_target: attacker
event_player: defender
region_highestOnly: true
flag_type: stg
flag_name: Mob-Target
flag_targetList: Mob-TargetList
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether mobs will be able to target players in this region. Defaults to allow all. Use mob-target flag to specify mob types. Takes the -g group switch.
event-cancelled:
- attack %object% target:cancel
- if <yaml[dRegions_global_config].read[config.regions.invincibility-confuses-mobs]||false> && <yaml[dRegions_%world%_config].read[config.regions.invincibility-confuses-mobs]||false> {
- run delay:1t locally wander 'def:%object%|%world%'
}
else if <yaml[dRegions_global_config].read[config.regions.invincibility-removes-mobs]||false> && <yaml[dRegions_%world%_config].read[config.regions.invincibility-removes-mobs]||false> {
- remove %object%
}
wander:
- ^adjust %1% has_ai:false
- ^repeat 5 {
- ^if !<def[1].is_spawned||false> {
- queue clear
}
- ~walk %1% '<def[1].location.find.surface_blocks.within[10].filter[distance[<def[1].location>].horizontal.is[more].than[5]].random.add[0,1,0]>'
}
- ^if !<def[1].is_spawned||false> queue clear
- ^if <yaml[dRegions_global_config].read[config.regions.invincibility-removes-mobs]||false> && <yaml[dRegions_%2%_config].read[config.regions.invincibility-removes-mobs]||false> {
- remove %object%
}
else {
- adjust %1% has_ai:false
}
dRegions_Flag_Entity-Interact:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Entity Interact<&4>]"
lore:
- <&5>Can players interact with entities
event_hooks: player_interact_entity
event_priority: 10
region_highestOnly: true
flag_type: stg
flag_name: Entity-Interact
flag_targetList: Entity-Interactlist
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to interact with entities in this region. Defaults to allow all. Use entity-interactlist flag to specify entity types. Takes the -g group switch.
msg_cancelled: 'You can not interact with <def[target].to_lowercase.replace[_].with[ ]>s here!'
dRegions_Flag_Block-Place:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Block-Place<&4>]"
lore:
- <&5>Can players place blocks.
event_hooks: player_place_block
event_priority: 5
region_highestOnly: true
flag_type: stg
flag_name: Block-Place
flag_targetList: Block-PlaceList
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to place blocks in this region. Defaults to allow all. Use block-placelist flag to specify block types. Takes the -g group switch.
msg_cancelled: 'You can not place <def[target].to_lowercase.replace[_].with[ ]> in this region!'
dRegions_Flag_Block-Break:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Block-Break<&4>]"
lore:
- <&5>Can players break blocks.
event_hooks: player_break_block
event_priority: 5
region_highestOnly: true
flag_type: stg
flag_name: Block-Break
flag_targetList: Block-BreakList
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to break blocks in this region. Defaults to allow all. Use block-breaklist flag to specify block types. Takes the -g group switch.
msg_cancelled: 'You can not break <def[target].to_lowercase.replace[_].with[ ]> in this region!'
dRegions_Flag_Chest-Access:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Chest-Access<&4>]"
lore:
- <&5>Can players open containers.
event_hooks: player_interact_container
event_priority: 10
region_highestOnly: true
flag_type: stg
flag_name: Chest-Access
flag_targetList: chest-access-blocks
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to open containers in this region. Defaults to deny nonmembers. Use chest-access-blocks flag to specify container blocks types. Takes the -g group switch.
msg_cancelled: 'You can not open <def[target].to_lowercase.replace[_].with[ ]>s in this region!'
dRegions_Flag_Door-Access:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Door-Access<&4>]"
lore:
- <&5>Can players open doors.
event_hooks: player_interact_door
event_priority: 10
region_highestOnly: true
flag_type: stg
flag_name: Door-Access
flag_targetList: Door-Access-Doors
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to open doors in this region. Defaults to allow all. Use door-access-doors flag to specify door blocks types. Takes the -g group switch.
msg_cancelled: 'You can not open <def[target].to_lowercase.replace[_].with[ ]>s in this region!'
dRegions_Flag_Use-Switches:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Use-Switches<&4>]"
lore:
- <&5>Can players interact with switches.
event_hooks: player_interact_switches
event_priority: 10
region_highestOnly: true
flag_type: stg
flag_name: Use-Switches
flag_targetList: Use-Switches-List
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to use switches in this region. Defaults to deny nonmembers. Use use-switches-list flag to specify switch block types. Takes the -g group switch.
msg_cancelled: 'You can not use <def[target].to_lowercase.replace[_].with[ ]>s in this region!'
dRegions_Flag_Use-Utilities:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Use-Utilities<&4>]"
lore:
- <&5>Can players use utility blocks.
event_hooks: player_interact_utilityBlocks
event_priority: 10
region_highestOnly: true
flag_type: stg
flag_name: Use-Utilities
flag_targetList: Use-Utilities-Blocks
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to use utility blocks in this region. Defaults to deny nonmembers. Use use-utilities-blocks flag to specify utility blocks. Takes the -g group switch.
msg_cancelled: 'You can not use <def[target].to_lowercase.replace[_].with[ ]>s in this region!'
dRegions_Flag_Player-Damage:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Player-Damage<&4>]"
lore:
- <&5>Can players take damage.
event_hooks: player_damaged
event_priority: 10
region_highestOnly: false
flag_type: stg
flag_name: Player-Damage
flag_targetList: Player-Damage-Types
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will take damage in this region. Defaults to allow all. Use player-damage-types flag to specify damage types. Takes the -g group switch.
event-cancelled:
- adjust %player% 'fire_time:0'
#
# END stg
#---------------------------------------
#
################################################################################
#
# st Flag Scripts
#
dRegions_Flag_Mob-Spawn:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Mob-Spawn<&4>]"
lore:
- <&5>Can mobs Spawn
event_hooks: entity_spawn
event_priority: 10
region_highestOnly: false
flag_type: st
flag_name: Mob-Spawn
flag_targetList: Mob-SpawnList
flag_takeGroup: false
flag_regionDefault: allow
flag_globalDefault: allow
flag_help: State flag controlling whether mobs will be able to spawn in this region. Defaults to allow all. Use mob-spawnlist flag to specify mob types.
dRegions_Flag_EVE:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>EVE<&4>]"
lore:
- <&5>Can mobs be targeted
event_hooks: entity_target_entity|entity_damage_entity|entity_damage_armorstand
event_priority: 10
event_target: defender
region_highestOnly: false
flag_type: st
flag_name: EVE
flag_targetList: EVE-Moblist
flag_takeGroup: false
flag_regionDefault: allow
flag_globalDefault: allow
flag_help: State flag controlling whether mobs can be targeted for attack by other mobs in this region. Defaults to allow. Use eve-moblist flag to specify mob types.
event-cancelled:
- remove <c.projectile||li@>
- attack %attacker% target:cancel
- if <yaml[dRegions_global_config].read[config.regions.invincibility-confuses-mobs]||false> && <yaml[dRegions_%world%_config].read[config.regions.invincibility-confuses-mobs]||false> {
- run delay:1t locally wander 'def:%object%|%world%'
}
else if <yaml[dRegions_global_config].read[config.regions.invincibility-removes-mobs]||false> && <yaml[dRegions_%world%_config].read[config.regions.invincibility-removes-mobs]||false> {
- remove %object%
}
wander:
- ^adjust %1% has_ai:false
- ^repeat 5 {
- ^if !<def[1].is_spawned||false> {
- queue clear
}
- ~walk %1% '<def[1].location.find.surface_blocks.within[10].filter[distance[<def[1].location>].horizontal.is[more].than[5]].random.add[0,1,0]>'
}
- ^if !<def[1].is_spawned||false> queue clear
- ^if <yaml[dRegions_global_config].read[config.regions.invincibility-removes-mobs]||false> && <yaml[dRegions_%2%_config].read[config.regions.invincibility-removes-mobs]||false> {
- remove %object%
}
else {
- adjust %1% has_ai:false
}
dRegions_Flag_Mob-Attack:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Mob-Attack<&4>]"
lore:
- <&5>Can mobs attack other mobs
event_hooks: entity_target_entity|entity_damage_entity|entity_damage_armorstand
event_priority: 20
event_target: attacker
region_highestOnly: false
flag_type: st
flag_name: Mob-Attack
flag_targetList: Mob-Attack-Moblist
flag_takeGroup: false
flag_regionDefault: allow
flag_globalDefault: allow
flag_help: State flag controlling whether mobs can attack other mobs in this region. Defaults to allow. Use mob-attack-moblist flag to specify mob types.
event-cancelled:
- remove <c.projectile||li@>
- attack %attacker% target:cancel
- if <yaml[dRegions_global_config].read[config.regions.invincibility-confuses-mobs]||false> && <yaml[dRegions_%world%_config].read[config.regions.invincibility-confuses-mobs]||false> {
- run delay:1t locally wander 'def:%object%|%world%'
}
else if <yaml[dRegions_global_config].read[config.regions.invincibility-removes-mobs]||false> && <yaml[dRegions_%world%_config].read[config.regions.invincibility-removes-mobs]||false> {
- remove %object%
}
wander:
- ^adjust %1% has_ai:false
- ^repeat 5 {
- ^if !<def[1].is_spawned||false> {
- queue clear
}
- ~walk %1% '<def[1].location.find.surface_blocks.within[10].filter[distance[<def[1].location>].horizontal.is[more].than[5]].random.add[0,1,0]>'
}
- ^if !<def[1].is_spawned||false> queue clear
- ^if <yaml[dRegions_global_config].read[config.regions.invincibility-removes-mobs]||false> && <yaml[dRegions_%2%_config].read[config.regions.invincibility-removes-mobs]||false> {
- remove %object%
}
else {
- adjust %1% has_ai:false
}
dRegions_Flag_Entity-Explode:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Entity-Explode<&4>]"
lore:
- <&5>Can entities explode
event_hooks: entity_explode
event_priority: 10
region_highestOnly: false
flag_type: st
flag_name: Entity-Explode
flag_targetList: Entity-ExplodeList
flag_takeGroup: false
flag_regionDefault: allow
flag_globalDefault: allow
flag_help: State flag controlling whether entities will be able to explode in this region. Defaults to allow all. Use entity-explodelist flag to specify entities types.
event-allowed:
# Block explosions from effecting neighboring dregions
# - define blocks '<c.blocks.filter[is_within[<def[orderedRegions].get[1].replace[regex:^].with[cu@dregions_%world%_].as_cuboid>]]>'
- define cuboids '<c.location.cuboids>'
- define thisR '<def[orderedRegions].get[1]>'
- define global '<yaml[dRegions_%world%_regions].read[regions.__global__.priority]||0>/__global__'
- define final 'li@'
- foreach '<c.blocks>':
- define l '%value%'
- if '%cuboids%' != '<def[l].cuboids>' {
- define r 'li@%global%'
- foreach '<def[l].cuboids.filter[starts_with[cu@dregions_%world%]].parse[after[cu@dregions_%world%_]]>' {
- define r '%r%|<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%'
}
- if '%thisR%' != '<def[r].alphanumeric.reverse.parse[after[/]].get[1]>' {
- foreach next
}
}
- define final '<def[final].include[%l%]>'
- determine '%final%'
dRegions_Flag_Entity-Grief:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Entity-Grief<&4>]"
lore:
- <&5>Can entities alter blocks
event_hooks: entity_change_block|entity_form_block
event_priority: 10
region_highestOnly: false
flag_type: st
flag_name: Entity-Grief
flag_targetList: Entity-GriefList
flag_takeGroup: false
flag_regionDefault: deny
flag_globalDefault: allow
flag_help: State flag controlling whether entities will be able to alter blocks in this region. Defaults to allow all. Use entity-grieflist flag to specify entities types.
event-allowed:
- if <def[object].is_spawned> {
- flag %object% 'dRegions.EntityGrief:true' d:5s
}
event-cancelled:
- if <def[object].is_spawned> {
- flag %object% 'dRegions.EntityGrief:false' d:5s
}
dRegions_Flag_Entity-Drops-OnDeath:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Entity-Drops-OnDeath<&4>]"
lore:
- <&5>Can mobs drop items
event_hooks: entity_dies
event_priority: 10
region_highestOnly: false
flag_type: st
flag_name: Entity-Drops-OnDeath
flag_targetList: Entity-Drops-OnDeathList
flag_takeGroup: false
flag_regionDefault: allow
flag_globalDefault: allow
event-cancelled:
- determine NO_DROPS
dRegions_Flag_Fire-Spread:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Fire-Spread<&4>]"
lore:
- <&5>Can fire spread
event_hooks: firefrom_spread
event_priority: 10
region_highestOnly: false
flag_type: st
flag_name: Fire-Spread
flag_targetList: Fire-SpreadBlocks
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: allow
flag_help: State flag controlling whether fire will be able to spread in this region. Defaults to allow all. Use fire-spreadblocks flag to specify blocks to check when spreading.
dRegions_Flag_Fire-Destroy:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Fire-Destroy<&4>]"
lore:
- <&5>Can fire destroy blocks
event_hooks: block_burns
event_priority: 10
region_highestOnly: false
flag_type: st
flag_name: Fire-Destroy
flag_targetList: Fire-DestroyBlocks
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: allow
flag_help: State flag controlling whether fire will be able to spread to and destroy blocks in this region. Defaults to allow all. Use fire-destroyblocks flag to specify blocks to check when spreading.
dRegions_Flag_Lightning-Strikes:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Lightning-Strikes<&4>]"
lore:
- <&5>Can lightning strike
event_hooks: lightning_strikes
event_priority: 10
region_highestOnly: false
flag_type: st
flag_name: Lightning-Strikes
flag_targetList: Lightning-StrikesBlocks
flag_takeGroup: false
flag_regionDefault: allow
flag_globalDefault: allow
flag_help: State flag controlling whether lightning will be able to strike in this region. Defaults to allow all. Use lightning-strikeblocks flag to specify blocks to check when striking.
dRegions_Flag_Water-Spread:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Water-Spread<&4>]"
lore:
- <&5>Can Water spread
event_hooks: water_spread
event_priority: 10
region_highestOnly: false
flag_type: st
flag_name: Water-Spread
flag_targetList: Water-SpreadBlocks
flag_takeGroup: false
flag_regionDefault: allow
flag_globalDefault: allow
flag_help: State flag controlling whether water will be able to spread in this region. Defaults to allow all. Use water-spreadblocks flag to specify blocks to check when spreading.
dRegions_Flag_Lava-Spread:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Lava-Spread<&4>]"
lore:
- <&5>Can Lava spread
event_hooks: lava_spread
event_priority: 10
region_highestOnly: false
flag_type: st
flag_name: Lava-Spread
flag_targetList: Lava-SpreadBlocks
flag_takeGroup: false
flag_regionDefault: allow
flag_globalDefault: allow
flag_help: State flag controlling whether lava will be able to spread in this region. Defaults to allow all. Use lava-spreadblocks flag to specify blocks to check when spreading.
dRegions_Flag_Snow-Fall:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Snow-Fall<&4>]"
lore:
- <&5>Can Snow accumulate
event_hooks: blockform_snow
event_priority: 10
region_highestOnly: false
flag_type: st
flag_name: Snow-Fall
flag_targetList: Snow-FallBlocks
flag_takeGroup: false
flag_regionDefault: allow
flag_globalDefault: allow
flag_help: State flag controlling whether snow will be able to accumulate on the ground in this region. Defaults to allow all. Use snow-fallblocks flag to specify blocks below the snow to check when forming.
#
# END st
#---------------------------------------
#
################################################################################
#
# sg Flag Scripts
#
dRegions_Flag_Entry:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Entry<&4>]"
lore:
- <&5>Who can enter a region
event_hooks: player_enters_region
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Entry
flag_help: State flag controlling who can enter a region. Can be set to allow, deny, or none and accepts the -g group switch.
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
msg_cancelled: 'You may not enter this area!'
event-allowed:
- flag %player% 'dRegions.rateLimit:!'
- flag %player% 'dRegions.%world%.%thisRegion%.entry-overRide:!'
event-cancelled:
- if <def[player].is_inside_vehicle> {
- run locally vehicle 'def:<def[player].get_vehicle>|<c.from>' delay:1t
}
vehicle:
- ^if <def[player].has_flag[dRegions.rateLimit.regionKick]> {
- queue clear
}
- ^flag %player% dRegions.rateLimit.regionKick d:5t
- ^mount cancel %player%|%1%
- ^teleport '%player%' '<def[2].above>'
- ^wait 20t
- ^adjust %1% 'velocity:l@0,0,0,<def[1].world>'
- ^teleport %1% '<t[<def[1].is_living>]:<def[player].location>||<def[2].above>>'
dRegions_Flag_Exit:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Exit<&4>]"
lore:
- <&5>Who can exit a region
event_hooks: player_exits_region
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Exit
flag_help: State flag controlling who can exit a region. Can be set to allow, deny, or none and accepts the -g group switch.
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
msg_cancelled: 'You may not exit this area!'
event-allowed:
- flag %player% 'dRegions.rateLimit:!'
- flag %player% 'dRegions.%world%.%thisRegion%.exit-overRide:!'
event-cancelled:
- if <def[player].is_inside_vehicle> {
- run locally vehicle 'def:<def[player].get_vehicle>|<c.from>' delay:1t
}
vehicle:
- ^if <def[player].has_flag[dRegions.rateLimit.regionKick]> {
- queue clear
}
- ^flag %player% dRegions.rateLimit.regionKick d:5t
- ^mount cancel %player%|%1%
- ^teleport '%player%' '<def[2].above>'
- ^wait 20t
- ^adjust %1% 'velocity:l@0,0,0,<def[1].world>'
- ^teleport %1% '<t[<def[1].is_living>]:<def[player].location>||<def[2].above>>'
dRegions_Flag_Exit-Via-Teleport:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Exit-Via-Teleport<&4>]"
lore:
- <&5>Who can exit a region via teleport
event_hooks: player_teleports_fromRegion
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Exit-Via-Teleport
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to teleport out of a region. Defaults to allow all. Takes the -g group switch.
msg_cancelled: 'You can not teleport from this region!'
dRegions_Flag_Enter-Via-Teleport:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Enter-Via-Teleport<&4>]"
lore:
- <&5>Who can exit a region via teleport
event_hooks: player_teleports_toRegion
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Enter-Via-Teleport
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to teleport into a region. Defaults to allow all. Takes the -g group switch.
msg_cancelled: 'You can not teleport to this region!'
dRegions_Flag_Exit-Override:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Exit-Override<&4>]"
lore:
- <&5>
event_hooks: player_exits_region
event_priority: -1
region_highestOnly: true
flag_type: sg
flag_name: Exit-Override
flag_takeGroup: true
flag_regionDefault: deny/all
flag_globalDefault: deny/all
flag_help: State flag controling who can override exit deny. Defaults to deny all. Takes the -g group switch.
event-allowed:
- if !<def[player].has_flag[dRegions.%world%.%thisRegion%.exit-overRide]> {
- flag %player% 'dRegions.%world%.%thisRegion%.exit-overRide'
}
event-cancelled:
- foreach next
- queue clear
dRegions_Flag_Entry-Override:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Entry-Override<&4>]"
lore:
- <&5>
event_hooks: player_enters_region
event_priority: -1
region_highestOnly: true
flag_type: sg
flag_name: Entry-Override
flag_takeGroup: true
flag_regionDefault: deny/all
flag_globalDefault: deny/all
flag_help: State flag controling who can override entry deny. Defaults to deny all. Takes the -g group switch.
event-allowed:
- if !<def[player].has_flag[dRegions.%world%.%thisRegion%.entry-overRide]> {
- flag %player% 'dRegions.%world%.%thisRegion%.entry-overRide' d:2s
}
event-cancelled:
- foreach next
- queue clear
dRegions_Flag_Build:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Build<&4>]"
lore:
- <&5>Override default build perms
event_hooks: player_place_block|player_break_block|player_place_hanging|player_break_hanging|player_interact_blocks|player_interact_itemframe|player_damage_itemframe|player_use_spawnegg|player_place_armorstand|player_interact_armorstand|player_damage_armorstand|player_throw_hatchingegg|player_empty_bucket|player_fill_bucket|player_extinguish_blockfire|player_use_bonemeal
event_priority: 0
event_player: attacker
event_target: defender
region_highestOnly: true
flag_type: sg
flag_name: Build
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: By default, all members and owners can build in their regions. Setting this flag can over ride that behavior. Can be set to allow, deny, or none and accepts the -g group switch.
msg_cancelled: 'You do not have permission to build in this region!'
dRegions_Flag_Receive-Chat:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Receive-Chat<&4>]"
lore:
- <&5>Who can hear chat
event_hooks: player_entered_dregion|player_exited_dregion
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Receive-Chat
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: Control who can hear chat in a region. Takes the -g group switch.
event-cancelled:
- if %isEnter% {
- if !<server.flag[dRegions.Chat.Deaf].as_list.contains[%player%]||false> {
- flag server 'dRegions.Chat.Deaf:->:%player%'
}
}
else {
- flag server 'dRegions.Chat.Deaf:<-:%player%'
}
dRegions_Flag_Send-Chat:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Send-Chat<&4>]"
lore:
- <&5>Who can chat
event_hooks: player_chats
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Send-Chat
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: Control who can send chat in a region. Takes the -g group switch.
msg_cancelled: 'You can not chat here.'
event-allowed:
- determine 'recipients:<context.recipients.exclude[<server.flag[dRegions.Chat.Deaf].as_list||li@>]>'
dRegions_Flag_Hunger:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Hunger<&4>]"
lore:
- <&5>Who can get hungry
event_hooks: player_change_foodlevel
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Hunger
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: Control whether players will loose hunger in this region. Takes the -g group switch.
dRegions_Flag_Npc-Interact:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>NPC Interact<&4>]"
lore:
- <&5>Can players interact with NPCs
event_hooks: player_interact_npc
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Npc-Interact
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to interact with NPCs in this region. Defaults to allow. Takes the -g group switch.
msg_cancelled: 'You can not interact with NPCs here!'
dRegions_Flag_Lighter:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Lighter<&4>]"
lore:
- <&5>Who can use the flint and steel in a region
# event_hooks: player_use_lighter
event_hooks: fireFrom_flint_and_steel
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Lighter
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to use lighters in this region. Defaults to allow. Takes the -g group switch.
msg_cancelled: 'You can not use a lighter in this region!'
dRegions_Flag_Bucket-Fill:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Bucket-Fill<&4>]"
lore:
- <&5>Who can fill a bucket in a region
event_hooks: player_fill_bucket
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Bucket-Fill
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to fill buckets in this region. Defaults to allow. Takes the -g group switch.
msg_cancelled: 'You can not fill a bucket in this region!'
dRegions_Flag_Bucket-Empty:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Bucket-Empty<&4>]"
lore:
- <&5>Who can empty a bucket in a region
event_hooks: player_empty_bucket
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Bucket-Empty
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to empty buckets in this region. Defaults to allow. Takes the -g group switch.
msg_cancelled: 'You can not empty a bucket in this region!'
dRegions_Flag_Hanging-Place:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Hanging-Place<&4>]"
lore:
- <&5>Who can place item frames and paintings
event_hooks: player_place_hanging
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Hanging-Place
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to place item frames and paintings in this region. Defaults to allow. Takes the -g group switch.
msg_cancelled: 'You can not hang that in this region!'
dRegions_Flag_Hanging-Break:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Hanging-Break<&4>]"
lore:
- <&5>Who can break item frames and paintings
event_hooks: player_break_hanging
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Hanging-Break
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to break item frames and paintings in this region. Defaults to allow. Takes the -g group switch.
msg_cancelled: 'You can not break that in this region!'
dRegions_Flag_Sleep:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Sleep<&4>]"
lore:
- <&5>Who can Sleep
event_hooks: player_enters_bed
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Sleep
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to enter beds in this region. Defaults to allow. Takes the -g group switch.
msg_cancelled: 'You can not sleep here!'
dRegions_Flag_Player-Drops:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Player-Drops<&4>]"
lore:
- <&5>Who can drop items
event_hooks: player_drops_item
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Player-Drops
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to drop items from their inventory in this region. Defaults to allow. Takes the -g group switch.
msg_cancelled: 'You can not drop items in this region!'
dRegions_Flag_Player-Drops-OnDeath:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Player-Drops-OnDeath<&4>]"
lore:
- <&5>Who can drop items when they die
event_hooks: player_dies
event_priority: 10
region_highestOnly: true
flag_type: sg
flag_name: Player-Drops-OnDeath
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will drop items when they die in this region. Defaults to allow. Takes the -g group switch.
event-cancelled:
- determine NO_DROPS
dRegions_Flag_Player-KeepItems:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Player-KeepItems<&4>]"
lore:
- <&5>Can players keep items on death
event_hooks: player_dies
event_priority: 5
region_highestOnly: true
flag_type: sg
flag_name: Player-KeepItems
flag_takeGroup: true
flag_regionDefault: deny/all
flag_globalDefault: deny/all
flag_help: State flag controlling whether players will keep their items when they die in a region. Default is to deny all. Takes the -g group switch.
event-allowed:
- run locally returnItems 'player:%player%' 'def:<def[player].inventory.list_contents.escaped>|<def[player].equipment.escaped>' delay:2t
- determine NO_DROPS_NO_XP
event-cancelled:
# Temporary fix! We should be setting noCancel so the flag processor knows
# not to try to determine cancelled, which funny enough in the entity dies
# event changes the player death message. WHOOPS!
- foreach next
- queue clear
returnItems:
- inventory clear
- run s@msgPrefixed delay:1t 'def:dRegions|<&9>You died, but your inventory is safe!'
- inventory set 'd:<player.inventory>' 'o:<def[1].unescaped>'
- define equipment '<def[2].unescaped>'
- equip <player> 'boots:<def[equipment].get[1]||i@air>' 'legs:<def[equipment].get[2]||i@air>' 'chest:<def[equipment].get[3]||i@air>' 'head:<def[equipment].get[4]||i@air>'
dRegions_Flag_Player-Pickup:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Player-Pickup<&4>]"
lore:
- <&5>Who can pickup items
event_hooks: player_pickup_item
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Player-Pickup
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to pickup items in this region. Defaults to allow. Takes the -g group switch.
msg_cancelled: 'You can not pick up items in this region!'
dRegions_Flag_Potion-Drink:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Potion-Drink<&4>]"
lore:
- <&5>Who can drink potions
event_hooks: player_drink_potion
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Potion-Drink
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to drink potions in this region. Defaults to allow. Takes the -g group switch.
msg_cancelled: 'You can not drink potions here!'
dRegions_Flag_Enderpearl:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Enderpearl<&4>]"
lore:
- <&5>Who can use enderpearls
event_hooks: player_teleport_via_enderpearl
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Enderpearl
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to teleport with enderpearls in this region. Defaults to allow. Takes the -g group switch.
msg_cancelled: 'You can not use enderpearls here!'
dRegions_Flag_Chorusfruit:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Chorusfruit<&4>]"
lore:
- <&5>Who can use Chorusfruit
event_hooks: player_teleport_via_chorusfruit
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Chorusfruit
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to teleport with chorus_fruit in this region. Defaults to allow. Takes the -g group switch.
msg_cancelled: 'You can not use chorus fruit here!'
dRegions_Flag_Vehicle-Place:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Vehicle-Place<&4>]"
lore:
- <&5>Who can place vehicles
event_hooks: player_place_vehicle
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Vehicle-Place
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to place vehicles in this region. Defaults to allow. Takes the -g group switch.
msg_cancelled: 'You can not place vehicles here!'
dRegions_Flag_Vehicle-Destroy:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Vehicle-Destroy<&4>]"
lore:
- <&5>Who can destroy vehicles
event_hooks: player_break_vehicle
event_priority: 0
region_highestOnly: true
flag_type: sg
flag_name: Vehicle-Destroy
flag_takeGroup: true
flag_regionDefault: deny/nonmembers
flag_globalDefault: allow/all
flag_help: State flag controlling whether players will be able to break vehicles in this region. Defaults to allow. Takes the -g group switch.
msg_cancelled: 'You can not break vehicles here!'
dRegions_Flag_Fly:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Fly<&4>]"
lore:
- <&5>Who can can fly
event_hooks: player_entered_dregion|player_exited_dregion
event_priority: 40
region_highestOnly: true
flag_type: sg
flag_name: Fly
flag_takeGroup: true
flag_regionDefault: deny/all
flag_globalDefault: deny/all
flag_help: Enable flight in a region. Takes the -g group switch.
# entered and exited dregion events are already set to noCancel
# event-cancelled:
# - foreach next
# - queue clear
event-allowed:
- if %isEnter% {
- if !<def[player].can_fly> {
- flag <def[player]> 'dRegions.%world%.%region%.can_fly'
- adjust <def[player]> 'can_fly:true'
- if <def[player].has_flag[dRegions.Message_Cooldown].not> {
- flag <def[player]> dRegions.Message_Cooldown duration:3s
- run s@msgPrefixed instantly 'def:dRegions|<&a>You are able to fly in this region!'
}
}
}
else {
- if <def[player].has_flag[dRegions.%world%.%region%.can_fly]> {
- flag <def[player]> 'dRegions.%world%.%region%.can_fly:!'
- flag <def[player]> 'dRegions.fly.noFallDamage'
- adjust <def[player]> 'can_fly:false'
- if <def[player].has_flag[dRegions.Message_Cooldown].not> {
- flag <def[player]> dRegions.Message_Cooldown duration:3s
- run s@msgPrefixed instantly 'def:dRegions|<&a>Flight has been disabled!'
}
}
}
#
# END sg
#---------------------------------------
#
################################################################################
#
# stsg Flag Scripts
#
dRegions_Flag_Commands:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Commands<&4>]"
lore:
- <&5>Can players use commands.
event_hooks: player_command
event_priority: 0
region_highestOnly: false
flag_type: stsg
flag_name: Commands
flag_targetList: Commands-List
flag_takeGroup: true
flag_regionDefault: allow/all
flag_globalDefault: allow/all
flag_help: State flag controlling whether players can use commands in this region. Defaults to allow all. Use commands-list flag to specify commands. Takes the -g group switch.
msg_cancelled: 'You can not use the %1% <&c>command in this region!'
#
# END stsg
#---------------------------------------
#
################################################################################
#
# Boolean Flag Scripts
#
dRegions_Flag_Notify-Enter:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Notify-Enter<&4>]"
lore:
- <&5>Send notification to marked players
event_hooks: player_entered_dregion
event_priority: 5
flag_type: b
flag_takeGroup: false
flag_defaultValue: false
flag_help: Boolean flag controlling whether notifications are sent for entering this region. Set to true or false. Defaults to false.
event-allowed:
- foreach <server.list_online_players.filter[permission[dregions.notify]].include[<server.list_online_ops>].deduplicate> {
- run s@msgPrefixed player:%value% 'def:dRegions|<&5><&o><def[player].name> entered %thisRegion% in %world%'
}
dRegions_Flag_Notify-Exit:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Notify-Exit<&4>]"
lore:
- <&5>Send notification to marked players
event_hooks: player_exited_dregion
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Notify-Exit
flag_takeGroup: false
flag_regionDefault: false
flag_globalDefault: false
flag_help: Boolean flag controlling whether notifications are sent for exiting this region. Set to true or false. Defaults to false.
event-allowed:
- foreach <server.list_online_players.filter[permission[dregions.notify]].include[<server.list_online_ops>].deduplicate> {
- run s@msgPrefixed player:%value% 'def:dRegions|<&5><&o><def[player].name> exited %thisRegion% in %world%'
}
dRegions_Flag_Ice-Form:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Ice-Form<&4>]"
lore:
- <&5>Can water turn into ice
event_hooks: blockform_ice
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Ice-Form
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether ice can form in this region. Set to true or false. Defaults to true.
dRegions_Flag_Lava-Fire:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Lava-Fire<&4>]"
lore:
- <&5>Can lava cause fires
event_hooks: firefrom_lava
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Lava-Fire
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether lava can cause fires in this region. Set to true or false. Defaults to true.
dRegions_Flag_Ice-Melt:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Ice-Melt<&4>]"
lore:
- <&5>Can ice melt
event_hooks: blockfade_ice
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Ice-Melt
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether ice can melt in this region. Set to true or false. Defaults to true.
dRegions_Flag_Snow-Melt:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Snow-Melt<&4>]"
lore:
- <&5>Can snow melt
event_hooks: blockfade_snow
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Snow-Melt
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether snow can melt in this region. Set to true or false. Defaults to true.
dRegions_Flag_Soil-Dry:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Soil-Dry<&4>]"
lore:
- <&5>Can soil dry up
event_hooks: blockfade_soil
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Soil-Dry
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether soil can dry in this region. Set to true or false. Defaults to true.
dRegions_Flag_Trample-Crops-Player:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Trample-Crops-Player<&4>]"
lore:
- <&5>Can players trample crops
event_hooks: player_trample_crops
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Trample-Crops-Player
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether players can trample crops in this region. Set to true or false. Defaults to true.
dRegions_Flag_Trample-Crops-Entity:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Trample-Crops-Entity<&4>]"
lore:
- <&5>Can entities trample crops
event_hooks: entity_trample_crops
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Trample-Crops-Entity
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether entities can trample crops in this region. Set to true or false. Defaults to true.
dRegions_Flag_Mushroom-Spread:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Mushroom-Spread<&4>]"
lore:
- <&5>Can Mushrooms spread
event_hooks: blockspread_mushroom
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Mushroom-Spread
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether mushrooms will be able to spread in this region. Set to true or false. Defaults to true.
dRegions_Flag_Grass-Spread:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Grass-Spread<&4>]"
lore:
- <&5>Can Grass spread
event_hooks: blockspread_grass
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Grass-Spread
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether grass will be able to spread in this region. Set to true or false. Defaults to true.
dRegions_Flag_Mycel-Spread:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Mycel-Spread<&4>]"
lore:
- <&5>Can Mycelium spread
event_hooks: blockspread_mycel
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Mycel-Spread
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether mycelium will be able to spread in this region. Set to true or false. Defaults to true.
dRegions_Flag_Vines-Spread:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Vine-Growth<&4>]"
lore:
- <&5>Can Vines grow
event_hooks: blockspread_vine
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Vine-Growth
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether vines will be able to grow in this region. Set to true or false. Defaults to true.
dRegions_Flag_Leaf-Decay:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Leaf-Decay<&4>]"
lore:
- <&5>Can leaves decay
event_hooks: blockfade_leaves
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Leaf-Decay
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether leaves will be able to decay in this region. Set to true or false. Defaults to true.
dRegions_Flag_Falling-Sand:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Falling-Sand<&4>]"
lore:
- <&5>Can sand fall
event_hooks: falling_sand
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Falling-Sand
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether sand will be able to fall in this region. Set to true or false. Defaults to true.
event-allowed:
- flag <c.entity> 'dRegions.EntityGrief:true' d:1s
event-cancelled:
- modifyblock %eLoc% sand no_physics
- remove <c.entity>
dRegions_Flag_Falling-Gravel:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Falling-Gravel<&4>]"
lore:
- <&5>Can gravel fall
event_hooks: falling_gravel
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Falling-Gravel
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether gravel will be able to fall in this region. Set to true or false. Defaults to true.
event-allowed:
- flag <c.entity> 'dRegions.EntityGrief:true' d:1s
event-cancelled:
- modifyblock %eLoc% gravel no_physics
- remove <c.entity>
dRegions_Flag_Pistons:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Pistons<&4>]"
lore:
- <&5>Can pistons be activated
event_hooks: piston_extend|piston_retract
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Pistons
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether pistons can be activated in this region. Set to true or false. Defaults to true.
dRegions_Flag_Entity-Break-Painting:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Entity-Break-Painting<&4>]"
lore:
- <&5>Can Entities break paintings
event_hooks: entity_break_painting
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Entity-Break-Painting
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether mobs will be able to destroy paintings in this region. Set to true or false. Defaults to true.
dRegions_Flag_Entity-Break-ItemFrame:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Entity-Break-ItemFrame<&4>]"
lore:
- <&5>Can Entities break item frames
event_hooks: entity_damage_itemframe
event_target: attacker
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Entity-Break-ItemFrame
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether mobs will be able to destroy item frames in this region. Set to true or false. Defaults to true.
dRegions_Flag_PVP:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>PVP<&4>]"
lore:
- <&5>Can players damage each other
event_hooks: player_damage_player
event_priority: 5
event_player: attacker
event_target: defender
region_highestOnly: false
flag_type: b
flag_name: PVP
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether players can attack eachother in this region. Set to true or false. Defaults to true.
msg_cancelled: 'You are in a no PVP zone.'
dRegions_Flag_Potion-Throw:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Potion-Throw<&4>]"
lore:
- <&5>Can potions be thrown in this region
event_hooks: potion_splash|player_throw_potion
event_priority: 5
region_highestOnly: false
flag_type: b
flag_name: Potion-Throw
flag_takeGroup: false
flag_regionDefault: true
flag_globalDefault: true
flag_help: Boolean flag controlling whether potions can be thrown and broken in this region. Set to true or false. Defaults to true.
event-cancelled:
# This flag handles players and non-players alike so we need to find out if it is a player before we send a message.
- if <def[player].equals_case_sensitive[null].not||false> {
- if <def[player].has_flag[dRegions.Message_Cooldown].not> {
- flag %player% dRegions.Message_Cooldown duration:3s
- run s@msgPrefixed delay:1t player:%player% 'def:dRegions|<&c><&o>You can not throw potions here!'
}
}
#
# END Boolean
#---------------------------------------
#
################################################################################
#
# String Flag Scripts
#
dRegions_Flag_Greeting:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Greeting<&4>]"
lore:
- <&5>Message on enter region
event_hooks: player_entered_dregion
event_priority: 10
region_highestOnly: true
flag_type: string
string_type: narrate
flag_name: Greeting
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: Set the greeting message for region entry.
dRegions_Flag_Farewell:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Farewell<&4>]"
lore:
- <&5>Message on exit region
event_hooks: player_exited_dregion
event_priority: 10
region_highestOnly: true
flag_type: string
string_type: narrate
flag_name: Farewell
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: Set the farewell message for region exit.
#
# END String
#---------------------------------------
#
################################################################################
#
# Custom Flag Scripts
# - Custom flags get a mostly raw event to work with
#
dRegions_Flag_Inventory:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Inventory<&4>]"
lore:
- <&5>Save inventory before going into a region
event_hooks: player_entered_dregion|player_exited_dregion
event_priority: 20
region_highestOnly: true
flag_type: custom
flag_type_customVal: unique|kit
flag_name: Inventory
flag_takeGroup: true
flag_regionDefault: none
flag_globalDefault: none
flag_help: Inventory flag can be set to unique or kit. Unique inventories start empty. Kit inventories use your current inventory.
command_handler:
- if <def[flagValue].is[==].to[kit]> {
- yaml set 'inventories.regions.%region%.entry.kit.equip:<def[player].equipment>' 'id:dRegions_%world%_inventories'
- yaml set 'inventories.regions.%region%.entry.kit.inv:<def[player].inventory.list_contents>' 'id:dRegions_%world%_inventories'
- yaml set 'inventories.regions.%region%.exit.players:|:' 'id:dRegions_%world%_inventories'
}
- if <def[flagValue].is[==].to[unique]> {
- yaml set 'inventories.regions.%region%.entry.players:|:' 'id:dRegions_%world%_inventories'
- yaml set 'inventories.regions.%region%.exit.players:|:' 'id:dRegions_%world%_inventories'
}
- if <def[flagValue].is[==].to[null]> {
- yaml set 'inventories.regions.%region%:!' 'id:dRegions_%world%_inventories'
}
- yaml 'savefile:dRegions/worlds/%world%/inventories.yml' 'id:dRegions_%world%_inventories'
event:
- if <def[player].gamemode.id> == '0' {
- goto 'end'
}
- define action '<t[%isEnter%]:enter||exit>'
- define region '<def[orderedRegions].get[1]>'
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%region%|%flag%]>'
- if <def[flagObj].equals_case_sensitive[none].not> {
- if <proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].split[/].get[2]||all>|%region%|%world%|%player%]> {
- inject locally <def[flagObj].split[/].get[1]>-%action%
}
}
- mark 'end'
kit-enter:
- yaml set 'inventories.regions.%region%.exit.players.<def[player].uuid>.equip:<def[player].equipment>' 'id:dRegions_%world%_inventories'
- yaml set 'inventories.regions.%region%.exit.players.<def[player].uuid>.inv:<def[player].inventory.list_contents>' 'id:dRegions_%world%_inventories'
- yaml 'savefile:dRegions/worlds/%world%/inventories.yml' 'id:dRegions_%world%_inventories'
- inventory clear
- inventory set 'd:<def[player].inventory>' 'o:<yaml[dRegions_%world%_inventories].read[inventories.regions.%region%.entry.kit.inv]||li@>'
- define equipment '<yaml[dRegions_%world%_inventories].read[inventories.regions.%region%.entry.kit.equip]||li@>'
- equip %player% 'boots:<def[equipment].get[1]||i@air>' 'legs:<def[equipment].get[2]||i@air>' 'chest:<def[equipment].get[3]||i@air>' 'head:<def[equipment].get[4]||i@air>'
- run s@msgPrefixed delay:1t 'def:dRegions|<&7><&o>Your inventory has been updated.'
kit-exit:
- define equipment '<yaml[dRegions_%world%_inventories].read[inventories.regions.%region%.exit.players.<def[player].uuid>.equip]||li@>'
- inventory clear
- inventory set 'd:<def[player].inventory>' 'o:<yaml[dRegions_%world%_inventories].read[inventories.regions.%region%.exit.players.<def[player].uuid>.inv]||li@>'
- equip %player% 'boots:<def[equipment].get[1]||i@air>' 'legs:<def[equipment].get[2]||i@air>' 'chest:<def[equipment].get[3]||i@air>' 'head:<def[equipment].get[4]||i@air>'
- yaml set 'inventories.regions.%region%.exit.players.<def[player].uuid>:!' 'id:dRegions_%world%_inventories'
- yaml 'savefile:dRegions/worlds/%world%/inventories.yml' 'id:dRegions_%world%_inventories'
- run s@msgPrefixed delay:1t 'def:dRegions|<&7><&o>Your inventory has been updated.'
unique-enter:
- yaml set 'inventories.regions.%region%.exit.players.<def[player].uuid>.equip:<def[player].equipment>' 'id:dRegions_%world%_inventories'
- yaml set 'inventories.regions.%region%.exit.players.<def[player].uuid>.inv:<def[player].inventory.list_contents>' 'id:dRegions_%world%_inventories'
- yaml 'savefile:dRegions/worlds/%world%/inventories.yml' 'id:dRegions_%world%_inventories'
- inventory clear
- inventory set 'd:<def[player].inventory>' 'o:<yaml[dRegions_%world%_inventories].read[inventories.regions.%region%.entry.players.<def[player].uuid>.inv]||li@>'
- define equipment '<yaml[dRegions_%world%_inventories].read[inventories.regions.%region%.entry.players.<def[player].uuid>.equip]||li@>'
- equip %player% 'boots:<def[equipment].get[1]||i@air>' 'legs:<def[equipment].get[2]||i@air>' 'chest:<def[equipment].get[3]||i@air>' 'head:<def[equipment].get[4]||i@air>'
- run s@msgPrefixed delay:1t 'def:dRegions|<&7><&o>Your inventory has been updated.'
unique-exit:
- yaml set 'inventories.regions.%region%.entry.players.<def[player].uuid>.equip:<def[player].equipment>' 'id:dRegions_%world%_inventories'
- yaml set 'inventories.regions.%region%.entry.players.<def[player].uuid>.inv:<def[player].inventory.list_contents>' 'id:dRegions_%world%_inventories'
- define equipment '<yaml[dRegions_%world%_inventories].read[inventories.regions.%region%.exit.players.<def[player].uuid>.equip]||li@>'
- inventory clear
- inventory set 'd:<def[player].inventory>' 'o:<yaml[dRegions_%world%_inventories].read[inventories.regions.%region%.exit.players.<def[player].uuid>.inv]||li@>'
- equip %player% 'boots:<def[equipment].get[1]||i@air>' 'legs:<def[equipment].get[2]||i@air>' 'chest:<def[equipment].get[3]||i@air>' 'head:<def[equipment].get[4]||i@air>'
- yaml set 'inventories.regions.%region%.exit.players.<def[player].uuid>:!' 'id:dRegions_%world%_inventories'
- yaml 'savefile:dRegions/worlds/%world%/inventories.yml' 'id:dRegions_%world%_inventories'
- run s@msgPrefixed delay:1t 'def:dRegions|<&7><&o>Your inventory has been updated.'
dRegions_Flag_Gamemode:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Gamemode<&4>]"
lore:
- <&5>Change gamemode inside a region
event_hooks: player_entered_dregion|player_exited_dregion
event_priority: 10
region_highestOnly: true
flag_type: custom
flag_type_customVal: creative|survival|adventure|spectator
flag_name: Gamemode
flag_takeGroup: true
flag_regionDefault: none
flag_globalDefault: none
flag_help: Gamemode flag can be set to creative, survival, adventure, or spectator
event:
- define region '<def[orderedRegions].get[1]>'
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%region%|%flag%]>'
- if <def[flagObj].starts_with[none].not> && <proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].split[/].get[2]||all>|%region%|%world%|%player%]> {
- if %isEnter% {
- define gm '<def[flagObj].split[/].get[1]>'
- flag %player% 'dRegions.%world%.%region%.PreviousGamemode:<def[player].gamemode>'
- if %gm% != <def[player].gamemode> {
- adjust %player% 'gamemode:%gm%'
- run s@msgPrefixed delay:1t 'def:dRegions|<&7><&o>Your gamemode has been updated.'
}
}
else {
- if <def[player].flag[dRegions.%world%.%region%.PreviousGamemode]||null> != <def[player].gamemode> {
- adjust %player% 'gamemode:<def[player].flag[dRegions.%world%.%region%.PreviousGamemode]||survival>'
- run s@msgPrefixed delay:1t 'def:dRegions|<&7><&o>Your gamemode has been updated.'
}
- flag %player% 'dRegions.%world%.%region%.PreviousGamemode:!'
}
}
dRegions_Flag_Weather-Lock:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Weather-Lock<&4>]"
lore:
- <&5>Set the weather
event_hooks: player_entered_dregion|player_exited_dregion
event_priority: 30
region_highestOnly: true
flag_type: custom
flag_type_customVal: clear|downfall
flag_name: Weather-Lock
flag_takeGroup: true
flag_regionDefault: none
flag_globalDefault: none
flag_help: Control what players see the weather as. Can be set to clear or downfall. Takes the -g group switch.
event:
- define region '<def[orderedRegions].get[1]>'
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%region%|%flag%]>'
- if <def[flagObj].starts_with[none].not> && <proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].split[/].get[2]||all>|%region%|%world%|%player%]> {
- if '%isEnter%' {
- adjust %player% 'weather:<def[flagObj].split[/].get[1]>'
}
else {
- adjust %player% 'reset_weather'
}
}
dRegions_Flag_Spawn:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Spawn<&4>]"
lore:
- <&5>Region spawn point.
event_hooks: player_dies
event_priority: 0
region_highestOnly: false
flag_type: location
flag_name: Spawn
flag_takeGroup: true
flag_regionDefault: none
flag_globalDefault: none
flag_help: Set the location players will respawn at if they die in this region. Default is to have no effect so normal respawn mechanics will apply. Takes the -g group switch. Specify the value as `here` to use your current location, or specify a valid location in the `x,y,z,world` format.
command_handler:
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_RegionOverlaps].context[<def[flagValue]>/<def[flagValue]>|%world%|<player>]> {
- run s@dRegions_Msg delay:1t 'def:<&c>You can not use that location!'
- queue clear
}
}
event:
- ^foreach %orderedRegions% {
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%value%|%flag%]>'
- if <def[flagObj].starts_with[none].not> && <proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].split[/].get[2]||all>|%value%|%world%|%player%]> {
- flag <player> 'dRegions.Respawn:<def[flagObj].split[/].get[1].as_location>'
- foreach stop
}
}
#
# END Custom
#---------------------------------------
#
################################################################################
#
# Number Flag Scripts
#
dRegions_Flag_Time-Lock:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Time-Lock<&4>]"
lore:
- <&5>Set the Time
event_hooks: player_entered_dregion|player_exited_dregion
event_priority: 30
region_highestOnly: true
flag_type: number
flag_name: Time-Lock
flag_takeGroup: true
flag_regionDefault: none
flag_globalDefault: none
flag_help: Control what players see the time as. Valid range is 0-23999. Use + or - to adjust the time relative to the current world time. Takes the -g group switch.
command_handler:
- if <def[flagValue].starts_with[+]> || <def[flagValue].starts_with[-]> {
- define d '<def[flagValue].replace[regex:[0-9]]>'
- define time '<def[flagValue].after[%d%]>'
}
else {
- define time '%flagValue%'
}
- if %time% !matches number || %time% < 0 || %time% > 23999 {
- run s@msgPrefixed 'def:dRegions|<&c>Valid time range is 0 - 23999!'
- queue clear
}
event:
- define region '<def[orderedRegions].get[1]>'
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%region%|%flag%]>'
- if <def[flagObj].starts_with[none].not> && <proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].split[/].get[2]||all>|%region%|%world%|%player%]> {
- define flagValue '<def[flagObj].split[/].get[1]>'
- define d '<def[flagValue].replace[regex:[0-9]]>'
- define time '<def[flagValue].after[%d%]>'
- define time '<t[<def[d].is[==].to[].not>]:<def[player].world.time.add[<def[flagObj].split[/].get[1].replace[+]||0>]>||%time%>'
- adjust %player% '<t[%isEnter%]:freeze_time<&co>%time%||reset_time>'
}
dRegions_Flag_Heal-Amount:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Heal-Amount<&4>]"
lore:
- <&5>The amount to heal or harm.
event_hooks: player_entered_dregion
event_priority: 30
region_highestOnly: true
flag_type: number
flag_name: Heal-Amount
flag_takeGroup: true
flag_regionDefault: none
flag_globalDefault: none
flag_help: Set the amount to heal or hurt a player while inside a region. Defaults to no effect. Positive number will heal players, negative numbers will damage players.
event:
- define region '<def[orderedRegions].get[1]>'
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%region%|heal-amount]>'
- if <def[flagObj].starts_with[none].not> && <proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].split[/].get[2]||all>|%region%|%world%|%player%]> {
- if <queue.exists[dRegions_Heal_<def[player].name>]> {
- queue 'q@dRegions_Heal_<def[player].name>' clear
}
- run locally healTask delay:1t 'player:%player%' 'def:%world%|%region%|<def[flagObj].split[/].get[1]>' id:dRegions_Heal_<def[player].name>
}
healTask:
- define player '<player>'
- define world '%1%'
- define region '%2%'
- define healAmount '%3%'
- define healDelay '<proc[dRegions_GetInheritedFlag].context[%1%|%2%|heal-delay]>'
- define healDelay '<el@1.max[<t[<def[healDelay].equals_case_sensitive[none]>]:5||%healDelay%>].as_int.as_duration>'
- define healMax '<proc[dRegions_GetInheritedFlag].context[%1%|%2%|heal-max]>'
- define healMax '<def[player].health.max.min[<t[<def[healMax].equals_case_sensitive[none]>]:20||%healMax%>]>'
- define healMin '<proc[dRegions_GetInheritedFlag].context[%1%|%2%|heal-min]>'
- define healMin '<t[<def[healMin].equals_case_sensitive[none]>]:0||%healMin%>'
- while '<def[player].is_online>':
- if <def[player].world.name.equals_case_sensitive[%1%].not> {
- while stop
}
- define regionPri 'li@'
- foreach <def[player].location.cuboids.filter[notable_name.starts_with[dRegions_]].parse[after[cu@dregions_%world%_]].include[__global__]> {
- define regionPri '%regionPri%<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%|'
}
- if <def[regionPri].alphanumeric.reverse.parse[after[/]].get[1].equals_case_sensitive[%2%].not> {
- while stop
}
- if <def[player].gamemode.id.equals_case_sensitive[1]> {
- wait 1s
- while next
}
# Instant heal/harm setting
- if %healDelay% == 0 {
- if %healAmount% MORE 0 {
- if <def[player].health> LESS %healMax% {
- define newHealth '<def[player].health.add[%healMax%]>'
- adjust %player% 'health:<tern[<def[newHealth].is[MORE].than[%healMax%]>]:%healMax%||%newHealth%>'
}
}
else {
- if <def[player].health> MORE %healMin% {
- animate %player% animation:hurt
- define newHealth '<def[player].health.add[%healAmount%]>'
- adjust %player% 'health:<tern[<def[newHealth].is[LESS].than[%healMin%]>]:%healMin%||%newHealth%>'
}
}
- wait 20t
- while next
}
# Normal delayed setting
- if %healAmount% MORE 0 {
- if <def[player].health> LESS %healMax% {
- define newHealth '<def[player].health.add[%healAmount%].min[<player.health.max>]>'
- adjust %player% 'health:<tern[<def[newHealth].is[MORE].than[%healMax%]>]:%healMax%||%newHealth%>'
}
}
else {
- if <def[player].health> MORE %healMin% {
- animate %player% animation:hurt
- define newHealth '<def[player].health.add[%healAmount%].min[0]>'
- adjust %player% 'health:<tern[<def[newHealth].is[LESS].than[%healMin%]>]:%healMin%||%newHealth%>'
}
}
- wait %healDelay%
dRegions_Flag_Heal-Delay:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Heal-Delay<&4>]"
lore:
- <&5>The duration between heal intervals
event_hooks: none
event_priority: 0
region_highestOnly: true
flag_type: number
flag_name: Heal-Delay
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: Set the time in seconds between heal intervals. Defaults to 5 seconds.
command_handler:
- if <def[flagValue].is[LESS].than[0]> {
- run s@msgPrefixed 'def:dRegions|<&c>Can not specify negative time!'
- queue clear
}
dRegions_Flag_Heal-Max:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Heal-Max<&4>]"
lore:
- <&5>Max health for heal flag.
event_hooks: none
event_priority: 0
region_highestOnly: true
flag_type: number
flag_name: Heal-Max
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: Set the max health that the heal flag will heal a player to. Defaults to 20.
command_handler:
- if !<def[flagValue].is[MORE].than[0]> {
- run s@msgPrefixed 'def:dRegions|<&c>Must be a value greater than 0!'
- queue clear
}
dRegions_Flag_Heal-Min:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Heal-Min<&4>]"
lore:
- <&5>Minimum health for heal flag
event_hooks: none
event_priority: 0
region_highestOnly: true
flag_type: number
flag_name: Heal-Min
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: Set the min health that the heal flag will heal a player to. Defaults to 0.
command_handler:
- if <def[flagValue].is[LESS].than[0]> {
- run s@msgPrefixed 'def:dRegions|<&c>Can not set to a negative number!'
- queue clear
}
dRegions_Flag_Feed-Amount:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Feed-Amount<&4>]"
lore:
- <&5>The amount to feed or starve.
event_hooks: player_entered_dregion
event_priority: 30
region_highestOnly: true
flag_type: number
flag_name: Feed-Amount
flag_takeGroup: true
flag_regionDefault: none
flag_globalDefault: none
flag_help: Set the amount to feed or starve a player while inside a region. Defaults to no effect. Positive numbers will feed players, negative numbers will starve players.
event:
- define region '<def[orderedRegions].get[1]>'
- define flagObj '<proc[dRegions_GetInheritedFlag].context[%world%|%region%|feed-amount]>'
- if <def[flagObj].starts_with[none].not> && <proc[dRegions_PlayerMatchRegionGroup].context[<def[flagObj].split[/].get[2]||all>|%region%|%world%|%player%]> {
- if <queue.exists[dRegions_Feed_<def[player].name>]> {
- queue 'q@dRegions_Feed_<def[player].name>' clear
}
- run locally feedTask delay:1t 'player:%player%' 'def:%world%|%region%|<def[flagObj].split[/].get[1]>' id:dRegions_Feed_<def[player].name>
}
feedTask:
- define player '<player>'
- define world '%1%'
- define region '%2%'
- define feedAmount '%3%'
- define feedDelay '<proc[dRegions_GetInheritedFlag].context[%1%|%2%|feed-delay]>'
- define feedDelay '<t[<def[feedDelay].equals_case_sensitive[none]>]:5||%feedDelay%>'
- define feedMax '<proc[dRegions_GetInheritedFlag].context[%1%|%2%|feed-max]>'
- define feedMax '<t[<def[feedMax].equals_case_sensitive[none]>]:20||%feedMax%>'
- define feedMin '<proc[dRegions_GetInheritedFlag].context[%1%|%2%|feed-min]>'
- define feedMin '<t[<def[feedMin].equals_case_sensitive[none]>]:0||%feedMin%>'
- while '<def[player].is_online>':
- if <def[player].world.name.equals_case_sensitive[%1%].not> {
- while stop
}
- define regionPri 'li@'
- foreach <def[player].location.cuboids.filter[notable_name.starts_with[dRegions_]].parse[after[cu@dregions_%world%_]].include[__global__]> {
- define regionPri '%regionPri%<yaml[dRegions_%world%_regions].read[regions.%value%.priority]||0>/%value%|'
}
- if <def[regionPri].alphanumeric.reverse.parse[after[/]].get[1].equals_case_sensitive[%2%].not> {
- while stop
}
- if <def[player].gamemode.id.equals_case_sensitive[1]> {
- wait 1s
- while next
}
# Instant feed/starve setting
- if %feedDelay% == 0 {
- if %feedAmount% MORE 0 {
- if <def[player].food_level> LESS %feedMax% {
- define newFood '<def[player].food_level.add[%feedMax%]>'
- adjust %player% 'food_level:<tern[<def[newFood].is[MORE].than[%feedMax%]>]:%feedMax%||%newFood%>'
- adjust %player% 'saturation:<def[player].food_level>'
}
}
else {
- if <def[player].food_level> MORE %feedMin% {
- animate %player% animation:hurt
- define newFood '<def[player].food_level.add[%feedAmount%]>'
- adjust %player% 'food_level:<tern[<def[newFood].is[LESS].than[%feedMin%]>]:%feedMin%||%newFood%>'
- adjust %player% 'saturation:<def[player].food_level>'
}
}
- wait 20t
- while next
}
# Normal delayed setting
- if %feedAmount% MORE 0 {
- if <def[player].food_level> LESS %feedMax% {
- define newFood '<def[player].food_level.add[%feedAmount%]>'
- adjust %player% 'food_level:<tern[<def[newFood].is[MORE].than[%feedMax%]>]:%feedMax%||%newFood%>'
- adjust %player% 'saturation:<def[player].food_level>'
}
}
else {
- if <def[player].food_level> MORE %feedMin% {
- animate %player% animation:hurt
- define newFood '<def[player].food_level.add[%feedAmount%]>'
- adjust %player% 'food_level:<tern[<def[newFood].is[LESS].than[%feedMin%]>]:%feedMin%||%newFood%>'
- adjust %player% 'saturation:<def[player].food_level>'
}
}
- wait %feedDelay%
dRegions_Flag_Feed-Delay:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Feed-Delay<&4>]"
lore:
- <&5>The duration between feed intervals
event_hooks: none
event_priority: 0
region_highestOnly: true
flag_type: number
flag_name: Feed-Delay
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: Set the time in seconds between feed intervals. Defaults to 5 seconds.
command_handler:
- if <def[flagValue].is[LESS].than[0]> {
- run s@msgPrefixed 'def:dRegions|<&c>Can not specify negative time!'
- queue clear
}
dRegions_Flag_Feed-Max:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Feed-Max<&4>]"
lore:
- <&5>Max food level
event_hooks: none
event_priority: 0
region_highestOnly: true
flag_type: number
flag_name: Feed-Max
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: Set the max food level that the feed-amount flag will bring a player to. Defaults to 20.
command_handler:
- if !<def[flagValue].is[MORE].than[0]> {
- run s@msgPrefixed 'def:dRegions|<&c>Must be a value greater than 0!'
- queue clear
}
dRegions_Flag_Feed-Min:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Feed-Min<&4>]"
lore:
- <&5>Minimum food level
event_hooks: none
event_priority: 0
region_highestOnly: true
flag_type: number
flag_name: Feed-Min
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: Set the min food level that the feed-amount flag will bring a player to. Defaults to 0.
command_handler:
- if <def[flagValue].is[LESS].than[0]> {
- run s@msgPrefixed 'def:dRegions|<&c>Can not set to a negative number!'
- queue clear
}
#
# END Number
#---------------------------------------
#
################################################################################
#
# List Flag Scripts
#
dRegions_Flag_Mob-TargetList:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Mob-Target<&4>]"
lore:
- <&5>List of mobs used by mob-targeting flag
command_entryType: mob
command_verifyEntry: <def[value].is[matches].to[entity].not>
flag_type: list
flag_parent: dRegions_Flag_Mob-Target
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with mob-targeting flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of mobs.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Mob-Damagelist:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Mob-DamageList<&4>]"
lore:
- <&5>List of mobs used by mob-damage flag
command_entryType: mob
command_verifyEntry: <def[value].is[matches].to[entity].not>
flag_type: list
flag_parent: dRegions_Flag_Mob-Damage
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with mob-damage flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of mobs.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Mob-SpawnList:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Mob-Spawnlist<&4>]"
lore:
- <&5>List of mobs used by mob-spawn flag
command_entryType: mob
command_verifyEntry: <def[value].is[matches].to[entity].not>
flag_type: list
flag_parent: dRegions_Flag_Mob-Spawn
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with mob-spawn flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of mobs.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_EVE-Moblist:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>EVE-Moblist<&4>]"
lore:
- <&5>List of mobs used by eve flag
command_entryType: mob
command_verifyEntry: <def[value].is[matches].to[entity].not>
flag_type: list
flag_parent: dRegions_Flag_EVE
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with eve flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of mobs.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Mob-Attack-Moblist:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Mob-Attack-Moblist<&4>]"
lore:
- <&5>List of mobs used by mob-attack flag
command_entryType: mob
command_verifyEntry: <def[value].is[matches].to[entity].not>
flag_type: list
flag_parent: dRegions_Flag_Mob-Attack
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with mob-attack flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of mobs.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_PVE-Moblist:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>PVE-Moblist<&4>]"
lore:
- <&5>List of mobs used by pve flag
command_entryType: mob
command_verifyEntry: <def[value].is[matches].to[entity].not>
flag_type: list
flag_parent: dRegions_Flag_PVE
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with pve flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of mobs.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Entity-Interactlist:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Entity Interact List<&4>]"
lore:
- <&5>List of entities used by entity-interact flag
command_entryType: mob
command_verifyEntry: <def[value].is[matches].to[entity].not>
flag_type: list
flag_parent: dRegions_Flag_Entity-Interact
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with entity-interact flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of entities.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Entity-ExplodeList:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Entity-Explodelist<&4>]"
lore:
- <&5>List of mobs used by entity-explode flag
command_entryType: entity
command_verifyEntry: <el@val[creeper|ender_crystal|ender_dragon|primed_tnt|minecart_tnt|fireball|small_fireball|wither|wither_skull].as_list.contains[<def[value]>].not>
flag_type: list
flag_parent: dRegions_Flag_Entity-Explode
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with entity-explode flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of entities. Valid entities<&co> creeper, ender_crystal, ender_dragon, primed_tnt, minecart_tnt, fireball, small_fireball, wither, wither_skull
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Entity-GriefList:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Entity-Grieflist<&4>]"
lore:
- <&5>List of mobs used by entity-grief flag
command_entryType: entity
command_verifyEntry: <el@val[enderman|sheep|zombie|squid].as_list.contains[<def[value]>].not>
flag_type: list
flag_parent: dRegions_Flag_Entity-Grief
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with entity-grief flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of entities. Valid entities<&co> sheep, enderman, zombie, squid
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Entity-Drops-OnDeathList:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Entity-Drops-OnDeathlist<&4>]"
lore:
- <&5>List of mobs used by entity-drops-ondeath flag
command_entryType: entity
command_verifyEntry: <def[value].is[matches].to[entity].not>
flag_type: list
flag_parent: dRegions_Flag_Entity-Drops-OnDeath
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with entity-drops-ondeath flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of entities.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Fire-SpreadBlocks:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Fire-Spread-BlockList<&4>]"
lore:
- <&5>List of blocks involved in fire spread
command_entryType: block
command_verifyEntry: <def[value].as_material.is_block.not||true>
flag_type: list
flag_parent: dRegions_Flag_Fire-Spread
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with fire-spread flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of blocks.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Fire-DestroyBlocks:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Fire-Destroy-BlockList<&4>]"
lore:
- <&5>List of blocks involved in fire-destroy
command_entryType: block
command_verifyEntry: <def[value].as_material.is_block.not||true>
flag_type: list
flag_parent: dRegions_Flag_Fire-Destroy
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with fire-destroy flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of blocks.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Lightning-StrikesBlocks:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Lightning-StrikesBlocks<&4>]"
lore:
- <&5>List of blocks involved in lightning strikes
command_entryType: block
command_verifyEntry: <def[value].as_material.is_block.not||true>
flag_type: list
flag_parent: dRegions_Flag_Lightning-Strikes
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with lightning-strike flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of blocks.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Water-SpreadBlocks:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Water-Spread-BlockList<&4>]"
lore:
- <&5>List of blocks involved in water spread
command_entryType: block
command_verifyEntry: <def[value].as_material.is_block.not||true>
flag_type: list
flag_parent: dRegions_Flag_Water-Spread
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with water-spread flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of blocks.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Lava-SpreadBlocks:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Lava-Spread-BlockList<&4>]"
lore:
- <&5>List of blocks involved in lava spread
command_entryType: block
command_verifyEntry: <def[value].as_material.is_block.not||true>
flag_type: list
flag_parent: dRegions_Flag_Lava-Spread
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with lava-spread flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of blocks.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Snow-FallBlocks:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Snow-Fall-BlockList<&4>]"
lore:
- <&5>List of blocks to check under snow
command_entryType: block
command_verifyEntry: <def[value].as_material.is_block.not||true>
flag_type: list
flag_parent: dRegions_Flag_Snow-Fall
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with snow-fall flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of blocks.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Block-PlaceList:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Block-PlaceList<&4>]"
lore:
- <&5>List of blocks used by block-place flag
command_entryType: block
command_verifyEntry: <def[value].as_material.is_block.not||true>
flag_type: list
flag_parent: dRegions_Flag_Block-Place
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with block-place flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of blocks.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Block-BreakList:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Block-BreakList<&4>]"
lore:
- <&5>List of blocks used by block-break flag
command_entryType: block
command_verifyEntry: <def[value].as_material.is_block.not||true>
flag_type: list
flag_parent: dRegions_Flag_Block-Break
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with block-break flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of blocks.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Chest-Access-Blocks:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Chest-Access-Blocks<&4>]"
lore:
- <&5>List of blocks used by chest-access flag
command_entryType: container
command_verifyEntry: <el@val[chest|ender_chest|locked_chest|trapped_chest|dispenser|hopper|dropper].as_list.contains[<def[value]>].not>
flag_type: list
flag_parent: dRegions_Flag_Chest-Access
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with chest-access flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of blocks. Valid container blocks<&co> chest, ender_chest, locked_chest, trapped_chest, dispenser, hopper, and dropper.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Door-Access-Doors:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Door-Access-Doors<&4>]"
lore:
- <&5>List of doors used by doors-access flag
command_entryType: door
command_verifyEntry: <el@val[trap_door|iron_trapdoor|wooden_door|iron_door_block|spruce_door|birch_door|jungle_door|dark_oak_door|acacia_door|fence_gate|spruce_fence_gate|birch_fence_gate|jungle_fence_gate|dark_oak_fence_gate|acacia_fence_gate].as_list.contains[<def[value]>].not>
flag_type: list
flag_parent: dRegions_Flag_Door-Access
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with door-access flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of blocks. Valid door blocks<&co> trap_door, iron_trapdoor, wooden_door, iron_door_block, spruce_door, birch_door, jungle_door, dark_oak_door, acacia_door, fence_gate, spruce_fence_gate, birch_fence_gate, jungle_fence_gate, dark_oak_fence_gate, and acacia_fence_gate.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Use-Switches-List:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Use-Switches-List<&4>]"
lore:
- <&5>List of switches used by use-switches flag
command_entryType: switch
command_verifyEntry: <el@val[lever|wood_button|stone_button|wood_plate|stone_plate|iron_plate|gold_plate].as_list.contains[<def[value]>].not>
flag_type: list
flag_parent: dRegions_Flag_Use-Switches
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with use-switches flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of blocks. Valid switch blocks<&co> lever, wood_button, stone_button, wood_plate, stone_plate, iron_plate, and gold_plate.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Use-Utilities-Blocks:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Use-Utilities-Blocks<&4>]"
lore:
- <&5>List of blocks used by use-utilities flag
command_entryType: utility
command_verifyEntry: <el@val[workbench|furnace|burning_furnace|anvil|cauldron|brewing_stand|enchantment_table|note_block|jukebox|beacon].as_list.contains[<def[value]>].not>
flag_type: list
flag_parent: dRegions_Flag_Use-Utilities
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with use-utilities flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of blocks. Valid utility blocks<&co> workbench, furnace, burning_furnace, anvil, brewing_stand, cauldron, enchantment_table, note_block, jukebox, and beacon.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Player-Damage-Types:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Player-Damage-Types<&4>]"
lore:
- <&5>List of damage types used by player-damage flag
command_entryType: cause
command_verifyEntry: <el@val[BLOCK_EXPLOSION|CONTACT|CUSTOM|DROWNING|ENTITY_ATTACK|ENTITY_EXPLOSION|FALL|FALLING_BLOCK|FIRE|FIRE_TICK|LAVA|LIGHTNING|MAGIC|MELTING|POISON|PROJECTILE|STARVATION|SUFFOCATION|SUICIDE|THORNS|VOID|WITHER].as_list.contains[<def[value]>].not>
flag_type: list
flag_parent: dRegions_Flag_Player-Damage
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with player-damage flag. To add to the list, use the -a switch. To remove from list use the -r switch. Provide a space separated list of damage types. Valid damage types<&co> block_explosion, contact, custom, drowning, entity_attack, entity_explosion, fall, falling_block, fire, fire_tick, lava, lightning, magic, melting, poison, projectile, starvation, suffocation, suicide, thorns, void, and wither.
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_verifiedList
dRegions_Flag_Commands-List:
type: item
debug: false
material: i@paper
display name: "<&4>[<&6>Commands-List<&4>]"
lore:
- <&5>List of commands used by commands flag
command_entryType: cause
flag_type: list
flag_parent: dRegions_Flag_Commands
flag_takeGroup: false
flag_regionDefault: none
flag_globalDefault: none
flag_help: List flag used with commands flag. To add to the list, use the -a switch. To remove from list use the -r switch. Add/remove one command at a time!
command_handler:
- inject s@dRegions_Flags_CommandProcessors p:command_stringList
# END List
#---------------------------------------
#
################################################################################
#
# THIS Flag Scripts
#
# END THIS
#---------------------------------------
#################################################################################
#
# dRegions Command Script Container
#
# This script covers all dRegions commands
#
# I haven't examined this in great detail since dRegions 0.2x. It's probably
# due for some revisions
#
#--------------------------------------
#
# dRegions Command Script Basics
#
# The basic stuff required in a command script container
#
dRegions_Commands:
type: command
debug: false
name: dregions
description: Denizen Regions Manager
usage: /dregions
aliases:
- drg
allowed help:
- determine true
commandArgs:
help:
usage: '/drg help <<>arg/<&ns><>>'
permissions: []
about:
usage: '/drg about'
permissions: []
reload:
usage: '/drg reload'
permissions:
- dregions.reload
restart:
usage: '/drg restart'
permissions:
- dregions.restart
define:
usage: '/drg define [ID] (g:group) (player)'
permissions:
- dregions.define
redefine:
usage: '/drg redefine [ID]'
permissions:
- dregions.redefine
- dregions.redefine.own.*
- dregions.redefine.own.%region%
- dregions.redefine.member.*
- dregions.redefine.member.%region%
claim:
usage: '/drg claim [ID]'
permissions: []
select:
usage: '/drg select [ID] -w world'
permissions: []
info:
usage: '/drg info [ID] -w world'
permissions:
- dregions.info
- dregions.info.own.*
- dregions.info.own.%region%
- dregions.info.member.*
- dregions.info.member.%region%
addowner:
usage: '/drg addowner [ID] g:group player -w world'
permissions:
- dregions.addowner
- dregions.addowner.own.*
- dregions.addowner.own.%region%
- dregions.addowner.member.*
- dregions.addowner.member.%region%
removeowner:
usage: '/drg removeowner [ID] g:group player -w world'
permissions:
- dregions.removeowner
- dregions.removeowner.own.*
- dregions.removeowner.own.%region%
- dregions.removeowner.member.*
- dregions.removeowner.member.%region%
addmember:
usage: '/drg addmember [ID] g:group player -w world'
permissions:
- dregions.addmember
- dregions.addmember.own.*
- dregions.addmember.own.%region%
- dregions.addmember.member.*
- dregions.addmember.member.%region%
removemember:
usage: '/drg removemember [ID] g:group player -w world'
permissions:
- dregions.removemember
- dregions.removemember.own.*
- dregions.removemember.own.%region%
- dregions.removemember.member.*
- dregions.removemember.member.%region%
list:
usage: '/drg list (page<&ns>) -h -r region -w world -p player'
permissions:
- dregions.list
- dregions.list.own.*
- dregions.list.own.%region%
- dregions.list.member.*
- dregions.list.member.%region%
flag:
usage: '/drg flag [ID] [flag] [value] -g group -w world'
permissions:
- dregions.flags.*
- dregions.flags.<def[flag]>
- dregions.flag
- dregions.flag.flags.*
- dregions.flag.flags.<def[flag]>
- dregions.flag.own.*
- dregions.flag.own.<def[region]>
- dregions.flag.member.*
- dregions.flag.member.<def[region]>
setpriority:
usage: '/drg setpriority [ID] [<&ns>]'
permissions:
- dregions.setpriority
- dregions.setpriority.own.*
- dregions.setpriority.own.%region%
- dregions.setpriority.member.*
- dregions.setpriority.member.%region%
setparent:
usage: '/drg setparent [ID] [parent]'
permissions:
- dregions.setparent
- dregions.setparent.own.*
- dregions.setparent.own.%region%
- dregions.setparent.member.*
- dregions.setparent.member.%region%
teleport:
usage: '/drg teleport [ID] -w world'
permissions:
- dregions.teleport
- dregions.teleport.own.*
- dregions.teleport.own.%region%
- dregions.teleport.member.*
- dregions.teleport.member.%region%
remove:
usage: '/drg remove [ID] -w world'
permissions:
- dregions.remove
- dregions.remove.own.*
- dregions.remove.own.%region%
- dregions.remove.member.*
- dregions.remove.member.%region%
wgimport:
usage: '/drg wgimport [world(s)] (-a)'
permissions:
- dregions.wgimport
tab complete:
- define args '<script.list_keys[commandArgs].alphanumeric.to_lowercase||li@>'
- define arg '<c.args.get[1]||null>'
- if <def[arg].is[==].to[null]>
|| !<def[args].contains[%arg%]> {
Line with no clear purpose - missing a -dash- or :colon:?
- inject locally tab_arg_1
}
else {
- inject locally tab_%arg%
}
- determine '<def[result]||li@>'
script:
- define command '<c.args.get[1].escaped||help>'
- define args '<script.list_keys[commandArgs].alphanumeric.to_lowercase||li@>'
- if !<def[args].contains[%command%]> {
- inject locally help
}
else {
- inject locally %command%
}
#
# END dRegions Command Script Basics
#--------------------------------------
#
# dRegions Command TAB Completion
#
# Each of these subscripts handles TAB completion for the positional argument.
#
#
tab_arg_1:
# This Excludes args from the original args
- foreach %args% {
- if !<player.permission[dregions.%value%]||<player.is_op||false>> {
- define args '<def[args].exclude[%value%]||%args%>'
}
}
- if <def[args].is_empty||true> {
- define result 'li@'
}
else {
- define result '<def[args].filter[starts_with[%arg%]]||li@>'
- if <def[result].is_empty||true> {
- define result '%args%'
}
}
tab_help:
- define spaces '<c.raw_args.to_list.count[ ]||0>'
- if <def[spaces].is[==].to[0]> {
- define result 'help [command]'
}
else if <def[spaces].is[==].to[1]> {
- define result 'li@'
- foreach %args% {
- if <player.permission[dregions.%value%]||<player.is_op||false>> {
- define result '<def[result].include[%value%]||%result%>'
}
else {
- foreach next
}
}
- if <c.args.get[2].is[!=].to[null]||false> {
- define result '<def[args].filter[starts_with[<c.args.get[2]>]]||li@>'
- if <def[result].is_empty> {
- foreach %args% {
- if <player.permission[dregions.%value%]||<player.is_op||false>> {
- define result '<def[result].include[%value%]||%result%>'
}
else {
- foreach next
}
}
}
}
}
tab_about:
- define result 'li@'
tab_reload:
- define result 'li@'
tab_restart:
- define result 'li@'
tab_define:
# /drg define [ID] (g:group) (player)
- if <player.permission[dregions.define]||<player.is_op||false>> {
- define spaces '<c.raw_args.to_list.count[ ]||0>'
- if <def[spaces].is[==].to[0]> {
- define result 'define [ID]'
}
else if <def[spaces].is[==].to[1]> {
- if <c.args.get[2].is[==].to[null]||true> {
- define result '[ID] (g:group) (player)'
}
else {
- define result '<c.args.get[2]> (g:group) (player)'
}
}
else if <def[spaces].is[OR_MORE].than[2]> {
- define owners '<c.args.remove[1|2]||li@>'
- if <c.args.find[-w].is[OR_MORE].than[0]||false> {
- define owners '<def[owners].remove[<def[owners].find[-w]>|<def[owners].find[-w].add[1].as_int>]||li@>'
}
- define owner '<def[owners].last||li@>'
- if <def[owner].starts_with[g:]||false> {
- define group '<def[owner].replace[g:]>'
- define groups '<server.list_permission_groups.filter[starts_with[%group%]]||li@>'
- if <def[groups].is_empty> {
- define groups '<server.list_permission_groups||li@>'
}
- define result '<def[groups].parse[replace[regex:^].with[g:]]>'
}
else {
- define result '<server.match_player[%owner%].name||null>'
- if <def[result].is[==].to[null]||true> {
- define result '<server.list_online_players.parse[name]>'
}
}
}
else {
- define result 'li@'
}
}
else {
- define result 'li@'
}
tab_redefine:
# /drg redefine [ID]
- if <player.permission[dregions.redefine]||<player.is_op||false>> {
- define spaces '<c.raw_args.to_list.count[ ]||0>'
- define world '<c.args.get[<c.args.find[-w].add[1].as_int>].escaped.as_world.name.to_lowercase||<player.world.name.to_lowercase||null>>'
- define regions '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
- if !<player.permission[dregions.admin]||<player.is_op||true>> {
- foreach %regions% {
- if <proc[dRegions_IsOwner].context[%value%|%world%|<player>].not> {
- define regions '<def[regions].exclude[%value%]||%regions%>'
}
}
}
- if <def[spaces].is[==].to[0]> {
- define result '<def[regions].parse[replace[regex:^].with[redefine ]]>'
}
else if <def[spaces].is[==].to[1]> {
- define result '<def[regions].filter[starts_with[<c.args.get[2].escaped>]]||li@>'
- if <def[result].is_empty||true> {
- define result '%regions%'
}
}
else {
- define result 'li@'
}
}
else {
- define result 'li@'
}
tab_claim:
- if <player.permission[dregions.claim]||<player.is_op||false>> {
- define spaces '<c.raw_args.to_list.count[ ]||0>'
- define world '<c.args.get[<c.args.find[-w].add[1].as_int>].escaped.as_world.name.to_lowercase||<player.world.name.to_lowercase||null>>'
- define regions '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- foreach %regions% {
- if <proc[dRegions_IsOwner].context[%value%|%world%|<player>].not> {
- define regions '<def[regions].exclude[%value%]||%regions%>'
}
}
}
- if <def[spaces].is[==].to[0]> {
- define result '<def[regions].parse[replace[regex:^].with[claim ]]>'
}
else if <def[spaces].is[==].to[1]> {
- define result '<def[regions].filter[starts_with[<c.args.get[2].escaped>]]||li@>'
- if <def[result].is_empty||true> {
- define result '%regions%'
}
}
else {
- define result 'li@'
}
}
else {
- define result 'li@'
}
tab_select:
# /drg select [ID] -w world
- if <player.permission[dregions.select]||<player.is_op||false>> {
- define spaces '<c.raw_args.to_list.count[ ]||0>'
- define world '<c.args.get[<c.args.find[-w].add[1].as_int>].escaped.as_world.name.to_lowercase||<player.world.name.to_lowercase||null>>'
- define regions '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- foreach %regions% {
- if <proc[dRegions_IsOwner].context[%value%|%world%|<player>].not> {
- define regions '<def[regions].exclude[%value%]||%regions%>'
}
}
}
- if <def[spaces].is[==].to[0]> {
- define result '<def[regions].parse[replace[regex:^].with[select ]]>'
}
else if <def[spaces].is[==].to[1]> {
- define result '<def[regions].filter[starts_with[<c.args.get[2].escaped||null>]]||li@>'
- if <def[result].is_empty||true> {
- define result '%regions%'
}
}
else {
- define result 'li@'
}
}
else {
- define result 'li@'
}
tab_info:
# /drg info [ID] -w world
- if <player.permission[dregions.info]||<player.is_op||false>> {
- define spaces '<c.raw_args.to_list.count[ ]||0>'
- define world '<c.args.get[<c.args.find[-w].add[1].as_int>].escaped.as_world.name.to_lowercase||<player.world.name.to_lowercase||null>>'
- define regions '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- foreach %regions% {
- if <proc[dRegions_IsOwner].context[%value%|%world%|<player>].not> {
- define regions '<def[regions].exclude[%value%]||%regions%>'
}
}
}
- if <def[spaces].is[==].to[0]> {
- define result '<def[regions].parse[replace[regex:^].with[info ]]>'
}
else if <def[spaces].is[==].to[1]> {
- define result '<def[regions].filter[starts_with[<c.args.get[2].escaped||null>]]||li@>'
- if <def[result].is_empty||true> {
- define result '%regions%'
}
}
else {
- define result 'li@'
}
}
else {
- define result 'li@'
}
tab_addowner:
# /drg addowner [ID] g:group player -w world
- if <player.permission[dregions.addowner]||<player.is_op||false>> {
- define spaces '<c.raw_args.to_list.count[ ]||0>'
- define world '<c.args.get[<c.args.find[-w].add[1].as_int>].escaped.as_world.name.to_lowercase||<player.world.name.to_lowercase||null>>'
- define regions '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- foreach %regions% {
- if <proc[dRegions_IsOwner].context[%value%|%world%|<player>].not> {
- define regions '<def[regions].exclude[%value%]||%regions%>'
}
}
}
- if <def[spaces].is[==].to[0]> {
- define result '<def[regions].parse[replace[regex:^].with[addowner ]]>'
}
else if <def[spaces].is[==].to[1]> {
- define result '<def[regions].filter[starts_with[<c.args.get[2].escaped||null>]]||li@>'
- if <def[result].is_empty||true> {
- define result '%regions%'
}
}
else if <def[spaces].is[OR_MORE].than[2]> {
- define owners '<c.args.remove[1|2]||li@>'
- if <c.args.find[-w].is[OR_MORE].than[0]||false> {
- define owners '<def[owners].remove[<def[owners].find[-w]>|<def[owners].find[-w].add[1].as_int>]||li@>'
}
- define owner '<def[owners].last||li@>'
- if <def[owner].starts_with[g:]||false> {
- define group '<def[owner].replace[g:]>'
- define groups '<server.list_permission_groups.filter[starts_with[%group%]]||li@>'
- if <def[groups].is_empty> {
- define groups '<server.list_permission_groups.alphanumeric||li@>'
}
- define result '<def[groups].parse[replace[regex:^].with[g:]]>'
}
else {
- define result '<server.match_player[%owner%].name||null>'
- if <def[result].is[==].to[null]||true> {
- define result '<server.list_online_players.parse[name].alphanumeric>'
}
}
}
else {
- define result 'li@'
}
}
else {
- define result 'li@'
}
tab_removeowner:
# /drg removeowner [ID] g:group player -w world
- if <player.permission[dregions.removeowner]||<player.is_op||false>> {
- define spaces '<c.raw_args.to_list.count[ ]||0>'
- define world '<c.args.get[<c.args.find[-w].add[1].as_int>].escaped.as_world.name.to_lowercase||<player.world.name.to_lowercase||null>>'
- define regions '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- foreach %regions% {
- if <proc[dRegions_IsOwner].context[%value%|%world%|<player>].not> {
- define regions '<def[regions].exclude[%value%]||%regions%>'
}
}
}
- if <def[spaces].is[==].to[0]> {
- define result '<def[regions].parse[replace[regex:^].with[removeowner ]]>'
}
else if <def[spaces].is[==].to[1]> {
- define result '<def[regions].filter[starts_with[<c.args.get[2].escaped>]]||li@>'
- if <def[result].is_empty||true> {
- define result '%regions%'
}
}
else if <def[spaces].is[OR_MORE].than[2]> {
- define owners '<c.args.remove[1|2]||li@>'
- if <c.args.find[-w].is[OR_MORE].than[0]||false> {
- define owners '<def[owners].remove[<def[owners].find[-w]>|<def[owners].find[-w].add[1].as_int>]||li@>'
}
- define owner '<def[owners].last||li@>'
- if <def[owner].starts_with[g:]||false> {
- define group '<def[owner].replace[g:]>'
- define groups '<server.list_permission_groups.filter[starts_with[%group%]]||li@>'
- if <def[groups].is_empty> {
- define groups '<server.list_permission_groups.alphanumeric||li@>'
}
- define result '<def[groups].parse[replace[regex:^].with[g:]]>'
}
else {
- define result '<server.match_player[%owner%].name||null>'
- if <def[result].is[==].to[null]||true> {
- define result '<server.list_online_players.parse[name].alphanumeric>'
}
}
}
else {
- define result 'li@'
}
}
else {
- define result 'li@'
}
tab_addmember:
# /drg addmember [ID] g:group player -w world
- if <player.permission[dregions.addmember]||<player.is_op||false>> {
- define spaces '<c.raw_args.to_list.count[ ]||0>'
- define world '<c.args.get[<c.args.find[-w].add[1].as_int>].escaped.as_world.name.to_lowercase||<player.world.name.to_lowercase||null>>'
- define regions '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- foreach %regions% {
- if <proc[dRegions_IsOwner].context[%value%|%world%|<player>].not> {
- define regions '<def[regions].exclude[%value%]||%regions%>'
}
}
}
- if <def[spaces].is[==].to[0]> {
- define result '<def[regions].parse[replace[regex:^].with[addmember ]]>'
}
else if <def[spaces].is[==].to[1]> {
- define result '<def[regions].filter[starts_with[<c.args.get[2].escaped>]]||li@>'
- if <def[result].is_empty||true> {
- define result '%regions%'
}
}
else if <def[spaces].is[OR_MORE].than[2]> {
- define members '<c.args.remove[1|2]||li@>'
- if <c.args.find[-w].is[OR_MORE].than[0]||false> {
- define members '<def[members].remove[<def[members].find[-w]>|<def[members].find[-w].add[1].as_int>]||li@>'
}
- define member '<def[members].last||li@>'
- if <def[member].starts_with[g:]||false> {
- define group '<def[member].replace[g:]>'
- define groups '<server.list_permission_groups.filter[starts_with[%group%]]||li@>'
- if <def[groups].is_empty> {
- define groups '<server.list_permission_groups.alphanumeric||li@>'
}
- define result '<def[groups].parse[replace[regex:^].with[g:]]>'
}
else {
- define result '<server.match_player[%member%].name||null>'
- if <def[result].is[==].to[null]||true> {
- define result '<server.list_online_players.parse[name].alphanumeric>'
}
}
}
else {
- define result 'li@'
}
}
else {
- define result 'li@'
}
tab_removemember:
# /drg removemember [ID] g:group player -w world
- if <player.permission[dregions.removemember]||<player.is_op||false>> {
- define spaces '<c.raw_args.to_list.count[ ]||0>'
- define world '<c.args.get[<c.args.find[-w].add[1].as_int>].escaped.as_world.name.to_lowercase||<player.world.name.to_lowercase||null>>'
- define regions '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- foreach %regions% {
- if <proc[dRegions_IsOwner].context[%value%|%world%|<player>].not> {
- define regions '<def[regions].exclude[%value%]||%regions%>'
}
}
}
- if <def[spaces].is[==].to[0]> {
- define result '<def[regions].parse[replace[regex:^].with[removemember ]]>'
}
else if <def[spaces].is[==].to[1]> {
- define result '<def[regions].filter[starts_with[<c.args.get[2].escaped>]]||li@>'
- if <def[result].is_empty||true> {
- define result '%regions%'
}
}
else if <def[spaces].is[OR_MORE].than[2]> {
- define members '<c.args.remove[1|2]||li@>'
- if <c.args.find[-w].is[OR_MORE].than[0]||false> {
- define members '<def[members].remove[<def[members].find[-w]>|<def[members].find[-w].add[1].as_int>]||li@>'
}
- define member '<def[members].last||li@>'
- if <def[member].starts_with[g:]||false> {
- define group '<def[member].replace[g:]>'
- define groups '<server.list_permission_groups.filter[starts_with[%group%]]||li@>'
- if <def[groups].is_empty> {
- define groups '<server.list_permission_groups.alphanumeric||li@>'
}
- define result '<def[groups].parse[replace[regex:^].with[g:]]>'
}
else {
- define result '<server.match_player[%member%].name||null>'
- if <def[result].is[==].to[null]||true> {
- define result '<server.list_online_players.parse[name].alphanumeric>'
}
}
}
else {
- define result 'li@'
}
}
else {
- define result 'li@'
}
tab_list:
- define result 'li@'
tab_flag:
# TODO
# /drg flag [ID] [flag] [value] -g group -w world
- if <player.permission[dregions.flag]||<player.is_op||false>> {
- define spaces '<c.raw_args.to_list.count[ ]||0>'
- if <def[spaces].is[==].to[0]> {
- define result 'flag [ID]'
}
else if <def[spaces].is[==].to[1]> {
- if <c.args.get[2].is[==].to[null]||true> {
- define result '[ID]'
}
else if <c.args.get[2].is[==].to[-w]||false> {
- define result '<server.list_worlds.parse[name.to_lowercase].parse[replace[regex:^].with[-w ]]>'
}
else if <context.server.not> {
- define regions '<yaml[dRegions_<player.world.name.to_lowercase>_regions].list_keys[regions].alphanumeric||li@>'
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- foreach %regions% {
- if <proc[dRegions_IsOwner].context[%value%|<player.world.name.to_lowercase>|<player>].not> {
- define regions '<def[regions].exclude[%value%]||%regions%>'
}
}
}
- define result '<def[regions].filter[starts_with[<c.args.get[2].escaped>]]||li@>'
- if <def[result].is_empty||true> {
- define result '%regions%'
}
}
else {
- define result 'li@'
}
}
else if <def[spaces].is[==].to[2]> {
- if <c.args.get[2].is[==].to[-w]||false> {
- if <c.args.get[3].is[!=].to[null]||false> {
- define result '<server.list_worlds.parse[name.to_lowercase].filter[starts_with[<c.args.get[3].escaped>]]||li@>'
}
- if <def[result].is_empty||true> {
- define result '<server.list_worlds.parse[name.to_lowercase]||li@>'
}
}
else if <c.args.get[2].is[!=].to[null]||false> {
- define allFlags '<server.flag[dRegions.Flags].as_list||li@>'
- if <c.args.get[3].is[==].to[-w]||false> {
- define world '<c.args.get[<c.args.find[-w].add[1].as_int>].escaped.as_world.name.to_lowercase||<player.world.name.to_lowercase||null>>'
- if <c.args.get[3].is[!=].to[null]||false> {
- define result '<server.list_worlds.parse[name.to_lowercase].filter[starts_with[<c.args.get[3].escaped>]]||li@>'
}
- if <def[result].is_empty||true> {
- define result '<server.list_worlds.parse[name.to_lowercase].parse[replace[regex:^].with[-w ]]||li@>'
}
}
else if <c.args.get[3].is[!=].to[null]||false> {
- define result '<def[allFlags].filter[starts_with[<c.args.get[3].escaped>]]||li@>'
- if <def[result].is_empty||true> {
- define result '<def[allFlags]||li@>'
}
}
else {
- if <def[result].is_empty||true> {
- define result '<def[allFlags]||li@>'
}
}
}
}
else if <def[spaces].is[==].to[3]> {
- if <c.args.get[2].is[==].to[-w]||false> {
- define world '<c.args.get[<c.args.find[-w].add[1].as_int>].escaped.as_world.name.to_lowercase||<player.world.name.to_lowercase||null>>'
- define regions '<yaml[dRegions_%world%_regions].list_keys[regions].alphanumeric||li@>'
- if <c.args.get[4].is[!=].to[null]||false> {
- define result '<def[regions].filter[starts_with[<c.args.get[4].escaped>]]||li@>'
}
- if <def[result].is_empty||true> {
- define result '<def[regions]||li@>'
}
}
else if <c.args.get[3].is[==].to[-w]||false> {
- define world '<c.args.get[<c.args.find[-w].add[1].as_int>].escaped.as_world.name.to_lowercase||<player.world.name.to_lowercase||null>>'
- if <c.args.get[4].is[!=].to[null]||false> {
- define result '<server.list_worlds.parse[name.to_lowercase].filter[starts_with[<c.args.get[3].escaped>]].parse[replace[regex:^].with[-w ]]||li@>'
}
- if <def[result].is_empty||true> {
- define result '<server.list_worlds.parse[name.to_lowercase]||li@>'
}
}
else if <c.args.get[4].is[==].to[-w]||false> {
- define result '<server.list_worlds.parse[name.to_lowercase].parse[replace[regex:^].with[-w ]]||li@>'
}
}
else if <def[spaces].is[==].to[4]> {
- if <c.args.get[4].is[==].to[-w]||false> {
- define world '<c.args.get[<c.args.find[-w].add[1].as_int>].escaped.as_world.name.to_lowercase||<player.world.name.to_lowercase||null>>'
- define regions '<yaml[dRegions_%world%_regions].list_keys[regions].alphanumeric||li@>'
- if <c.args.get[5].is[!=].to[null]||false> {
- define result '<server.list_worlds.parse[name.to_lowercase].filter[starts_with[<c.args.get[5].escaped>]]||li@>'
}
- if <def[result].is_empty||true> {
- define result '<server.list_worlds.parse[name.to_lowercase]||li@>'
}
}
else {
- define allFlags '<server.flag[dRegions.Flags].as_list||li@>'
- if <c.args.get[5].is[!=].to[null]||false> {
- define result '<def[allFlags].filter[starts_with[<c.args.get[5].escaped>]]||li@>'
}
- if <def[result].is_empty||true> {
- define result '<def[allFlags]||li@>'
}
}
}
}
else {
- define result 'li@'
}
tab_setpriority:
# /drg remove [ID] -w world
- if <player.permission[dregions.setpriority]||<player.is_op||false>> {
- define spaces '<c.raw_args.to_list.count[ ]||0>'
- if <def[spaces].is[==].to[0]> {
- define result 'setpriority [ID]'
}
else if <def[spaces].is[==].to[1]> {
- if <c.args.get[2].is[==].to[null]||true> {
- define result '[ID]'
}
else if <c.args.get[2].is[==].to[-w]||false> {
- define result '<server.list_worlds.parse[name.to_lowercase].parse[replace[regex:^].with[-w ]]>'
}
else if <context.server.not> {
- define regions '<yaml[dRegions_<player.world.name.to_lowercase>_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- foreach %regions% {
- if <proc[dRegions_IsOwner].context[%value%|<player.world.name.to_lowercase>|<player>].not> {
- define regions '<def[regions].exclude[%value%]||%regions%>'
}
}
- define result '<def[regions].filter[starts_with[<c.args.get[2].escaped>]]||li@>'
}
else {
- define result '<def[regions].filter[starts_with[<c.args.get[2].escaped>]]||%regions%>'
- if <def[result].is_empty> {
- define result '%regions%'
}
}
}
else {
- define result 'li@'
}
}
else if <def[spaces].is[==].to[2]> {
- if <c.args.get[2].is[==].to[-w]||false> {
- if <c.args.get[3].is[!=].to[null]||false> {
- define result '<server.list_worlds.parse[name.to_lowercase].filter[starts_with[<c.args.get[3].escaped>]]||li@>'
}
- if <def[result].is_empty||true> {
- define result '<server.list_worlds.parse[name.to_lowercase]||li@>'
}
}
else {
- if <c.args.get[3].is[MATCHES].to[number]> {
- define result '<c.args.get[3]>'
}
else if <c.args.get[3].is[==].to[-w]||false> {
- define result '<server.list_worlds.parse[name.to_lowercase].parse[replace[regex:^].with[-w ]]||li@>'
}
else {
- define result '<&ns>'
}
}
}
else if <def[spaces].is[==].to[3]> {
- if <c.args.get[2].is[==].to[-w]||false> {
- if <c.args.get[4].is[!=].to[null]||false> {
- define regions '<yaml[dRegions_<c.args.get[3].escaped>_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
- define result '<def[regions].filter[starts_with[<c.args.get[4].escaped>]]||li@>'
- if <def[result].is_empty||true> {
- define result '%regions%'
}
}
else {
- define result '<yaml[dRegions_<c.args.get[3].escaped>_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
}
}
else if <c.args.get[3].is[==].to[-w]||false> {
- define result '<server.list_worlds.parse[name.to_lowercase]||li@>'
}
else {
- if <c.args.get[4].is[!=].to[null]||false> {
- define result '<server.list_worlds.parse[name.to_lowercase].filter[starts_with[<c.args.get[4].escaped>]]||li@>'
}
else {
- define result '<server.list_worlds.parse[name].parse[replace[regex:^].with[-w ]]||li@>'
}
- if <def[result].is_empty||true> {
- define result '<server.list_worlds.parse[name.to_lowercase].parse[replace[regex:^].with[-w ]]||li@>'
}
}
}
else if <def[spaces].is[==].to[4]> {
- if <c.args.get[2].is[==].to[-w]||false>
|| <c.args.get[3].is[==].to[-w]||false> {
Line with no clear purpose - missing a -dash- or :colon:?
- if <c.args.get[5].is[MATCHES].to[number]> {
- define result '<c.args.get[5]>'
}
else {
- define result '<&ns>'
}
}
else if <c.args.get[4].is[==].to[-w]> {
- define result '<server.list_worlds.parse[name.to_lowercase]||li@>'
}
}
else {
- define result 'li@'
}
}
else {
- define result 'li@'
}
tab_setparent:
# TODO
- define result 'li@'
tab_teleport:
# TODO
# /drg teleport [ID] -w world
- define result 'li@'
tab_remove:
# /drg remove [ID] -w world
- if <player.permission[dregions.remove]||<player.is_op||false>> {
- define spaces '<c.raw_args.to_list.count[ ]||0>'
- if <def[spaces].is[==].to[0]> {
- define result 'remove [ID] -w world'
}
else if <def[spaces].is[==].to[1]> {
- if <c.args.get[2].is[==].to[null]||true> {
- define result '[ID]'
}
else if <c.args.get[2].is[==].to[-w]||false> {
- define result '<server.list_worlds.parse[name.to_lowercase].parse[replace[regex:^].with[-w ]]>'
}
else if <context.server.not> {
- define regions '<yaml[dRegions_<player.world.name.to_lowercase>_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- foreach %regions% {
- if <proc[dRegions_IsOwner].context[%value%|<player.world.name.to_lowercase>|<player>].not> {
- define regions '<def[regions].exclude[%value%]||%regions%>'
}
}
}
- define result '<def[regions].filter[starts_with[<c.args.get[2].escaped>]]||li@>'
- if <def[result].is_empty||true> {
- define result '%regions%'
}
}
else {
- define result 'li@'
}
}
else if <def[spaces].is[==].to[2]> {
- if <c.args.get[2].is[==].to[-w]||false> {
- if <c.args.get[3].is[!=].to[null]||false> {
- define result '<server.list_worlds.parse[name.to_lowercase].filter[starts_with[<c.args.get[3].escaped>]]||li@>'
}
- if <def[result].is_empty||true> {
- define result '<server.list_worlds.parse[name.to_lowercase]||li@>'
}
}
else {
- define result '<server.list_worlds.parse[name.to_lowercase].parse[replace[regex:^].with[-w ]]>'
}
}
else if <def[spaces].is[==].to[3]> {
- if <c.args.get[2].is[==].to[-w]||false> {
- if <c.args.get[4].is[!=].to[null]||false> {
- define regions '<yaml[dRegions_<c.args.get[3].escaped>_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
- define result '<def[regions].filter[starts_with[<c.args.get[4].escaped>]]||li@>'
- if <def[result].is_empty||true> {
- define result '%regions%'
}
}
else {
- define result '<yaml[dRegions_<c.args.get[3].escaped>_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
}
}
else {
- if <c.args.get[4].is[!=].to[null]||false> {
- define result '<server.list_worlds.parse[name.to_lowercase].filter[starts_with[<c.args.get[4].escaped>]]||li@>'
}
else {
- define result '<server.list_worlds.parse[name.to_lowercase]||li@>'
}
- if <def[result].is_empty||true> {
- define result '<server.list_worlds.parse[name.to_lowercase]||li@>'
}
}
}
else {
- define result 'li@'
}
}
else {
- define result 'li@'
}
tab_wgimport:
# TODO
# /drg wgimport [world(s)] -a
- define result 'li@'
#
# END dRegions Command TAB Completion
#--------------------------------------
#
# dRegions Command Arguments
#
# Each of these subscripts is an argument for the root command.
#
help:
- define arg '<c.args.get[2].escaped||null>'
- if <def[args].contains[%arg%]||false> {
- run s@msgPrefixed delay:1t 'def:dRegions|<parse:<script.yaml_key[commandArgs.%arg%.usage]||No help for you!>>'
- queue clear
}
- if <player.permission[dRegions.admin]||<player.is_op||<context.server||false>>> {
- inject locally msgsHelpAdmin
}
else {
- inject locally msgsHelpUser
}
- inject locally msgsFooter
- queue clear
about:
- inject locally msgsHelpUser
- inject locally msgsFooter
- queue clear
reload:
- if !<player.permission[dRegions.reload]||<player.is_op||<context.server||false>>> {
- inject locally help
- queue clear
}
- inject s@dRegions p:reloadYaml instantly
# - run s@msgPrefixed delay:1t 'def:dRegions|<&7><&o>System files loaded!'
restart:
- if !<player.permission[dRegions.restart]||<player.is_op||<context.server||false>>> {
- inject locally help
- queue clear
}
- run s@dRegions p:start instantly
wgimport:
- define args '<c.args.replace[wgimport]>'
- if <c.server> {
- if <def[args].size> == 0 {
- run s@msgPrefixed 'def:dRegions|<&c>Must specify world(s) to import!'
- queue clear
}
}
else {
- if !<player.permission[dregions.admin]||false> && !<player.is_op> {
- queue clear
}
}
- if <def[args].size> > 0 {
- if <def[args]> contains '-a' {
- define worlds '<server.list_worlds.parse[name]>'
}
else {
- define worlds '<def[args].escape_contents>'
}
}
else {
- define worlds '<def[worlds].include[<player.world.name>]>' {
}
- foreach '%worlds%':
- run s@dRegions_WG_Importer 'def:%value%'
define:
# /drg define [ID] (g:group) (player)
- inject locally prerun instantly
# Check for existing region
- define exists '<proc[dRegions_RegionExists].context[%name%|%world%]||true>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is already a region by this name!'
- queue clear
}
# Check for overlapping regions
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_RegionOverlaps].context[<def[selectedCuboid].separated_by[/].replace[cu@]>|%world%|<player>]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Region selection contains unowned regions!'
- queue clear
}
}
# Parse any declared owners
- define owners '<c.args.remove[1|2].replace[:].with[;]||li@>'
- if <c.args.find[-w].is[OR_MORE].than[0]||false> {
- define owners '<def[owners].remove[<def[owners].find[-w]>|<def[owners].find[-w].add[1].as_int>]||li@>'
}
- define ownerGroups li@
- define ownerPlayers li@
- foreach %owners% {
- if <def[value].starts_with[g;]||false> {
- define ownerGroups '<def[ownerGroups].include[<def[value].replace[g;]>]||%ownerGroups%>'
}
else {
- if !<def[value].as_player.is[!=].to[null]||false> {
- foreach next
}
- define ownerPlayers '<def[ownerPlayers].include[<def[value].as_player.uuid>]||%ownerPlayers%>'
}
}
# Automatically add the player that defined the region as the owner
- if <yaml[dregions_global_config].read[config.regions.ownerOnDefine].is[==].to[true]||false> {
- if <def[ownerPlayers].contains[<player.uuid>].not||false> {
- define ownerPlayers '<def[ownerPlayers].include[<player.uuid>]||%ownerPlayers%>'
}
}
# Create the region
- inject s@dRegions p:createRegionEntry instantly
- run s@msgPrefixed delay:1t 'def:dRegions|<&7><&o>Created %name% in %world%'
redefine:
# /drg redefine [ID]
- inject locally prerun instantly
# Check if region exists
- define exists '<proc[dRegions_RegionExists].context[%name%|%world%]>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is no region by this name!'
- queue clear
}
# Don't redefine global type regions
- if <yaml[dRegions_%world%_regions].read[regions.%name%.type].is[==].to[global]||false> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You can not redefine global regions!'
- queue clear
}
# Check if is owner
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_IsOwner].context[%name%|%world%|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
}
# Check for overlapping regions
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_RegionOverlaps].context[<def[selectedCuboid].separated_by[/].replace[cu@]>|%world%|<player>]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Region selection contains unowned regions!'
- queue clear
}
}
# Update the region
- yaml set 'regions.%name%.min:<def[selectedCuboid].min.simple>' 'id:dRegions_%world%_regions'
- yaml set 'regions.%name%.max:<def[selectedCuboid].max.simple>' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- note cu@<def[selectedCuboid].min.simple>|<def[selectedCuboid].max.simple> 'as:dregions_%world%_%name%'
- run s@msgPrefixed delay:1t 'def:dRegions|<&f><&o>%name%<&7><&o> updated to selection'
claim:
# /drg claim [ID]
- inject locally prerun instantly
# Check Global region limits
- define globalRegionLimit '<yaml[dregions_global_config].read[config.regions.claim.max-region-count-per-player.default]||0>'
- if <def[globalRegionLimit].is[MORE].than[0]> {
- define playerGlobalRegions 'li@'
- foreach <server.list_worlds.parse[name.to_lowercase]> {
- define thisWorld '%value%'
- foreach '<yaml[dRegions_%thisWorld%_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>' {
- define region '%value%'
- if <proc[dRegions_IsOwner].context[<def[region]>|<def[thisWorld]>|<player>]||false> {
- define playerGlobalRegions '<def[playerGlobalRegions].include[<def[region]>]||<def[playerGlobalRegions]>>'
}
}
}
- if <def[playerGlobalRegions].size.is[OR_MORE].than[%globalRegionLimit%]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You already have <def[playerGlobalRegions].size> total regions!'
- if !<player.permission[dRegions.admin]||<player.is_op||false>> {
- queue clear
}
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>But you are an admin so it is ok!'
}
}
# Check World region limits
- define worldRegionLimit '<yaml[dregions_%world%_config].read[config.regions.claim.max-region-count-per-player.default]||0>'
- if <def[worldRegionLimit].is[MORE].than[0]> {
- define playerWorldRegions 'li@'
- foreach '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>' {
- define region '%value%'
- if <proc[dRegions_IsOwner].context[<def[region]>|<def[world]>|<player>]||false> {
- define playerWorldRegions '<def[playerWorldRegions].include[<def[region]>]||<def[playerWorldRegions]>>'
}
}
- if <def[playerWorldRegions].size.is[OR_MORE].than[%worldRegionLimit%]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You already have <def[playerWorldRegions].size> regions in this world!'
- if !<player.permission[dRegions.admin]||<player.is_op||false>> {
- queue clear
}
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>But you are an admin so it is ok!'
}
}
# Check selection volume
- define globalClaimVol '<yaml[dregions_global_config].read[config.regions.claim.max-volume]||0>'
- inject s@dWE_Commands p:selection_Size instantly
- if <def[globalClaimVol].is[MORE].than[0]> {
- if <def[size].is[MORE].than[%globalClaimVol%]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Your selection exceeds the global limit!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&7><&o>Selected <&8>(<&7><&o>%size%<&8>) <&7><&o>Limit <&8>(<&7><&o>%globalClaimVol%<&8>) <&7><&o>Over <&8>(<&7><&o><def[size].sub[%globalClaimVol%].as_int><&8>)'
- if !<player.permission[dRegions.admin]||<player.is_op||false>> {
- queue clear
}
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>But you are an admin so it is ok!'
}
}
- define worldClaimVol '<yaml[dregions_%world%_config].read[config.regions.claim.max-volume]||0>'
- if <def[worldClaimVol].is[MORE].than[0]> {
- if <def[size].is[MORE].than[%worldClaimVol%]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Your selection exceeds the world limit!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&7><&o>Selected <&8>(<&7><&o>%size%<&8>) <&7><&o>Limit <&8>(<&7><&o>%worldClaimVol%<&8>) <&7><&o>Over <&8>(<&7><&o><def[size].sub[%worldClaimVol%].as_int><&8>)'
- if !<player.permission[dRegions.admin]||<player.is_op||false>> {
- queue clear
}
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>But you are an admin so it is ok!'
}
}
# Check inside existing/owned region
- if '<yaml[dregions_global_config].read[config.regions.claim.only-inside-existing-regions]||false>' {
- if <def[playerWorldRegions].exists.not> {
- define playerWorldRegions 'li@'
- foreach '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>' {
- define region '%value%'
- if <proc[dRegions_IsOwner].context[<def[region]>|<def[world]>|<player>]||false> {
- define playerWorldRegions '<def[playerWorldRegions].include[<def[region]>]||<def[playerWorldRegions]>>'
}
}
}
- define cuboids '<def[playerWorldRegions].parse[replace[regex:^].with[cu@dregions_%world%_]].filter[as_cuboid.is[!=].to[null]||false]||li@>'
- foreach %cuboids% {
- if <def[pos1].as_location.is_within[%value%]> && <def[pos2].as_location.is_within[%value%]> {
- define isWithin ''
- foreach stop
}
}
- if <def[isWithin].exists.not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You may only claim regions within land you own'
- if !<player.permission[dRegions.admin]||<player.is_op||false>> {
- queue clear
}
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>But you are an admin so it is ok!'
}
}
# Check if region exists
- define exists '<proc[dRegions_RegionExists].context[%name%|%world%]>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists]> {
- if <proc[dRegions_IsOwner].context[%name%|%world%|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
- if <yaml[dRegions_%world%_regions].read[regions.%name%.type].is[==].to[global]||false> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You can not redefine global regions!'
- queue clear
}
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Region already exists!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&7>You must want to update the region'
- define update ''
}
# Check for overlapping regions
# The perm check here is redundant
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_RegionOverlaps].context[<def[selectedCuboid].separated_by[/].replace[cu@]>|%world%|<player>]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Region selection contains unowned regions!'
- if !<player.permission[dRegions.admin]||<player.is_op||false>> {
- queue clear
}
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>But you are an admin so it is ok!'
}
}
# Update the region
- if <def[update].exists||false> {
- yaml set 'regions.%name%.min:<def[selectedCuboid].min.simple>' 'id:dRegions_%world%_regions'
- yaml set 'regions.%name%.max:<def[selectedCuboid].max.simple>' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- note cu@<def[selectedCuboid].min.simple>|<def[selectedCuboid].max.simple> 'as:dregions_%world%_%name%'
- run s@msgPrefixed delay:1t 'def:dRegions|<&f><&o>%name%<&7><&o> updated to selection'
}
else {
- define ownerPlayers 'li@<player.uuid>'
- inject s@dRegions p:createRegionEntry instantly
- run s@msgPrefixed delay:1t 'def:dRegions|<&7><&o>Created %name% in %world%'
}
select:
# /drg select [ID]
- inject locally prerun instantly
# Check if region exists
- define exists '<proc[dRegions_RegionExists].context[%name%|%world%]>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is no region by this name!'
- queue clear
}
# Don't select global type regions
- if <yaml[dRegions_%world%_regions].read[regions.%name%.type].is[==].to[global]||false> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You can not select global regions!'
- queue clear
}
# Check if is owner
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_IsOwner].context[%name%|%world%|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
}
- define min '<yaml[dRegions_%world%_regions].read[regions.%name%.min].as_location.simple||null>'
- define max '<yaml[dRegions_%world%_regions].read[regions.%name%.max].as_location.simple||null>'
- flag <player> 'dWEWand_Type:cuboid'
- flag <player> dWEWand:!
- flag <player> dWEWand:|:%min%|%max%
- run s@msgPrefixed delay:1t 'def:dRegions|<&7><&o>Selected <&f><&o>%name%'
info:
# /drg info [ID] -w world
- inject locally prerun instantly
# Check if region exists
- define exists '<proc[dRegions_RegionExists].context[%name%|%world%]>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region named %name%!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is no region by this name!'
- queue clear
}
# Check if is owner
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_IsOwner].context[%name%|%world%|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
}
- inject locally regionInfo instantly
- define title '<proc[msgCommand].context[<&6>dRegions|drg help|<&a>Go back to main help]>'
- define subTitle '<&e>Region Info'
- define command 'drg info %name%'
- define entries 'li@<&7>Region<&co> <&e><proc[msgTrim].context[15|%name%]> <&7>World<&co> <&e><proc[msgTrim].context[15|%world%]>'
- define entries '<def[entries].include[<&7>Type<&co> <&f>%type% <&7>Volume<&co> <&8><&lb><&f><&o>%size%<&8><&rb>]>'
- define entries '<def[entries].include[<&7>Area<&co> <&8><&lb><&f><&o><def[pos1].split[,].remove[4].separated_by[,]> <&f><&o><def[pos2].split[,].remove[4].separated_by[,]><&8><&rb>]>'
- define entries '<def[entries].include[<&7>Priority<&co> <&f><el@val[%priority%].pad_right[3]><&7> Parent<&co> <&f>%parent%]>'
- if <def[ownerPlayers].is_empty||true> && <def[ownerGroups].is_empty||true> {
- define entries '<def[entries].include[<&7>Owners<&co> <&c>none]>'
}
else {
- define entries '<def[entries].include[<&7>Owners<&co> <&f><def[ownerPlayers].parse[as_player.name].include[<def[ownerGroups].parse[replace[regex:^].with[<&b>]]||>].comma_separated>]>'
}
- if <def[memberPlayers].is_empty||true> && <def[memberGroups].is_empty||true> {
- define entries '<def[entries].include[<&7>Members<&co> <&c>none]>'
}
else {
- define entries '<def[entries].include[<&7>Members<&co> <&f><def[memberPlayers].parse[as_player.name].include[<def[memberGroups].parse[replace[regex:^].with[<&b>]]||>].comma_separated>]>'
}
- if <def[flags].is_empty> {
- define entries '<def[entries].include[<&7>Flags<&co> <&c>none]>'
}
else {
- define entries '<def[entries].include[<&7>Flags<&co>]>'
- foreach '<def[flags].alphanumeric>' {
- define flag '<def[value].split[/].get[1]>'
- define flagVal '<def[value].after[/].strip_color>'
- define entries '<def[entries].include[<&e.pad_left[3]>%flag%<&co> <&f><parse:%flagVal%>]>'
}
}
- run s@msgBoxed 'def:dRegions|%title%|%subTitle%|%command%|%page%|52|14|<def[entries].separated_by[|]>'
addowner:
# /drg addowner [ID] g:group player
- inject locally prerun instantly
# Check if region exists
- define exists '<proc[dRegions_RegionExists].context[%name%|%world%]>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is no region by this name!'
- queue clear
}
# Check if is owner
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_IsOwner].context[%name%|%world%|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
}
# Parse specified owners
- if <c.args.find[-w].is[OR_MORE].than[0]||false> {
- define args '<c.args.remove[<c.args.find[-w].add[1].as_int>].exclude[-w]>'
- define owners '<def[args].get[3].to[<def[args].size>].replace[:].with[;]||null>'
}
else {
- define owners '<c.args.get[3].to[<c.args.size>].replace[:].with[;]||null>'
}
- if <def[owners].is_empty||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Must specify at least one owner'
- queue clear
}
- foreach %owners% {
- if <def[value].starts_with[g;]||false> {
- define group '<def[value].replace[g;]>'
- if <server.list_permission_groups> !contains %group% {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>%group% is not a valid group'
- foreach next
}
- define groups '<yaml[dRegions_%world%_regions].read[regions.%name%.owners.groups]||li@>'
- if <def[groups].contains[%group%]||false> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Group %group% is already an owner'
- foreach next
}
- define pass true
- yaml set 'regions.%name%.owners.groups:->:%group%' 'id:dRegions_%world%_regions'
}
else {
- if !<def[value].as_player.is[!=].to[null]||false> {
- foreach next
}
- define players '<yaml[dRegions_%world%_regions].read[regions.%name%.owners.players]||li@>'
- if <def[players].contains[<def[value].as_player.uuid>]||false> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Player %value% is already an owner'
- foreach next
}
- define pass true
- yaml set 'regions.%name%.owners.players:->:<def[value].as_player.uuid>' 'id:dRegions_%world%_regions'
- flag <def[value].as_player> 'dRegions.cache.%world%.%name%:!'
}
}
- if <def[pass].exists||false> {
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&f><&o>%name%<&7><&o> owners updated'
}
removeowner:
# /drg removeowner [ID] g:group player
- inject locally prerun instantly
# Check if region exists
- define exists '<proc[dRegions_RegionExists].context[%name%|%world%]>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is no region by this name!'
- queue clear
}
# Check if is owner
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_IsOwner].context[%name%|%world%|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
}
# Parse specified owners
- if <c.args.find[-w].is[OR_MORE].than[0]||false> {
- define args '<c.args.remove[<c.args.find[-w].add[1].as_int>].exclude[-w]>'
- define owners '<def[args].get[3].to[<def[args].size>].replace[:].with[;]||null>'
}
else {
- define owners '<c.args.get[3].to[<c.args.size>].replace[:].with[;]||null>'
}
- if <def[owners].is_empty||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Must specify at least one owner'
- queue clear
}
- foreach %owners% {
- if <def[value].starts_with[g;]||false> {
- define group '<def[value].replace[g;]>'
- if <server.list_permission_groups> !contains %group% {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>%group% is not a valid group'
- foreach next
}
- define groups '<yaml[dRegions_%world%_regions].read[regions.%name%.owners.groups]||li@>'
- if <def[groups].contains[%group%].not||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Group %group% is not an owner'
- foreach next
}
- define pass true
- yaml set 'regions.%name%.owners.groups:<-:%group%' 'id:dRegions_%world%_regions'
}
else {
- if !<def[value].as_player.is[!=].to[null]||false> {
- foreach next
}
- define players '<yaml[dRegions_%world%_regions].read[regions.%name%.owners.players]||li@>'
- if <def[players].contains[<def[value].as_player.uuid>].not||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Player %value% is not an owner'
- foreach next
}
- define pass true
- yaml set 'regions.%name%.owners.players:<-:<def[value].as_player.uuid>' 'id:dRegions_%world%_regions'
- flag <def[value].as_player> 'dRegions.cache.%world%.%name%:!'
}
}
- if <def[pass].exists||false> {
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&f><&o>%name%<&7><&o> owners updated'
}
else {
- run s@msgPrefixed delay:1t 'def:dRegions|<&6><&o>%name%<&c><&o> owners not updated!'
}
addmember:
# /drg addmember [ID] g:group player
- inject locally prerun instantly
# Check if region exists
- define exists '<proc[dRegions_RegionExists].context[%name%|%world%]>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is no region by this name!'
- queue clear
}
# Check if is owner
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_IsOwner].context[%name%|%world%|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
}
# Parse specified members
- if <c.args.find[-w].is[OR_MORE].than[0]||false> {
- define args '<c.args.remove[<c.args.find[-w].add[1].as_int>].exclude[-w]>'
- define members '<def[args].get[3].to[<def[args].size>].replace[:].with[;]||null>'
}
else {
- define members '<c.args.get[3].to[<c.args.size>].replace[:].with[;]||null>'
}
- if <def[members].is_empty||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Must specify at least one member'
- queue clear
}
- foreach %members% {
- if <def[value].starts_with[g;]||false> {
- define group '<def[value].replace[g;]>'
- if <server.list_permission_groups> !contains %group% {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>%group% is not a valid group'
- foreach next
}
- define groups '<yaml[dRegions_%world%_regions].read[regions.%name%.members.groups]||li@>'
- if <def[groups].contains[%group%]||false> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Group %group% is already a member'
- foreach next
}
- define pass true
- yaml set 'regions.%name%.members.groups:->:%group%' 'id:dRegions_%world%_regions'
}
else {
- if !<def[value].as_player.is[!=].to[null]||false> {
- foreach next
}
- define players '<yaml[dRegions_%world%_regions].read[regions.%name%.members.players]||li@>'
- if <def[players].contains[<def[value].as_player.uuid>]||false> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Player %value% is already a member'
- foreach next
}
- define pass true
- yaml set 'regions.%name%.members.players:->:<def[value].as_player.uuid>' 'id:dRegions_%world%_regions'
- flag <def[value].as_player> 'dRegions.cache.%world%.%name%:!'
}
}
- if <def[pass].exists||false> {
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&f><&o>%name%<&7><&o> members updated'
}
else {
- run s@msgPrefixed delay:1t 'def:dRegions|<&6><&o>%name%<&c><&o> members not updated!'
}
removemember:
# /drg reomvemember [ID] g:group player
- inject locally prerun instantly
# Check if region exists
- define exists '<proc[dRegions_RegionExists].context[%name%|%world%]>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is no region by this name!'
- queue clear
}
# Check if is owner
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_IsOwner].context[%name%|%world%|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
}
# Parse specified members
- if <c.args.find[-w].is[OR_MORE].than[0]||false> {
- define args '<c.args.remove[<c.args.find[-w].add[1].as_int>].exclude[-w]>'
- define members '<def[args].get[3].to[<def[args].size>].replace[:].with[;]||null>'
}
else {
- define members '<c.args.get[3].to[<c.args.size>].replace[:].with[;]||null>'
}
- if <def[members].is_empty||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Must specify at least one member'
- queue clear
}
- foreach %members% {
- if <def[value].starts_with[g;]||false> {
- define group '<def[value].replace[g;]>'
- if <server.list_permission_groups> !contains %group% {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>%group% is not a valid group'
- foreach next
}
- define groups '<yaml[dRegions_%world%_regions].read[regions.%name%.members.groups]||li@>'
- if <def[groups].contains[%group%].not||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Group %group% is not a member'
- foreach next
}
- define pass true
- yaml set 'regions.%name%.members.groups:<-:%group%' 'id:dRegions_%world%_regions'
}
else {
- if !<def[value].as_player.is[!=].to[null]||false> {
- foreach next
}
- define players '<yaml[dRegions_%world%_regions].read[regions.%name%.members.players]||li@>'
- if <def[players].contains[<def[value].as_player.uuid>].not||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Player %value% is not a member'
- foreach next
}
- define pass true
- yaml set 'regions.%name%.members.players:<-:<def[value].as_player.uuid>' 'id:dRegions_%world%_regions'
- flag <def[value].as_player> 'dRegions.cache.%world%.%name%:!'
}
}
- if <def[pass].exists||false> {
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&f><&o>%name%<&7><&o> members updated'
}
else {
- run s@msgPrefixed delay:1t 'def:dRegions|<&6><&o>%name%<&c><&o> members not updated!'
}
list:
# /drg list (page#) -r region -w world -p player
- define args '<c.args.remove[1]>'
# Check the specified player
- if <def[args].find[-p].is[OR_MORE].than[0]||false> {
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You may not list other players regions!'
- queue clear
}
- define player '<def[args].get[<def[args].find[-p].add[1].as_int>].escaped||null>'
- if !<def[player].as_player.is[!=].to[null]||false> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Invalid player specfied!'
- queue clear
}
- define filterPlayer ''
- define args '<def[args].remove[<def[args].find[-p].add[1].as_int>].exclude[-p]||li@>'
}
else {
- if <context.server.not> {
- define player '<player.name>'
}
else {
- define player 'null'
}
}
# Check the specified world
- if <def[args].find[-w].is[OR_MORE].than[0]||false> {
- define world '<def[args].get[<def[args].find[-w].add[1].as_int>].as_world.name.to_lowercase.escaped||null>'
- if <def[world].is[==].to[null]||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Invalid world specfied!'
- queue clear
}
- define filterWorld ''
- define args '<def[args].remove[<def[args].find[-w].add[1].as_int>].exclude[-w]||li@>'
}
else {
- if <context.server.not> {
- define world '<player.world.name.to_lowercase>'
}
else {
- define world 'null'
}
}
# Does the player want to list the regions where he stands?
- if <def[args].find[-h].is[OR_MORE].than[0]||false> {
- define filterHere ''
- define args '<def[args].remove[<def[args].find[-h]>]||li@>'
}
# Do we want to show results for ALL worlds?
- if <def[args].find[-a].is[OR_MORE].than[0]||false> {
- define worlds '<server.list_worlds.parse[name.to_lowercase]>'
- define getAll ''
- define args '<def[args].remove[<def[args].find[-a]>]||li@>'
}
# Check the specified region name
- if <def[args].find[-r].is[OR_MORE].than[0]||false> {
- define region '<def[args].get[<def[args].find[-r].add[1].as_int>].escaped||null>'
- if <def[region].is[!=].to[null]||true> {
- define exists '<proc[dRegions_RegionExists].context[<def[region]>|<def[world]>]>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is no region by this name!'
- queue clear
}
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_IsOwner].context[<def[region]>|<def[world]>|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
}
}
else {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You must specify a valid region ID!'
- queue clear
}
- define filterRegion ''
- define args '<def[args].remove[<def[args].find[-r].add[1].as_int>].exclude[-r]||li@>'
}
# OK, we've validated all the user input, let's get the regions and apply filters
- define regions li@
- if <def[filterHere].exists> {
- define standingIn '<player.location.cuboids.parse[notable_name].filter[split[_].get[1].is[==].to[dRegions]].parse[after[dregions_%world%_]].separated_by[,]>'
- define worldRegions '<proc[dRegions_HighestPriority].context[%world%|%standingIn%]||li@>'
- if <def[worldRegions].is_empty||true> {
- define worldRegions 'li@__global__'
}
- inject locally filterRegionList
}
else if <def[getAll].exists> {
- foreach %worlds% {
- define world %value%
- define worldRegions '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
- inject locally filterRegionList
}
}
else {
- define worldRegions '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__].alphanumeric||li@>'
- inject locally filterRegionList
}
# Display the list
- define page '<def[args].get[1].replace[-].escaped||1>'
- define entries 'li@'
- foreach '<def[regions]>':
- define color '<t[<def[value].split[.].get[3].is[==].to[owner]>]:&6||<t[<def[value].split[.].get[3].is[==].to[member]>]:&e||&f>>'
- define entry '<def[loop_index].pad_left[3].with[<&sp>]><&dot.pad_right[2].with[<&sp>]> <proc[msgCommand].context[<%color%><def[value].split[.].get[2]>|drg info <def[value].split[.].get[2]>|<&d>Click for region info]>'
- define entries '<def[entries].include[%entry%]>'
- run s@msgBoxed 'def:dRegions|<proc[msgCommand].context[<&6>dRegions|drg help|<&a>Go back to main help]>|<&e>Region List|drg list|%page%|52|10|<def[entries].separated_by[|]>'
flag:
# /drg flag [ID] [flag] [value] -g group -w world
- define args '<c.args.remove[1]>'
# Check the specified world
- if <def[args].find[-w].is[OR_MORE].than[0]||false> {
- define world '<def[args].get[<def[args].find[-w].add[1].as_int>].as_world.name.escaped.to_lowercase||null>'
- if <def[world].is[==].to[null]||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Invalid world specfied!'
- queue clear
}
- define args '<def[args].remove[<def[args].find_all[-w].parse[add[1].as_int]>].exclude[-w]||li@>'
}
else {
- if <context.server.not> {
- define world '<player.world.name.to_lowercase>'
}
else {
- define world 'null'
}
}
# Check the specified group
- if <def[args].find[-g].is[OR_MORE].than[0]||false> {
- define group '<def[args].get[<def[args].find[-g].add[1].as_int>].escaped.to_lowercase||null>'
- if !<el@val[members|nonmembers|owners|nonowners|all].as_list.contains[%group%]||false> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c><def[group].unescaped> is an invalid group!'
- queue clear
}
- define args '<def[args].remove[<def[args].find_all[-g].parse[add[1].as_int]>].exclude[-g]||li@>'
}
# Check the specified region name
- define region '<def[args].get[1].escaped.to_lowercase||null>'
- if <def[region].is[!=].to[null]||true> {
- define exists '<proc[dRegions_RegionExists].context[<def[region]>|<def[world]>]>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is no region by this name!'
- queue clear
}
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_IsOwner].context[<def[region]>|<def[world]>|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
}
}
else {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You must specify a valid region ID!'
- queue clear
}
# Check the specified flag name
- define flag '<def[args].get[2].escaped.to_lowercase||null>'
- if <def[flag].is[!=].to[null]||true> {
- define flags '<server.list_scripts.filter[starts_with[s@dRegions_Flag_]].parse[name.split[_].get[3]]||li@>'
- if !<def[flags].contains[%flag%]||false> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You must specify a valid region flag!'
- queue clear
}
}
else {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You must specify a valid region flag!'
- queue clear
}
# By this point, we know the flag is being set or cleared, so let's clear the flag
# cache for this region, any child regions, and any overlapping regions including __global__
- run instantly delay:1t s@dRegions p:clearCache 'def:%region%|%world%|%flag%'
# Check the specified flag value and set or clear it.
- define flagValue '<def[args].get[3].to[<def[args].size>].space_separated.escaped||null>'
- if <def[flagValue].is[!=].to[null]||true> {
- define type '<s@dRegions_Flag_%flag%.yaml_key[flag_type]>'
- if <def[type].is[==].to[location]> {
- if <def[flagValue].is[==].to[here]||true> {
- define flagValue '<player.location.simple>'
}
}
- define typeMatch '<proc[dRegion_FlagTypeMatch].context[%flagValue%|%flag%]>'
- if !<def[TypeMatch]> {
- define lines '<proc[dRegions_LineWrap].context[<s@dRegions_Flag_%Flag%.yaml_key[flag_help]||<&c>%flag% flag requires a %type% value!>|45]>'
- foreach <def[lines]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c><def[value]>'
}
- queue clear
}
- if <li@st|sg|stg|stsg.contains[%type%]||false>
&& <def[flagValue].is[==].to[none]||false> {
Line with no clear purpose - missing a -dash- or :colon:?
- inject s@dRegions_Flag_%flag% p:command_handler
- yaml set 'regions.%region%.flags.%flag%:!' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/cache.yml' 'id:dRegions_%world%_cache'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Cleared %flag% flag for region %region%'
- queue clear
}
- inject s@dRegions_Flag_%flag% p:command_handler
- if <s@dRegions_Flag_%flag%.yaml_key[flag_takeGroup]||false> && <def[group].exists> {
- yaml set 'regions.%region%.flags.%flag%:<def[flagValue].unescaped>/%group%' 'id:dRegions_%world%_regions'
}
else {
- yaml set 'regions.%region%.flags.%flag%:<def[flagValue].unescaped>' 'id:dRegions_%world%_regions'
}
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- define string "<&f><&o>%region%<&7><&o> set %flag% flag to <&f><&o>%flagValue%"
- define lines '<proc[dRegions_LineWrap].context[<def[string]>|45]>'
- foreach <def[lines]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&f><&o><def[value].unescaped>'
}
}
else {
- inject s@dRegions_Flag_%flag% p:command_handler
- yaml set 'regions.%region%.flags.%flag%:!' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Cleared %flag% flag for region %region%'
- queue clear
}
setpriority:
# /drg setpriority [ID] [#]
- inject locally prerun instantly
# Check if region exists
- define exists '<proc[dRegions_RegionExists].context[%name%|%world%]>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is no region by this name!'
- queue clear
}
# Check if is owner
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_IsOwner].context[%name%|%world%|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
}
# Verify specified priority
- if <c.args.find[-w].is[OR_MORE].than[0]||false> {
- define args '<c.args.remove[<c.args.find[-w].add[1].as_int>].exclude[-w]>'
- define priority '<def[args].get[3].escaped||null>'
}
else {
- define priority '<c.args.get[3].escaped||null>'
}
- if <def[priority].is[matches].to[number].not||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Must specify a numeric value for priority'
- queue clear
}
# Update region
- yaml set 'regions.%name%.priority:%priority%' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&f><&o>%name%<&7><&o> set priority to <&f><&o>%priority%'
setparent:
# /drg setparent [ID] [parent]
- inject locally prerun instantly
# Check if child region exists
- define exists '<proc[dRegions_RegionExists].context[%name%|%world%]>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is no region by this name!'
- queue clear
}
# Check if is owner
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_IsOwner].context[%name%|%world%|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
}
# Check if parent region exists
- if <c.args.find[-w].is[OR_MORE].than[0]||false> {
- define args '<c.args.remove[<c.args.find[-w].add[1].as_int>].exclude[-w]>'
- define parent '<def[args].get[3].escaped||null>'
}
else {
- define parent '<c.args.get[3].escaped||null>'
}
- if %parent% == null {
- define parent <yaml[dRegions_%world%_regions].read[regions.%name%.parent]||null>
- if %parent% != null {
- yaml set 'regions.%parent%.children:<-:%name%' 'id:dRegions_%world%_regions'
}
- yaml set 'regions.%name%.parent:!' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&7><&o>Unset parent for <&f><&o>%name%'
- queue clear
}
# Check if parent region exists
- define exists '<proc[dRegions_RegionExists].context[%parent%|%world%]>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is no region by this name!'
- queue clear
}
# Check if player owns parent
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_IsOwner].context[%parent%|%world%|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
}
# Update the region
- yaml set 'regions.%name%.parent:%parent%' 'id:dRegions_%world%_regions'
- if <yaml[dRegions_%world%_regions].read[regions.%parent%.children]||li@> contains %name% {
- yaml set 'regions.%parent%.children:<-:%name%' 'id:dRegions_%world%_regions'
}
else {
- yaml set 'regions.%parent%.children:->:%name%' 'id:dRegions_%world%_regions'
}
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&f><&o>%name%<&7><&o> set parent to <&f><&o>%parent%'
teleport:
# /drg teleport [ID] -w world
- narrate "Stub"
- inject locally prerun instantly
# Check if region exists
- define exists '<proc[dRegions_RegionExists].context[%name%|%world%]>'
- if <def[exists]> == orphan {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if !%exists% {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is no region by this name!'
- queue clear
}
# Check if is owner
- if !<player.permission[dregions.admin]||false> && !<player.is_op> {
- if <proc[dRegions_IsOwner].context[%name%|%world%|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
}
# Check for teleport perms
- if !<player.permission[dregions.teleport]||false> && !<player.permission[dregions.teleport.own]||false> && !<player.permission[dregions.teleport.own.%name%]||false> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You do not have permission!'
- queue clear
}
remove:
# /drg remove [ID] -w world
- inject locally prerun instantly
# Check if region exists
- define exists '<proc[dRegions_RegionExists].context[%name%|%world%]>'
- if <def[exists].is[==].to[orphan]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is an orphaned region by this name!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Please notify an admin!'
- queue clear
}
else if <def[exists].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>There is no region by this name!'
- queue clear
}
# Don't remove the __global__ region
- if <def[name].is[==].to[__global__]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You can not remove the __global__ region!'
- queue clear
}
# Check if is owner
- if !<player.permission[dregions.admin]||<player.is_op||false>> {
- if <proc[dRegions_IsOwner].context[%name%|%world%|<player>].not> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You are not an owner of this region!'
- queue clear
}
}
# Remove region from ancestry
# This should be done smarterer now since regions know both children and parents.
- define regions '<yaml[dRegions_%world%_regions].list_keys[regions].exclude[__global__]||li@>'
- foreach %regions% {
- if <yaml[dRegions_%world%_regions].read[regions.%value%.parent]||null> == %name% {
- yaml set 'regions.%value%.parent:<-:%name%' 'id:dRegions_%world%_regions'
}
- if <yaml[dRegions_%world%_regions].read[regions.%value%.children]||li@> contains %name% {
- yaml set 'regions.%value%.children:<-:%name%' 'id:dRegions_%world%_regions'
}
}
# Remove the region
- yaml set 'regions.%name%:!' 'id:dRegions_%world%_regions'
- note remove 'as:dregions_%world%_%name%'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&f><&o>%name%<&7><&o> has been removed from <&f><&o>%world%'
#
# END dRegions Command Arguments
#--------------------------------------
#
# dRegions Command Utilities
#
# Just some commonly used code blocks
#
prerun:
# Block of checks run before /most/ commands
- if !<player.permission[dRegions.%command%]||false> && !<player.is_op> {
- inject locally help
- queue clear
}
- if <c.args.find[-w].is[OR_MORE].than[0]||false> {
- define world '<c.args.get[<c.args.find[-w].add[1].as_int>].escaped.as_world.name.to_lowercase||null>'
- if <def[world].is[==].to[null]||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Invalid world specfied!'
- run s@msgPrefixed delay:1t 'def:dRegions|<script.yaml_key[commandArgs.%command%.usage]>'
- queue clear
}
- define args '<c.args.remove[<c.args.find[-w].add[1].as_int>].exclude[-w]>'
- define name '<def[args].get[2].escaped.to_lowercase||null>'
}
else {
- define world '<player.world.name.to_lowercase>'
}
- if <li@define|redefine|claim.contains[%command%]> {
- define wandType '<player.flag[dWEWand_Type]||cuboid>'
- if <li@cuboid|extender.contains[%wandType%].not||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You must select a cuboid type region!'
- run s@msgPrefixed delay:1t 'def:dRegions|<script.yaml_key[commandArgs.%command%.usage]>'
- queue clear
}
- 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 delay:1t 'def:dRegions|<&c>No region selected!'
- run s@msgPrefixed delay:1t 'def:dRegions|<script.yaml_key[commandArgs.%command%.usage]>'
- queue clear
}
- if <def[pos1].world.name.is[!=].to[%world%]>
|| <def[pos2].world.name.is[!=].to[%world%]> {
Line with no clear purpose - missing a -dash- or :colon:?
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Selected region not within specified world!'
- run s@msgPrefixed delay:1t 'def:dRegions|<script.yaml_key[commandArgs.%command%.usage]>'
- queue clear
}
- define selectedCuboid '<cu@%pos1%|%pos2%>'
}
- define name '<def[name]||<c.args.get[2].escaped.to_lowercase||null>>'
- if '<def[name].is[==].to[null]||true>' {
- if <li@info|select.contains[%command%]> {
- define dRegions '<player.location.cuboids.parse[notable_name].filter[split[_].get[1].is[==].to[dRegions]].parse[after[dregions_%world%_]].separated_by[,]>'
- define orderedRegions '<proc[dRegions_HighestPriority].context[%world%|%dRegions%]>'
- if <def[orderedRegions].is_empty||true> {
- define name '__global__'
}
else {
- define name '<def[orderedRegions].get[1]>'
- if <def[orderedRegions].size.is[MORE].than[1]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c><&o>There are multiple regions at this location!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&7><&o>Getting highest priority region info.'
}
}
}
else {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>You must specify a region ID!'
- run s@msgPrefixed delay:1t 'def:dRegions|<script.yaml_key[commandArgs.%command%.usage]>'
- queue stop
}
}
- if '<def[name].matches[^[a-z0-9-_]+$].not>' {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Region ID may only contain letters, numbers,'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>hyphen, and underscore!'
- run s@msgPrefixed delay:1t 'def:dRegions|<script.yaml_key[commandArgs.%command%.usage]>'
- queue stop
}
- define page "<t[<c.args.filter[is[matches].to[number]].is_empty.not>]:<c.args.filter[is[matches].to[number]].get[1]>||1>"
# - inject s@dRegions_Commands p:selection_Size instantly
# - define oldSize '%size%'
filterRegionList:
# Used in /drg list to apply various filters
- if <def[filterRegion].exists||false> {
- define filteredRegions 'li@'
- foreach %worldRegions% {
- define worldRegion '%value%'
- if <yaml[dRegions_%world%_regions].read[regions.%worldRegion%.parent].is[==].to[<def[region]>]||false> {
- define filteredRegions '<def[filteredRegions].include[%worldRegion%]||<def[filteredRegions]>>'
}
}
}
- if <def[filteredRegions].exists> {
- define worldRegions '<def[filteredRegions]>'
}
- foreach %worldRegions% {
- define worldRegion '%value%'
- if <proc[dRegions_IsOwner].context[<def[worldRegion]>|<def[world]>|<def[player].as_player>]||false> {
- define regions '<def[regions].include[<def[world]>.<def[worldRegion]>.owner]||<def[regions]>>'
}
else if <proc[dRegions_IsMember].context[<def[worldRegion]>|<def[world]>|<def[player].as_player>]||false> {
- define regions '<def[regions].include[<def[world]>.<def[worldRegion]>.member]||<def[regions]>>'
}
else if <def[filterPlayer].exists.not||true> {
- define regions '<def[regions].include[<def[world]>.<def[worldRegion]>.nonmember]||<def[regions]>>'
}
}
regionInfo:
# Build the data set for region info
- define type '<yaml[dRegions_%world%_regions].read[regions.%name%.type]||null>'
- if <def[type].is[==].to[cuboid]||false> {
- define POS1 '<yaml[dRegions_%world%_regions].read[regions.%name%.min]||null>'
- define POS2 '<yaml[dRegions_%world%_regions].read[regions.%name%.max]||null>'
- define size '<proc[selectionSize].context[%pos1%|%pos2%]>'
}
else if <def[type].is[==].to[global]||false> {
- define POS1 '0,0,0,%world%'
- define POS2 '0,0,0,%world%'
- define size 'infinite'
}
else {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>This region is misconfigured!'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Notify an Admin!'
- queue clear
}
- define priority '<yaml[dRegions_%world%_regions].read[regions.%name%.priority]||0>'
- define parent '<yaml[dRegions_%world%_regions].read[regions.%name%.parent]||<&c>none>'
- define ownerGroups '<yaml[dRegions_%world%_regions].read[regions.%name%.owners.groups]||li@>'
- define ownerPlayers '<yaml[dRegions_%world%_regions].read[regions.%name%.owners.players]||li@>'
- define memberGroups '<yaml[dRegions_%world%_regions].read[regions.%name%.members.groups]||li@>'
- define memberPlayers '<yaml[dRegions_%world%_regions].read[regions.%name%.members.players]||li@>'
- define flagList '<yaml[dRegions_%world%_regions].list_keys[regions.%name%.flags]||li@>'
- define flags 'li@'
- foreach %flagList% {
- define flags '<def[flags].include[%value%/<yaml[dRegions_%world%_regions].read[regions.%name%.flags.%value%].as_list.comma_separated||null>]||%flags%>'
}
#
# END dRegions dRegions Command Utilities
#--------------------------------------
#
# dRegions Command Messages
#
# Some messages used by commands. Should probably move to s@dRegions_Msg
#
msgsHeader:
- narrate "<&5>|----------------------------------------|"
- narrate "<&5>|<&sp><&sp><&sp><&6>dRegions <&7><def[msgsHeaderTitle]||>"
- narrate "<&5>|<&f>"
msgsFooter:
# - define anthony "text<&co>'<&7>|Anthony|',clickEvent<&co><&chr[007B]>action<&co>open_url,value<&co>'http<&co>//mineconomy.org'<&chr[007D]>,hoverEvent<&co><&chr[007B]>action<&co>show_item,value<&co>'<&chr[007B]><i@dRegions_Author_Anthony.json><&chr[007D]>'<&chr[007D]>"
# - define spacer "text<&co>' '"
# - define prefix "text<&co>'<&5>| <&f>Authors<&co> '"
- if <player.is_player||false> {
# JSON is broken in denizen. Just narrate for now.
- narrate "<&5>| <&f>Authors<&co> <&7>|Anthony|"
# - execute as_server "tellraw <player.name> <&chr[007B]>text<&co>'',extra<&co>[<&chr[007B]>%prefix%<&chr[007D]>,<&chr[007B]>%anthony%<&chr[007D]>]<&chr[007D]>"
}
else {
- announce to_console "<&5>| <&f>Authors<&co> <&7>|Anthony|"
}
- narrate "<&5>|-----------<&d>S<&5>-<&d>c<&5>-<&d>r<&5>-<&d>o<&5>-<&d>l<&5>-<&d>l<&5>---<&d>U<&5>-<&d>p<&5>-------------|"
msgsHelpAdmin:
# Filter the list of commands this player can use
- define commands '<script.list_keys[commandArgs].alphanumeric.to_lowercase||li@>'
- foreach %commands% {
- if !<player.permission[dregions.%value%]||<player.is_op||<c.server||false>>> {
- define commands '<def[commands].exclude[%value%]>'
}
}
# Display the list
- define page '<def[arg].replace[-].escaped||1>'
- if <def[page].is[MATCHES].to[number].not> {
- define page '1'
}
- define pages '<def[commands].size.div[5].round_up||1>'
- if <def[page].is[MORE].than[%pages%]> {
- define page '%pages%'
}
- define highNumber '<def[page].mul[5].as_int>'
- define lowNumber '<def[highNumber].sub[4].as_int>'
- define msgsHeaderTitle '<&e>Admin Help <el@val[<&7><&o>Page <&f><&o>%page% <&7><&o>of %pages%].pad_left[30]>'
- inject locally msgsHeader instantly
- foreach <def[commands].get[%lowNumber%].to[%highNumber%]||li@> {
- narrate "<&5>|<&sp><&sp><&f><def[value].to_titlecase><&co>"
- narrate "<&5>|<&sp><&sp><&sp><&sp><&7><parse:<script.yaml_key[commandArgs.%value%.usage]||No usage info available!>>"
}
- narrate "<&5>|"
msgsHelpUser:
- define msgsHeaderTitle 'User Help'
- inject locally msgsHeader instantly
- define par1 "dRegions is an advanced region management and world protection system written with the Denizen Scripting Engine."
- define par2 "Heavily inspired by WorldGuard, the goal is to have an extremely efficient events system supporting an exhaustive set of region flags and configuration options."
- define par3 "dRegions offers an intuitive command interface and provides thorough TAB completion."
- define strings "<el@val[%par1%|%par2%|%par3%].as_list>"
- foreach <def[strings]> {
- define string "<&f><&sp><def[value]>"
- define lines '<proc[dRegions_LineWrap].context[<def[string]>|44]>'
- foreach <def[lines]> {
- narrate "<&5>|<&f><&sp><&sp><def[value].unescaped>"
}
- narrate "<&5>|"
}
#
# END dRegions Command Messages
#
#--------------------------------------
#
# Used to process input for some flags
#
dRegions_Flags_CommandProcessors:
type: task
debug: false
command_verifiedList:
- if <def[flagValue].is[==].to[null]||false> {
- yaml set 'regions.%region%.flags.%flag%:!' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Cleared %flag% list for region %region%'
- queue clear
}
else {
- define entries '<def[flagValue].split[ ].get[2].to[<def[flagValue].split[ ].size>].parse[to_lowercase].deduplicate||li@>'
- if <def[entries].get[1].is[==].to[all]> {
- if '<def[flagValue].split[ ].get[1].is[==].to[-a]||false>' {
- yaml set 'regions.%region%.flags.%flag%:all' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&f><&o>%region%<&7><&o> set %flag% flag to <&f><&o>%flagValue%'
- queue clear
}
- if '<def[flagValue].split[ ].get[1].is[==].to[-r]||false>' {
- yaml set 'regions.%region%.flags.%flag%:!' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Cleared %flag% list for region %region%'
- queue clear
}
}
- foreach %entries% {
- if <parse:<s@dRegions_Flag_%Flag%.yaml_key[command_verifyEntry]||false>> {
- define entries '<def[entries].exclude[%value%]||li@>'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c><&o>%value% is not a valid <s@dRegions_Flag_%Flag%.yaml_key[command_entryType]>!'
}
}
- if <def[entries].is_empty||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c><&o>No valid <s@dRegions_Flag_%Flag%.yaml_key[command_entryType]>s specified!'
- define lines '<proc[dRegions_LineWrap].context[<s@dRegions_Flag_%Flag%.yaml_key[flag_help]||<&c>%flag% flag requires a %type% value!>|45]>'
- foreach <def[lines]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c><def[value]>'
}
- queue clear
}
- define currentEntries '<yaml[dRegions_%world%_regions].read[regions.%region%.flags.%flag%].replace[, ].with[|].as_list||li@>'
- if '<def[flagValue].split[ ].get[1].is[==].to[-a]||false>' {
- define flagValue '<def[currentEntries].include[<def[entries].replace[li@]>].deduplicate||li@>'
}
- if '<def[flagValue].split[ ].get[1].is[==].to[-r]||false>' {
- define flagValue '<def[currentEntries].exclude[<def[entries].replace[li@]>].deduplicate||li@>'
}
- if <def[flagValue].is_empty||true> {
- yaml set 'regions.%region%.flags.%flag%:!' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Cleared %flag% list for region %region%'
- queue clear
}
- define flagValue '<def[flagValue].comma_separated>'
}
command_stringList:
- if <def[flagValue].is[==].to[null]||false> {
- yaml set 'regions.%region%.flags.%flag%:!' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Cleared %flag% list for region %region%'
- queue clear
}
- define action '<def[flagValue].split[ ].get[1]>'
- define string '<def[flagValue].after[<def[action]>]>'
- if '<def[string].is[==].to[all]>' {
- if <def[action].is[==].to[-a]||false> {
- yaml set 'regions.%region%.flags.%flag%:all' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&f><&o>%region%<&7><&o> set %flag% flag to <&f><&o>%flagValue%'
- queue clear
}
- if <def[action].is[==].to[-r]||false> {
- yaml set 'regions.%region%.flags.%flag%:!' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Cleared %flag% list for region %region%'
- queue clear
}
}
- if <def[string].length.is[==].to[0]||true> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c><&o>No valid <s@dRegions_Flag_%Flag%.yaml_key[command_entryType]>s specified!'
- define lines '<proc[dRegions_LineWrap].context[<s@dRegions_Flag_%Flag%.yaml_key[flag_help]||<&c>%flag% flag requires a %type% value!>|45]>'
- foreach <def[lines]> {
- run s@msgPrefixed delay:1t 'def:dRegions|<&c><def[value]>'
}
- queue clear
}
- define currentEntries '<yaml[dRegions_%world%_regions].read[regions.%region%.flags.%flag%].replace[ ; ].with[|].as_list||li@>'
- if '<def[action].is[==].to[-a]||false>' {
- define flagValue '<def[currentEntries].include[<def[string]>].deduplicate||li@>'
}
- if '<def[action].is[==].to[-r]||false>' {
- define flagValue '<def[currentEntries].exclude[<def[string]>].deduplicate||li@>'
}
- if <def[flagValue].is_empty||true> {
- yaml set 'regions.%region%.flags.%flag%:!' 'id:dRegions_%world%_regions'
- yaml 'savefile:dRegions/worlds/%world%/regions.yml' 'id:dRegions_%world%_regions'
- run s@msgPrefixed delay:1t 'def:dRegions|<&c>Cleared %flag% list for region %region%'
- queue clear
}
- define flagValue '<def[flagValue].replace[|].with[ ; ].replace[li@]>'
################################################################################
#
# FlagTypeMatch Procedure script
#
# Used to check that the player specified value matches the type required
# by the flag.
#
# Use this to compare 2 values. Check if they are one of NUMBER, DECIMAL,
# LOCATION, BOOLEAN, STATE, GROUP, LIST or any other STRING.
#
# usage:
# - define YourValue "Some string"
# - define Type "<s@dRegions_Flag_%flag%.yaml_key[flag_type]||null>"
# - define TypeMatch '<proc[dRegion_FlagTypeMatch].context[%YourValue%|%flag%]>'
# - if <def[TypeMatch]> {
# - narrate "%YourValue% matches %type%."
# }
# else {
# - narrate "%YourValue% is not a %type%"
# }
#
dRegion_FlagTypeMatch:
# Used to check if the value supplied when setting a flag is valid for the flag type.
type: procedure
debug: false
definitions: YourValue|Flag
script:
- choose '<s@dRegions_Flag_%Flag%.yaml_key[flag_type]||null>':
- case 'number':
- determine '<def[YourValue].is[MATCHES].to[number]>'
- case 'decimal':
- determine '<def[YourValue].is[MATCHES].to[number]>.and[<def[YourValue].as_int.is[==].to[%YourValue%]>]>'
- case 'b':
- determine '<def[YourValue].is[MATCHES].to[boolean]>'
- case 'location':
- determine '<def[YourValue].as_location.world.is[!=].to[null]||false>'
- case 'stg':
- determine '<li@allow|deny|none.contains[%YourValue%]||false>'
- case 'st':
- determine '<li@allow|deny|none.contains[%YourValue%]||false>'
- case 'sg':
- determine '<li@allow|deny|none.contains[%YourValue%]||false>'
- case 'stsg':
- determine '<li@allow|deny|none.contains[%YourValue%]||false>'
- case 'group':
- determine '<li@members|nonmembers|owners|nonowners|all.as_list.contains[%YourValue%]||false>'
- case 'list':
- determine '<def[YourValue].split[ ].get[1].contains_any_text[-a|-r]||false>'
- case 'custom':
- determine '<s@dRegions_Flag_%flag%.yaml_key[flag_type_customVal].as_list.contains[%YourValue%]||false>'
- case 'string':
- determine '<def[YourValue].is[!=].to[null]||false>'
- default:
- determine 'false'
#
################################################################################
#
# dRegions WorldGuard Importer
#
# Import WorldGuard regions to dRegions in one fell swoop.
# Also covers popular WG extensions like WorldGuard Custom Flags and WorldRegions
# A vast majority of flags are handled in this importer, though some have been
# left out. If there is something you need, just ask.
#
# Usage:
# - run s@dRegions_WG_Importer 'def:%worldname%'
#--------------------------------------
dRegions_WG_Importer:
type: task
debug: false
speed: 0
script:
- define world '<def[1]||>'
- define sender '<player||server>'
- if <server.list_scripts> contains 's@dWM_VW' {
- define v '<proc[dWM_VW].context[%world%]>'
- if '%v%' != '0' {
- run instantly delay:1t 's@dWM_Error' 'def:world|%v%|%sender%|%world%'
- queue clear
}
}
else {
- if <server.list_worlds.parse[name]> !contains '%world%' {
- run s@msgPrefixed 'def:dRegions|<&4>Unknown world<&co> %world%! Is it loaded?'
- queue clear
}
}
- if <server.has_file[../WorldGuard/worlds/%world%/regions.yml]||false> {
- if !<yaml.list.contains[dRegions_WGImport_%world%]> {
- yaml fix_formatting 'load:../WorldGuard/worlds/%world%/regions.yml' 'id:dRegions_WGImport_%world%'
}
- if !<server.has_file[dRegions/worlds/<def[world].to_lowercase>/regions.yml]||false> {
- yaml create 'id:dRegions_<def[world].to_lowercase>_regions'
}
- if !<yaml.list.contains[dRegions_<def[world].to_lowercase>_regions]> {
- yaml 'load:dRegions/worlds/<def[world].to_lowercase>/regions.yml' 'id:dRegions_<def[world].to_lowercase>_regions'
}
}
else {
- run s@msgPrefixed 'def:dRegions|<&4>/WorldGuard/worlds/%world%/regions.yml does not exist!'
- queue clear
}
- run s@msgPrefixed 'def:dRegions|<&3>Starting World Import for<&co> %world%'
- log "<&ns.pad_right[80].with[-]>" type:none 'file:/plugins/Denizen/dRegions/worlds/<def[world].to_lowercase>/import.txt'
- log "STARTING WORLD IMPORT FOR<&co> %world%" type:info 'file:/plugins/Denizen/dRegions/worlds/<def[world].to_lowercase>/import.txt'
- foreach '<yaml[dRegions_WGImport_%world%].list_keys[regions]||li@>':
- define region '%value%'
- log "Importing %region%..." type:info 'file:/plugins/Denizen/dRegions/worlds/<def[world].to_lowercase>/import.txt'
- inject locally importRegion instantly
- yaml 'savefile:dRegions/worlds/<def[world].to_lowercase>/regions.yml' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml unload 'id:dRegions_WGImport_%world%'
- log "%world% IMPORT COMPLETE!" type:info 'file:/plugins/Denizen/dRegions/worlds/<def[world].to_lowercase>/import.txt'
- log "<&ns>" type:none 'file:/plugins/Denizen/dRegions/worlds/<def[world].to_lowercase>/import.txt'
- run s@msgPrefixed 'def:dRegions|<&3>%world% IMPORT COMPLETE!'
importRegion:
# Set the region type and coordinates and note the cuboid
- define type '<yaml[dRegions_WGImport_%world%].read[regions.%region%.type]>'
- yaml set 'regions.%region%.type:%type%' 'id:dRegions_<def[world].to_lowercase>_regions'
- if '%type%' == 'cuboid' {
- define min '<yaml[dRegions_WGImport_%world%].read[regions.%region%.min.x]>,<yaml[dRegions_WGImport_%world%].read[regions.%region%.min.y]>,<yaml[dRegions_WGImport_%world%].read[regions.%region%.min.z]>,%world%'
- define max '<yaml[dRegions_WGImport_%world%].read[regions.%region%.max.x]>,<yaml[dRegions_WGImport_%world%].read[regions.%region%.max.y]>,<yaml[dRegions_WGImport_%world%].read[regions.%region%.max.z]>,%world%'
- define cuboid '<el@val[<def[min].as_location>|<def[max].as_location>].as_cuboid>'
- yaml set 'regions.%region%.min:<def[cuboid].min.simple>' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.max:<def[cuboid].max.simple>' 'id:dRegions_<def[world].to_lowercase>_regions'
- note 'cu@<def[cuboid].min.simple>|<def[cuboid].max.simple>' 'as:dregions_<def[world].to_lowercase>_%region%'
}
else {
- log "Unknown region type<&co> %type%" type:warning 'file:/plugins/Denizen/dRegions/worlds/<def[world].to_lowercase>/import.txt'
}
# Set priority
- yaml set 'regions.%region%.priority:<yaml[dRegions_WGImport_%world%].read[regions.%region%.priority]>' 'id:dRegions_<def[world].to_lowercase>_regions'
# Set parent/child associations
- define parent '<yaml[dRegions_WGImport_%world%].read[regions.%region%.parent]||null>'
- if %parent% != null {
- yaml set 'regions.%region%.parent:%parent%' 'id:dRegions_<def[world].to_lowercase>_regions'
- if <yaml[dRegions_<def[world].to_lowercase>_regions].read[regions.%parent%.children].as_list||li@> !contains %region% {
- yaml set 'regions.%parent%.children:->:%region%' 'id:dRegions_<def[world].to_lowercase>_regions'
}
}
# Import members and owners
- define members-players '<yaml[dRegions_WGImport_%world%].read[regions.%region%.members.unique-ids].as_list.exclude[<yaml[dRegions_<def[world].to_lowercase>_regions].read[regions.%region%.members.players]||li@>]||li@>'
- foreach %members-players% {
- yaml set 'regions.%region%.members.players:->:%value%' 'id:dRegions_<def[world].to_lowercase>_regions'
}
- define members-groups '<yaml[dRegions_WGImport_%world%].read[regions.%region%.members.groups].as_list.exclude[<yaml[dRegions_<def[world].to_lowercase>_regions].read[regions.%region%.members.groups]||li@>]||li@>'
- foreach %members-groups% {
- yaml set 'regions.%region%.members.groups:->:%value%' 'id:dRegions_<def[world].to_lowercase>_regions'
}
- define owners-players '<yaml[dRegions_WGImport_%world%].read[regions.%region%.owners.unique-ids].as_list.exclude[<yaml[dRegions_<def[world].to_lowercase>_regions].read[regions.%region%.owners.players]||li@>]||li@>'
- foreach %owners-players% {
- yaml set 'regions.%region%.owners.players:->:%value%' 'id:dRegions_<def[world].to_lowercase>_regions'
}
- define owners-groups '<yaml[dRegions_WGImport_%world%].read[regions.%region%.owners.groups].as_list.exclude[<yaml[dRegions_<def[world].to_lowercase>_regions].read[regions.%region%.owners.groups]||li@>]||li@>'
- foreach %owners-groups% {
- yaml set 'regions.%region%.owners.groups:->:%value%' 'id:dRegions_<def[world].to_lowercase>_regions'
}
# Import flags
- define flags '<yaml[dRegions_WGImport_%world%].list_keys[regions.%region%.flags].filter[ends_with[-group].not]||li@>'
- foreach %flags% {
- define flag '%value%'
- define mapping '<script.yaml_key[mapping.%flag%]||null>'
- if %mapping% == null {
- log "%flag% flag does not exist in dRegions!" type:warning 'file:/plugins/Denizen/dRegions/worlds/<def[world].to_lowercase>/import.txt'
- foreach next
}
- inject s@dRegions_WG_Importer 'p:<def[mapping].split[/].get[1]>'
}
flag_allowed-cmds:
- define commands '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.allowed-cmds].as_list.parse[replace[/]]||li@>'
- yaml set 'regions.%region%.flags.commands:allow' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.commands-list:<def[commands].separated_by[ ; ]>' 'id:dRegions_<def[world].to_lowercase>_regions'
flag_blocked-cmds:
- define commands '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.allowed-cmds].as_list.parse[replace[/]]||li@>'
- yaml set 'regions.%region%.flags.commands:deny' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.commands-list:<def[commands].separated_by[ ; ]>' 'id:dRegions_<def[world].to_lowercase>_regions'
flag_allowed-break:
- define blocks '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.allowed-break]||li@>'
- yaml set 'regions.%region%.flags.block-break:allow' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.block-breaklist:<def[blocks].after[<&lb>].before[<&rb>]>' 'id:dRegions_<def[world].to_lowercase>_regions'
flag_blocked-break:
- define blocks '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.blocked-break]||li@>'
- yaml set 'regions.%region%.flags.block-break:deny' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.block-breaklist:<def[blocks].after[<&lb>].before[<&rb>]>' 'id:dRegions_<def[world].to_lowercase>_regions'
flag_allowed-place:
- define blocks '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.allowed-place]||li@>'
- yaml set 'regions.%region%.flags.block-place:allow' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.block-placelist:<def[blocks].after[<&lb>].before[<&rb>]>' 'id:dRegions_<def[world].to_lowercase>_regions'
flag_blocked-place:
- define blocks '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.blocked-place]||li@>'
- yaml set 'regions.%region%.flags.block-place:deny' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.block-placelist:<def[blocks].after[<&lb>].before[<&rb>]>' 'id:dRegions_<def[world].to_lowercase>_regions'
flag_interact:
- define group '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.interact-group].replace[_].to_lowercase||null>'
- define interact '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.interact]||null>'
- if '%group%' == 'null' {
- define set '%interact%'
}
else {
- define set '%interact%/%group%'
}
- yaml set 'regions.%region%.flags.npc-interact:%set%' 'id:dRegions_<def[world].to_lowercase>_regions'
- if !<yaml[dRegions_<def[world].to_lowercase>_regions].contains[regions.%region%.flags.entity-interact]> {
- yaml set 'regions.%region%.flags.entity-interact:%set%' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.entity-interactlist:all' 'id:dRegions_<def[world].to_lowercase>_regions'
}
- if !<yaml[dRegions_<def[world].to_lowercase>_regions].contains[regions.%region%.flags.use-switches]> {
- yaml set 'regions.%region%.flags.use-switches:%set%' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.use-switches-list:all' 'id:dRegions_<def[world].to_lowercase>_regions'
}
- if !<yaml[dRegions_<def[world].to_lowercase>_regions].contains[regions.%region%.flags.use-utilities]> {
- yaml set 'regions.%region%.flags.use-utilities:%set%' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.use-utilities-blocks:all' 'id:dRegions_<def[world].to_lowercase>_regions'
}
- if !<yaml[dRegions_<def[world].to_lowercase>_regions].contains[regions.%region%.flags.chest-access]> {
- yaml set 'regions.%region%.flags.chest-access:%set%' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.chest-access-blocks:all' 'id:dRegions_<def[world].to_lowercase>_regions'
}
- if !<yaml[dRegions_<def[world].to_lowercase>_regions].contains[regions.%region%.flags.access-access]> {
- yaml set 'regions.%region%.flags.door-access:%set%' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.door-access-doors:all' 'id:dRegions_<def[world].to_lowercase>_regions'
}
flag_entity-explode:
- define currentState '<yaml[dRegions_<def[world].to_lowercase>_regions].read[regions.%region%.flags.entity-explode]||null>'
- define currentList '<yaml[dRegions_<def[world].to_lowercase>_regions].read[regions.%region%.flags.entity-explodelist].replace[, ].with[|].as_list||li@>'
- define flagVal '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%]>'
- define entity '<def[flag].before[-]>'
- if %entity% == enderdragon {
- define entity 'ender_dragon'
}
else if %entity% == tnt {
- define entity 'primed_tnt|minecart_tnt'
}
else if %entity% == ghast {
- define entity 'fireball|small_fireball'
}
else if %entity% == other {
- define entity 'ender_crystal|fireball|small_fireball|wither|wither_skull'
}
- if %currentState% == null {
- yaml set 'regions.%region%.flags.entity-explode:%flagVal%' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.entity-explodelist:<def[entity].as_list.comma_separated>' 'id:dRegions_<def[world].to_lowercase>_regions'
}
else if '%currentState%' == '%flagVal%' {
- define newList '<def[currentList].include[%entity%].deduplicate>'
- if <def[newList].contains[creeper|ender_crystal|ender_dragon|primed_tnt|minecart_tnt|fireball|small_fireball|wither|wither_skull]> {
- define newList 'all'
}
else {
- define newList '<def[newList].comma_separated>'
}
- yaml set 'regions.%region%.flags.entity-explodelist:%newList%' 'id:dRegions_<def[world].to_lowercase>_regions'
}
- inject locally flag_entity-grief
flag_deny-spawn:
# This needs work
- define currentState '<yaml[dRegions_<def[world].to_lowercase>_regions].read[regions.%region%.flags.mob-spawn]||null>'
- define currentList '<yaml[dRegions_<def[world].to_lowercase>_regions].read[regions.%region%.flags.mob-spawnlist].replace[, ].with[|].as_list||li@>'
- define mobSpawn '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.mob-spawning]||null>'
- define denySpawn '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.deny-spawn]||null>'
- if %denySpawn% != null {
- yaml set 'regions.%region%.flags.mob-spawn:deny' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.mob-spawnlist:<def[denySpawn].as_list.comma_separated>' 'id:dRegions_<def[world].to_lowercase>_regions'
}
else {
- yaml set 'regions.%region%.flags.mob-spawn:%mobSpawn%' 'id:dRegions_<def[world].to_lowercase>_regions'
}
flag_entity-grief:
- define currentState '<yaml[dRegions_<def[world].to_lowercase>_regions].read[regions.%region%.flags.entity-grief]||null>'
- define currentList '<yaml[dRegions_<def[world].to_lowercase>_regions].read[regions.%region%.flags.entity-grieflist].replace[, ].with[|].as_list||li@>'
- define flagVal '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%]||null>'
- define entity '<def[flag].before[-]>'
- if %entity% == enderdragon {
- define entity 'ender_dragon'
}
else if %entity% == tnt {
- define entity 'primed_tnt|minecart_tnt'
}
else if %entity% == wither {
- define entity 'wither|wither_skull'
}
else if %entity% == ghast {
- define entity 'ghast|fireball|small_fireball'
}
else if %entity% == other {
- define entity 'ender_crystal|fireball|small_fireball|wither|wither_skull'
}
- if %currentState% == null {
- yaml set 'regions.%region%.flags.entity-grief:%flagVal%' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.entity-grieflist:<def[entity].as_list.comma_separated>' 'id:dRegions_<def[world].to_lowercase>_regions'
}
else if '%currentState%' == '%flagVal%' {
- define newList '<def[currentList].include[%entity%].deduplicate>'
- if <def[newList].contains[creeper|enderman|ender_dragon|ghast|fireball|small_fireball|primed_tnt|minecart_tnt|zombie|wither|wither_skull|sheep]> {
- define newList 'all'
}
else {
- define newList '<def[newList].comma_separated>'
}
- yaml set 'regions.%region%.flags.entity-grieflist:%newList%' 'id:dRegions_<def[world].to_lowercase>_regions'
}
flag_boolean:
- yaml set 'regions.%region%.flags.<def[mapping].split[/].get[2]>:<tern[<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%].is[==].to[deny]>]:false||true>' 'id:dRegions_<def[world].to_lowercase>_regions'
flag_generic:
- yaml set 'regions.%region%.flags.<def[mapping].split[/].get[2]>:<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%]>' 'id:dRegions_<def[world].to_lowercase>_regions'
flag_generic-list:
- yaml set 'regions.%region%.flags.<def[mapping].split[/].get[2]>:<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%]>' 'id:dRegions_<def[world].to_lowercase>_regions'
- yaml set 'regions.%region%.flags.<def[mapping].split[/].get[3]>:all' 'id:dRegions_<def[world].to_lowercase>_regions'
flag_generic-group:
- define group '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%-group].replace[_].to_lowercase||null>'
- if %group% == null {
- yaml set 'regions.%region%.flags.<def[mapping].split[/].get[2]>:<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%]>' 'id:dRegions_<def[world].to_lowercase>_regions'
}
else {
- yaml set 'regions.%region%.flags.<def[mapping].split[/].get[2]>:<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%]>/%group%' 'id:dRegions_<def[world].to_lowercase>_regions'
}
flag_generic-list-group:
- define group '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%-group].replace[_].to_lowercase||null>'
- if %group% == null {
- yaml set 'regions.%region%.flags.<def[mapping].split[/].get[2]>:<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%]>' 'id:dRegions_<def[world].to_lowercase>_regions'
}
else {
- yaml set 'regions.%region%.flags.<def[mapping].split[/].get[2]>:<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%]>/%group%' 'id:dRegions_<def[world].to_lowercase>_regions'
}
- yaml set 'regions.%region%.flags.<def[mapping].split[/].get[3]>:all' 'id:dRegions_<def[world].to_lowercase>_regions'
flag_generic-string:
- define colorMap 'li@r/c|R/4|y/e|Y/6|g/a|G/2|c/b|C/3|b/9|B/1|p/d|P/5|0/0|1/8|2/7|w/f|k/k|l/l|m/m|n/n|o/o|x/r'
- define string '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%]>'
- foreach '%colorMap%':
- define string '<def[string].replace[regex:&<def[value].before[/]>].with[&<def[value].after[/]>]>'
- yaml set 'regions.%region%.flags.<def[mapping].split[/].get[2]>:%string%' 'id:dRegions_<def[world].to_lowercase>_regions'
flag_generic-location:
- foreach 'li@x|y|z|pitch|yaw|world':
- define %value% '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%.%value%]>'
- define loc '%x%,%y%,%z%,%pitch%,%yaw%,%world%'
- define group '<yaml[dRegions_WGImport_%world%].read[regions.%region%.flags.%flag%-group].replace[_].to_lowercase||null>'
- if '%group%' == 'null' {
- yaml set 'regions.%region%.flags.<def[mapping].split[/].get[2]>:%loc%' 'id:dRegions_<def[world].to_lowercase>_regions'
}
else {
- yaml set 'regions.%region%.flags.<def[mapping].split[/].get[2]>:%loc%/%group%' 'id:dRegions_<def[world].to_lowercase>_regions'
}
mapping:
# WorldGuard Flags
allowed-cmds: flag_allowed-cmds
blocked-cmds: flag_blocked-cmds
build: flag_generic-group/build
block-break: flag_generic-group/block-break
block-place: flag_generic-group/block-place
chest-access: flag_generic-list-group/chest-access/chest-access-blocks
chorus-fruit-teleport: flag_generic-group/chorusfruit
creeper-explosion: flag_entity-explode
deny-spawn: flag_deny-spawn
enderdragon-block-damage: flag_entity-explode
enderman-grief: flag_entity-grief
enderpearl: flag_generic-group/enderpearl
entity-item-frame-destroy: flag_generic/entity-break-itemframe
entity-painting-destroy: flag_generic/entity-break-painting
entry: flag_generic-group/entry
# entry-deny-message: flag_generic-string/entry-deny-message
exit: flag_generic-group/exit
# exit-deny-message: flag_generic-string/exit-deny-message
exit-override: flag_generic-group/exit-override
exit-via-teleport: flag_generic-group/exit-via-teleport
# exp-drops:
# fall-damage:
farewell: flag_generic-string/farewell
feed-amount: flag_generic-group/feed-amount
feed-delay: flag_generic/feed-delay
feed-max-hunger: flag_generic/feed-max
feed-min-hunger: flag_generic/feed-min
fire-spread: flag_generic-list/fire-spread/fire-spreadblocks
game-mode: flag_generic-group/gamemode
ghast-fireball: flag_entity-explode
grass-growth: flag_generic/grass-spread
greeting: flag_generic-string/greeting
heal-amount: flag_generic-group/heal-amount
heal-delay: flag_generic/heal-delay
heal-max-health: flag_generic/heal-max
heal-min-health: flag_generic/heal-min
ice-form: flag_boolean/ice-form
ice-melt: flag_boolean/ice-melt
interact: flag_interact
invincible: flag_generic-list-group/player-damage/player-damage-types
item-drop: flag_generic-group/player-drops
item-pickup: flag_generic-group/player-pickup
lava-fire: flag_boolean/lava-fire
lava-flow: flag_generic-list/lava-spread/lava-spreadblocks
leaf-decay: flag_boolean/leaf-decay
lighter: flag_generic-group/lighter
lightning: flag_generic-list/lightning-strike/lightning-strikeblocks
mob-damage: flag_generic-list-group/mob-damage/mob-damagelist
mob-spawning: flag_deny-spawn
mushroom-growth: flag_boolean/mushroom-spread
mycelium-spread: flag_boolean/mycel-spread
notify-enter: flag_boolean/notify-enter
notify-leave: flag_boolean/notify-exit
other-explosion: flag_entity-explode
pistons: flag_boolean/pistons
potion-splash: flag_boolean/potion-throw
pvp: flag_boolean/pvp
recieve-chat: flag_generic-group/recieve-chat
# ride:
send-chat: flag_generic-group/send-chat
sleep: flag_generic-group/sleep
snow-fall: flag_generic-list/snow-fall/snow-fallblocks
snow-melt: flag_boolean/snow-melt
soil-dry: flag_boolean/soil-dry
spawn: flag_generic-location/spawn
teleport: flag_generic-location/teleport
time-lock: flag_generic-group/time-lock
tnt: flag_entity-explode
# use:
vehicle-destroy: flag_generic-group/vehicle-destroy
vehicle-place: flag_generic-group/vehicle-place
vine-growth: flag_boolean/vine-spread
water-flow: flag_generic-list/water-spread/water-spreadblocks
weather-lock: flag_generic-group/weather-lock
# WorldRegions flags http://dev.bukkit.org/bukkit-plugins/worldregions/
# allow-blocks:
# deny-blocks:
# chat-prefix:
# chat-suffix:
# chunk-unload:
# cmds-block:
# cmds-allow:
# allow-pickup:
# death-drop-despawn-time:
# death-exp-despawn-time:
# drop-despawn-time:
# exp-despawn-time:
# enderpearls:
# allow-explosions:
# deny-explosions:
# fly:
# instabreak:
# keep-inventory:
# keep-level:
# mob-damage-allow:
# mob-damage-deny:
# allow-damage:
# deny-damage:
# player-enter-command:
# player-leave-command:
# server-enter-command:
# server-leave-command:
# effects:
# signs-allow:
# signs-block:
# respawn-location:
# texturepack:
# delta-time:
# fix-time:
# max-time:
# min-time:
# treefarm:
# WorldGuard Custom Flags http://dev.bukkit.org/bukkit-plugins/worldguard-custom-flags/pages/flags/
allowed-break: flag_allowed-break
# allowed-damage:
allowed-place: flag_allowed-place
# apply-potion:
blocked-break: flag_blocked-break
# blocked-damage:
blocked-place: flag_blocked-place
# healing:
# hunger:
# instabreak:
# item-pickup:
# item-spawn:
mob-targeting: flag_generic-list-group/mob-target/mob-targetlist
pve: flag_generic-list-group/pve/pve-moblist
# regen:
sheep-eat: flag_entity-grief
# time:
wither-block-damage: flag_entity-grief
zombie-door-break: flag_entity-grief
################################################################################