Merge branch 'master' into 1.16

This commit is contained in:
gnembon committed 2020-06-03 03:47:55 -03:00
commit bf2d412a66
19 files changed
+690 -78

No files matched your search

@@ -229,4 +229,18 @@ __on_player_changes_dimension(player, from_pos, from_dimension, to_pos, to_dimen
print(' - player: '+player);
print(' - from '+from_dimension+' at '+map(from_pos, str('%.2f',_)));
print(' - to '+to_dimension+if(to_pos == null, '', ' at '+map(to_pos, str('%.2f',_))));
)
);
__on_player_connects(player) ->
( // you will never sees it
print('');
print('__on_player_connects(player)');
print('Player '+player+' connects.')
);
__on_player_disconnects(player, reason) ->
( // you will never sees it either
print('');
print('__on_player_disconnects(player)');
print('Player '+player+' disconnects because: '+reason)
);
@@ -12,7 +12,7 @@ global_renderers = m(
l('active', false),
l('handler', '__chunk_renderer'),
l('tasks', m()),
l('range', 4)
l('range', 6)
)),
l('shapes', m(
l('active', false),
@@ -99,7 +99,7 @@ __structure_renderer(player_name) ->
total_size = _euclidean(from, to);
density = max(10, total_size/10);
//particle_box('dust 0 1 1 2', from, to+1, density);
draw_shape('box', 15, 'from', from, 'to', to+1, 'color', 0x00FFFFFF);
draw_shape('box', 15, 'from', from, 'to', to+1, 'color', 0x00FFFFFF, 'width', 3);
structure_pieces = slice(sort_key(structure_pieces, _euclidean_sq((_:2+_:3)/2,ppos)), 0, config:'max_pieces');
for (structure_pieces, l(piece, direction, from, to) = _;
//factor = 1- _i / config:'max_pieces' / 2;
@@ -110,8 +110,8 @@ __structure_renderer(player_name) ->
g = r;
b = 255;
a = 255;
color = a+256*(b+256*(g+256*r));
draw_shape('box', 15, 'from', from, 'to', to+1, 'color', color);
color = 256*(b+256*(g+256*r)); // leaving out a
draw_shape('box', 15, 'from', from, 'to', to+1, 'color', color+a, 'fill', color+a/6);
)
)
);
@@ -126,10 +126,9 @@ __chunk_renderer(player_name) ->
// get lower corner of the chunk
ppos = map(pos(p)/16, floor(_))*16;
ppos:1 = 0;
r = config:'range';
for(range(-r,r), cx =_;
for (range(-r,r), cz = _;
rang = config:'range';
for(range(-rang,rang), cx =_;
for (range(-rang,rang), cz = _;
ref_pos = ppos + l(16*cx,0,16*cz);
if(has(config:'tasks':'slime_chunks') && in_slime_chunk(ref_pos),
player_distance = _euclidean(ppos, ref_pos);
@@ -142,12 +141,12 @@ __chunk_renderer(player_name) ->
b = 30;
a = max(0, 255-player_distance);
color = a+256*(b+256*(g+256*r));
draw_shape('box', 15, 'from', top_00, 'to', top_10, 'color', color);
draw_shape('box', 15, 'from', top_10, 'to', top_11, 'color', color);
draw_shape('box', 15, 'from', top_11, 'to', top_01, 'color', color);
draw_shape('box', 15, 'from', top_01, 'to', top_00, 'color', color);
draw_shape('box', 15, 'from', top_00, 'to', top_11, 'color', color);
draw_shape('box', 15, 'from', top_01, 'to', top_10, 'color', color);
draw_shape('line', 15, 'from', top_00, 'to', top_10, 'color', color, 'width', 3);
draw_shape('line', 15, 'from', top_10, 'to', top_11, 'color', color, 'width', 3);
draw_shape('line', 15, 'from', top_11, 'to', top_01, 'color', color, 'width', 3);
draw_shape('line', 15, 'from', top_01, 'to', top_00, 'color', color, 'width', 3);
draw_shape('line', 15, 'from', top_00, 'to', top_11, 'color', color, 'width', 3);
draw_shape('line', 15, 'from', top_01, 'to', top_10, 'color', color, 'width', 3);
//part = 'dust 0.2 0.8 0.2 2';
//density = 2+player_distance/2;