Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #- Originally By Mortimier for Chunk Apocalypse
- #- Edited By DancingNinjas_ for Underground Parallel
- options:
- P: &c[&eUP&c]
- command /undergroundparallel <integer> <integer> <world>:
- permission: skript.op
- usage: /undergroundparallel <map radius> <radius of blocks to change every 5 ticks> <world name>
- trigger:
- set {_chunknum} to 2*arg 1/arg 2
- set {_chunkx} to arg 1
- set {_chunkz} to arg 1
- set {_size} to arg 2
- if {_chunkz} is not divisible by {_size}:
- send "{@P} %{_chunkz}% is not divisible by %{_size}%!"
- send "{@P} Please change %{_size}% to a new value or increase the map radius!"
- stop
- broadcast "{@P} Generating Underground Parallel in '%arg 3%'! There may be lag!"
- loop {_chunknum} times:
- loop {_chunknum} times:
- {undergroundparallel.cancel} is true:
- set {undergroundparallel.cancel} to false
- stop trigger
- send "{@P} Creating Underground Parallel at x: %{_chunkx}%, z: %{_chunkz}%" to all ops
- loop blocks from (block at (the location at {_chunkx}, 55, {_chunkz} in arg 3)) to (block at (the location at ({_chunkx}-{_size}), 55, {_chunkz} in arg 3)):
- loop blocks from (loop-block-1) to (the block {_size} meters north of loop-block-1):
- loop blocks from (loop-block-2) to (the block 40 meters above loop-block-2):
- if loop-block-3 is leaves:
- set {_randomchance} to a random integer between 0.3 and 199.8
- if {_randomchance} is 1:
- set block at location (loop-block-3's x coordinate), ((loop-block-3's y coordinate) - 54), (loop-block-3's z coordinate) in arg-3 to diamond ore
- else if {_randomchance} is 2 or 3:
- set block at location (loop-block-3's x coordinate), ((loop-block-3's y coordinate) - 54), (loop-block-3's z coordinate) in arg-3 to gold ore
- else if {_randomchance} is between 4 and 52:
- set block at location (loop-block-3's x coordinate), ((loop-block-3's y coordinate) - 54), (loop-block-3's z coordinate) in arg-3 to coal ore
- else if {_randomchance} is between 53 and 100:
- set block at location (loop-block-3's x coordinate), ((loop-block-3's y coordinate) - 54), (loop-block-3's z coordinate) in arg-3 to iron ore
- else if {_randomchance} is between 101 and 200:
- set block at location (loop-block-3's x coordinate), ((loop-block-3's y coordinate) - 54), (loop-block-3's z coordinate) in arg-3 to stone
- else if loop-block-3 is oak wood or spruce wood or birch wood or acacia wood or dark oak wood or jungle wood:
- set {_randomchance} to a random integer between 0.3 and 100.2
- if {_randomchance} is between 0 and 10:
- chance of 50%:
- set block at location (loop-block-3's x coordinate), ((loop-block-3's y coordinate) - 54), (loop-block-3's z coordinate) in arg-3 to glowstone
- else:
- set block at location (loop-block-3's x coordinate), ((loop-block-3's y coordinate) - 54), (loop-block-3's z coordinate) in arg-3 to redstone ore
- else:
- set block at location (loop-block-3's x coordinate), ((loop-block-3's y coordinate) - 54), (loop-block-3's z coordinate) in arg-3 to gravel
- else:
- if loop-block-3 is air:
- if block at location (loop-block-3's x coordinate), ((loop-block-3's y coordinate) - 54), (loop-block-3's z coordinate) in arg-3 is not wood plank or fence or rail or cobweb:
- set block at location (loop-block-3's x coordinate), ((loop-block-3's y coordinate) - 54), (loop-block-3's z coordinate) in arg-3 to block at loop-block-3
- else:
- set block at location (loop-block-3's x coordinate), ((loop-block-3's y coordinate) - 54), (loop-block-3's z coordinate) in arg-3 to block at loop-block-3
- wait 5 tick
- subtract arg 2 from {_chunkx}
- set {_chunkx} to arg 1
- subtract {_size} from {_chunkz}
- send "{@P} Underground Parallel Process Finished!" to all ops
- command /upcancel:
- permission: skript.op
- trigger:
- set {undergroundparallel.cancel} to true
- send "{@P} Underground Parallel Process Cancelled!" to all ops
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement