-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrandom_surface_block.yml
31 lines (31 loc) · 1.11 KB
/
random_surface_block.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
DUL_random_surface_block:
type: procedure
definitions: location|radius
debug: false
DUL:
name:
- Random Surface Block
author:
- BlackCoyote
description:
- Finds a random surface block within the provided radius more efficiently than conventional denizen tags.
usage:
- <proc[DUL_random_surface_block].context[<l@location>|<radius>]>
example:
- <proc[DUL_random_surface_block].context[<player.location>|5000]>
script:
- if <def[location]||null> !matches location {
- debug error "DUL - No valid location specified!"
- determine null
}
- if <def[radius]||null> !matches number {
- debug error "DUL - No valid radius specified!"
- determine null
}
- while true:
- define newloc <def[location].add[<util.random.int[<def[radius].mul[-1]>].to[<def[radius]>]>,0,<util.random.int[<def[radius].mul[-1]>].to[<def[radius]>]>].highest.find.surface_blocks.within[5].get[1]||null>
- if <def[newloc]> != null && <def[newloc].material.is_occluding> {
- determine <def[newloc].above>
} else if <def[loop_index]> >= 10 {
- determine null
}