GP_to_dP_converter: type: command debug: false data: ##GriefPrevention Claims will be named: 'GP_<#>'. Change the Prefix if you already using denizen areas with this format. prefix: GP_ name: gptodp description: converts GP claims to dP claims usage: /gptodp permission: gptodp script: - if ! || !: - narrate "dPrevention is not installed. Cancelling conversion." - stop #Loop through all GriefPrevention claims. - foreach ]> as:claim: - define id <[claim].id> #Create a noted denizen area. - note <[claim].cuboid> as:<[id]> - define cuboid ]> #If the claim is an adminclaim, create a dPrevention admin claim. - if <[claim].is_adminclaim>: - if <[claim].cuboid.world.flag[dPrevention.areas.admin.cuboids].contains[<[cuboid]>].if_null[false]>: - announce to_console "An admin claim with the id <[id].custom_color[emphasis]> exists already!" - foreach next - run dPrevention_area_creation def:]> - flag <[cuboid].world> dPrevention.areas.admin.cuboids:->:<[cuboid]> - announce to_console "An admin claim was created, with id: <[id].color[red]>" - else: #If the claim is not an admin claim, create a dPrevention claim and set the owner. - if <[claim].cuboid.world.flag[dPrevention.areas.cuboids].contains[<[cuboid]>].if_null[false]>: - announce to_console "A player claim with the id <[id].custom_color[emphasis]> exists already!" - foreach next - run dPrevention_area_creation def:].include[<[claim].owner>]> - flag <[cuboid].world> dPrevention.areas.cuboids:->:<[cuboid]> - flag <[claim].owner> dPrevention.areas.cuboids:->:<[cuboid]> - announce to_console "A player claim was created, with id: <[id].color[red]>. Owner: <[claim].owner.name.color[gold]>" #If the GriefPrevention claim does have builders listed, whitelist them onto the claim. - if !<[claim].builders.is_empty>: - define builders <[claim].builders.parse[uuid]> - flag <[cuboid]> dPrevention.permissions.block-break:|:<[builders]> - flag <[cuboid]> dPrevention.permissions.block-place:|:<[builders]> - flag <[cuboid]> dPrevention.permissions.container-access:|:<[builders]> - flag <[cuboid]> dPrevention.permissions.use:|:<[builders]> - announce to_console "<[claim].builders.parse[name].space_separated.color[yellow]> were added to the claim <[id].color[red]>. Bypassing flags: ." #If the GriefPrevention claim does have containers listed, whitelist them onto the claim. - if !<[claim].containers.is_empty>: - flag <[cuboid]> dPrevention.permissions.container-access:|:<[claim].containers.parse[uuid]> - announce to_console "<[claim].containers.parse[name].space_separated.color[green]> were added to the claim <[id].color[red]>. Bypassing flags: ." #Loop through the players and set their blocks and bonus blocks. - foreach as:player: - flag <[player]> dPrevention.blocks.amount.per_time:<[player].griefprevention.blocks.if_null[0]> - flag <[player]> dPrevention.blocks.amount.per_block:<[player].griefprevention.blocks.bonus.if_null[0]> - define in_use <[player].flag[dPrevention.areas.cuboids].if_null[].parse_tag[<[parse_value].as_cuboid.proc[dPrevention_get_costs]>].sum> - flag <[player]> dPrevention.blocks.amount.in_use:<[in_use]> - announce to_console "<[player].name.color[light_purple]> - <[player].griefprevention.blocks.color[green]> - <[player].griefprevention.blocks.bonus> - <[in_use]>" - wait 1s - announce to_console "Saving denizen files." - adjust server save