import('shapes','draw_sphere', 'draw_diamond', 'draw_filled_diamond', 'draw_pyramid', 'draw_prism'); //importing all the shape funcs from the other app __config() -> { 'commands'->{ 'sphere
'->_(c,r,b)->draw('draw_sphere',[c,r, true],b,null), 'sphere
replace '->_(c,r,b,rp)->draw('draw_sphere',[c,r,true],b,rp), 'ball
'->_(c,r,b)->draw('draw_sphere',[c,r,false],b,null), 'ball
replace '->_(c,r,b,rp)->draw('draw_sphere',[c,r,false],b,rp), 'diamond
hollow' -> _(c,r,b)->draw('draw_diamond',[c,r],b,null), 'diamond
hollow replace '->_(c,r,b,rp)->draw('draw_diamond',[c, r], b, rp), 'diamond
' -> _(c,r,b)->draw('draw_filled_diamond',[c,r],b,null), 'diamond
replace '->_(c,r,b,rp)->draw('draw_filled_diamond',[c, r], b, rp), 'pyramid
'->_(c,r,h,p,o,b,ho)->draw('draw_pyramid',[c,r,h,p,o,ho, true],b,null), 'pyramid
replace '->_(c,r,h,p,o,b,ho,rp)->draw('draw_pyramid', [c,r,h,p,o,ho,true],b,rp), 'cone
'->_(c,r,h,p,o,b,ho)->draw('draw_pyramid',[c,r,h,p,o,ho, false],b,null), 'cone
replace '->_(c,r,h,p,o,b,ho,rp)->draw('draw_pyramid', [c,r,h,p,o,ho,false],b,rp), 'cuboid
'->_(c,r,h,o,b,ho)->draw('draw_prism',[c,r,h,p,o,ho, true],b,null), 'cuboid
replace '->_(c,r,h,o,b,ho,rp)->draw('draw_prism', [c,r,h,o,ho,true],b,rp), 'cylinder
'->_(c,r,h,o,b,ho)->draw('draw_prism',[c,r,h,p,o,ho, false],b,null), 'cylinder
replace '->_(c,r,h,o,b,ho,rp)->draw('draw_prism', [c,r,h,o,ho,false],b,rp), }, 'arguments'->{ 'center'->{'type'->'pos', 'loaded'->'true'}, 'radius'->{'type'->'int', 'suggest'->[], 'min'->0},//to avoid default suggestions 'replacement'->{'type'->'blockpredicate'}, 'height'->{'type'->'int', 'suggest'->[],'min'->0}, 'orientation'->{'type'->'term', 'suggest'->['x','y','z']}, 'pointing'->{'type'->'term','suggest'->['up','down']}, 'hollow'->{'type'->'term','suggest'->['hollow','solid']}, }, 'scope'->'global'//todo decide whether it rly needs to be global or not... }; _block_matches(existing, block_predicate) -> ( [name, block_tag, properties, nbt] = block_predicate; (name == null || name == existing) && (block_tag == null || block_tags(existing, block_tag)) && all(properties, block_state(existing, _) == properties:_) && (!tag || tag_matches(block_data(existing), tag)) ); draw(what, args, block, replacement)->(//custom setter cos it's easier positions = call(what,args); //returning blocks to be set affected = 0 for(positions, existing = block(_); if(block != existing && (!replacement || _block_matches(existing, replacement)), affected += bool(set(existing,block)) ) ); print(player,format('gi Filled ' + affected + ' blocks')); );