Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- P: &7[&9BigRiver&7]&r
- Start1: &b%command sender%&r in &b%arg-3%:&r Radius: &b%arg-1%&r | Width: &b%arg-2%
- Start2: Get away from the BigRiver! Your game may crash!
- Cancel: River generation cancelled by &b%{BigRiver.Cancel}%!
- Cancelling: Cancelling BigRiver generation!
- Message.Delay: 5 seconds
- command /bigriver <text> [<integer>] [<world>]:
- usage: /bigriver <map radius> <crack radius> <world> | /BigRiver cancel
- permission: skript.bigriver
- trigger:
- if arg-1 is "cancel":
- if {BigRiver.Running} is true:
- set {BigRiver.Cancel} to true
- stop trigger
- else:
- message "{@P} No generation is in progress!"
- stop trigger
- if arg-1 is set:
- if arg-2 is not set:
- message "{@P} /bigriver <map radius> <crack radius> <world>"
- stop trigger
- broadcast "{@P} {@Start1}"
- broadcast "{@P} {@Start2}"
- set {BigRiver.Running} to true
- set {_MapRadius} to arg-1 parsed as integer
- set {_CrackRadius} to arg-2
- set {_World} to arg-3
- set {_TotalSlice} to 0
- set {_Slice} to 0
- if {_MapRadius} is less than 250:
- set {_Buffer} to 10
- else if {_MapRadius} is less than 500:
- set {_Buffer} to 6
- else if {_MapRadius} is less than 1000:
- set {_Buffer} to 4
- else:
- set {_Buffer} to 2
- wait 5 ticks
- set {_Tick} to now
- set {_Notify} to now
- loop 256 times:
- if {BigRiver.Cancel} is set:
- set {BigRiver.Cancel} to (name of command sender)
- message "{@P} {@Cancelling}"
- broadcast "{@P} {@Cancel}"
- delete {BigRiver.Running}
- delete {BigRiver.Cancel}
- stop trigger
- loop blocks from (block at (the location at ({_MapRadius}-0.5), (256-(loop-number)), ({_CrackRadius}-0.5) of the world {_World})) to (block at (the location at ({_MapRadius}-0.5), (256-(loop-number)), (0-{_CrackRadius}+0.5) of the world {_World})):
- loop blocks from loop-block-1 to (block (({_MapRadius}*2)-1) west of loop-block-1):
- set loop-block-2 to air
- y-coordinate of loop-block-2 is less than 64
- set loop-block-2 to water
- add 1 to {_Slice}
- if {_Slice} is equal to {_Buffer}:
- add {_Slice} to {_TotalSlice}
- set {_Slice} to 0
- if {_Notify} was more than {@Message.Delay} ago:
- set {_Notify} to now
- broadcast "{@P} Progress: &bSlice %(loop-number)%/256"
- wait 1 tick
- broadcast "{@P} River generation finished!"
- delete {BigRiver.Running}
- delete {BigRiver.Cancel}
- on physics:
- {BigRiver.Running} is true
- cancel the event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement