Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fill(x: String, y: String, z: String, loc2: location, world: String, block: String, p: player):
- set {_loc1} to location ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) of world "%{_world}%"
- if {_block} is "scematic_dirt_machine":
- clear {scematic::block::%{_p}%::types::*}
- loop blocks between block at {_loc1} and block at {_loc2}:
- add "%location of loop-block%$%loop-block%" to {scematic::block::%{_p}%::types::*}
- if loop-block is air:
- set block at location of loop-block to green glass block
- else:
- set block at location of loop-block to red glass block
- function getDirectionalBlock(i: item, d: direction) :: item:
- set {_block::north} to 1
- set {_block::south} to 3
- set {_block::west} to 4
- set {_block::east} to 5
- send "%{_i}%:%{_block::%{_d}%}%" to console
- return "%{_i}%:%{_block::%{_d}%}%" parsed as an item
- function getOppositeDirection(direction: direction) :: direction:
- loop split "%{_direction}%" by "and":
- if {_dir} is not set:
- set {_dir} to numbersIn(loop-value)
- set {_final} to loop-value
- else if numbersIn(loop-value) > {_dir}:
- set {_dir} to numbersIn(loop-value)
- set {_final} to loop-value
- if {_final} contains "north":
- return north
- if {_final} contains "east":
- return east
- if {_final} contains "south":
- return south
- if {_final} contains "west":
- return west
- function getUpStairDirection(i: item, d: direction, j: number) :: item:
- set {_block::north} to 3
- set {_block::south} to 2
- set {_block::west} to 1
- set {_block::east} to 8
- set {_rblock} to {_block::%{_d}%}
- send "&6%{_i}%:%{_rblock}%" to console
- return "%{_i}%:%{_block::%{_d}%}%" parsed as an item
- function getDownStairDirection(i: item, d: direction, j: number) :: item:
- set {_block::north} to 3
- set {_block::south} to 2
- set {_block::west} to 1
- set {_block::east} to 8
- set {_rblock} to {_block::%{_d}%}
- send "&6%{_i}%:%{_rblock}%" to console
- return "%{_i}%:%{_block::%{_d}%}%" parsed as an item
- function getOppositeDirection(direction: direction) :: direction:
- loop split "%{_direction}%" by "and":
- if {_dir} is not set:
- set {_dir} to numbersIn(loop-value)
- set {_final} to loop-value
- else if numbersIn(loop-value) > {_dir}:
- set {_dir} to numbersIn(loop-value)
- set {_final} to loop-value
- if {_final} contains "north":
- return north
- if {_final} contains "east":
- return east
- if {_final} contains "south":
- return south
- if {_final} contains "west":
- return west
- function numbersIn(s: String) :: number:
- set {_return} to ""
- loop {_s} split at "":
- set {_num} to loop-value parsed as a number
- if {_num} is set:
- "%{_num}%" = "%loop-value%"
- set {_return} to "%{_return}%%{_num}%"
- return {_return} parsed as a number
- function addNumber(x: number, y: number, z: number, w: world, dir: direction, num: number) :: location:
- if {_dir} is north:
- remove {_num} from {_z}
- if {_dir} is east:
- add {_num} to {_x}
- if {_dir} is south:
- add {_num} to {_z}
- if {_dir} is west:
- remove {_num} from {_x}
- set {_return} to location {_x}, {_y}, {_z} of world "%{_w}%"
- return {_return}
- function remove(x: String, y: String, z: String, loc2: location, world: String, block: String, p: player):
- set {_loc1} to location ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) of world "%{_world}%"
- if {_block} is "scematic_dirt_machine":
- loop {scematic::block::%{_p}%::types::*}:
- set {_list} to loop-value
- set {_list::*} to {_list} split at "$"
- set {_loc} to {_list::1}
- set {_type} to {_list::2}
- set {_loc::*} to {_loc} split at ","
- set {_x} to {_loc::1}
- set {_y} to {_loc::2}
- set {_z} to {_loc::3}
- replace "x: " in {_x} with ""
- replace " y: " in {_y} with ""
- replace " z: " in {_z} with ""
- set block at location at ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) in world "%{_world}%" to ({_type} parsed as an item)
Add Comment
Please, Sign In to add comment