Merge branch 'master' into 1.17
This commit is contained in:
commit
24e8c00998
40 files changed
+409
-124
No files matched your search
@@ -49,7 +49,7 @@ villager_buddy_detection() -> __toggle('villager_buddy_detection', null);
|
||||
item_pickup() -> __toggle('item_pickup', null);
|
||||
portal_cooldown() -> __toggle('portal_cooldown', null);
|
||||
health() -> __toggle('health', null);
|
||||
|
||||
//xpstack() -> __toggle('xpstack', null); //1.17 feature
|
||||
|
||||
toggle_boxes() ->
|
||||
(
|
||||
@@ -365,6 +365,17 @@ global_functions = {
|
||||
null
|
||||
]
|
||||
},
|
||||
|
||||
'xpstack' -> {
|
||||
'experience_orb' -> [
|
||||
_(arg) -> _(orb) -> (
|
||||
ct = query(orb, 'nbt', 'Count');
|
||||
[[], [], if (ct > 1, [['stack', 'stack:', ct]],[]) ]
|
||||
),
|
||||
,
|
||||
null
|
||||
]
|
||||
},
|
||||
};
|
||||
|
||||
global_villager_food = {
|
||||
@@ -505,13 +516,18 @@ __tick_tracker() ->
|
||||
p = player();
|
||||
[px, py, pz] = pos(p);
|
||||
in_dimension(p,
|
||||
for (entity_area('living', px, py, pz, global_range, global_range, global_range),
|
||||
for (entity_area('valid', px, py, pz, global_range, global_range, global_range),
|
||||
__handle_entity(_)
|
||||
)
|
||||
);
|
||||
schedule(global_interval, '__tick_tracker');
|
||||
);
|
||||
|
||||
global_entity_anchors = {
|
||||
'experience_orb' -> 'xyz',
|
||||
'player' -> 'xyz'
|
||||
};
|
||||
|
||||
__handle_entity(e) ->
|
||||
(
|
||||
entity_type = e ~ 'type';
|
||||
@@ -531,7 +547,8 @@ __handle_entity(e) ->
|
||||
|
||||
if (labels_to_add,
|
||||
base_height = 0;
|
||||
[snap, base_pos] = if(e~'type'=='player', ['xyz', [0, e~'height', 0]], ['dxydz', [0.5, e~'height'+0.4, 0.5]]);
|
||||
snap = global_entity_anchors:(e~'type') || 'dxydz';
|
||||
base_pos = if(snap == 'xyz', [0, e~'height'+0.3, 0], [0.5, e~'height'+0.3, 0.5]);
|
||||
for (labels_to_add,
|
||||
if (length(_) == 2,
|
||||
[label, text] = _;
|
||||
|
||||
@@ -27,35 +27,76 @@ global_renderers = m(
|
||||
}
|
||||
);
|
||||
|
||||
__command() -> '';
|
||||
global_shapes = {'sphere' -> [], 'box' -> []};
|
||||
|
||||
monument() -> __toggle('monument', 'structures');
|
||||
fortress() -> __toggle('fortress', 'structures');
|
||||
mansion() -> __toggle('mansion', 'structures');
|
||||
jungle_pyramid() -> __toggle('jungle_pyramid', 'structures');
|
||||
desert_pyramid() -> __toggle('desert_pyramid', 'structures');
|
||||
endcity() -> __toggle('endcity', 'structures');
|
||||
igloo() -> __toggle('igloo', 'structures');
|
||||
shipwreck() -> __toggle('shipwreck', 'structures');
|
||||
swamp_hut() -> __toggle('swamp_hut', 'structures');
|
||||
stronghold() -> __toggle('stronghold', 'structures');
|
||||
ocean_ruin() -> __toggle('ocean_ruin', 'structures');
|
||||
buried_treasure() -> __toggle('buried_treasure', 'structures');
|
||||
pillager_outpost() -> __toggle('pillager_outpost', 'structures');
|
||||
mineshaft() -> __toggle('mineshaft', 'structures');
|
||||
village() -> __toggle('village', 'structures');
|
||||
nether_fossil() -> __toggle('nether_fossil', 'structures');
|
||||
bastion_remnant() -> __toggle('bastion_remnant', 'structures');
|
||||
ruined_portal() -> __toggle('ruined_portal', 'structures');
|
||||
|
||||
slime_chunks() -> __toggle('slime_chunks', 'chunks');
|
||||
|
||||
portal_coordinates() -> __toggle('coords', 'portals');
|
||||
portal_links() -> __toggle('links', 'portals');
|
||||
__config() ->
|
||||
{
|
||||
'commands' -> {
|
||||
'structure <structure>' -> _(s) -> __toggle(s, 'structures'),
|
||||
'slime_chunks' -> ['__toggle', 'slime_chunks', 'chunks'],
|
||||
'portal coordinates' -> ['__toggle', 'coords', 'portals'],
|
||||
'portal links' -> ['__toggle', 'links', 'portals'],
|
||||
'<shape> <radius> following <player>' -> ['display_shape', [null,0xffffffff], true],
|
||||
'<shape> <radius> at <player>' -> ['display_shape', [null,0xffffffff], false],
|
||||
'<shape> <radius> following <player> <color>' -> ['display_shape', true],
|
||||
'<shape> <radius> at <player> <color>' -> ['display_shape', false],
|
||||
'<shape> clear' -> 'clear_shape',
|
||||
'clear' -> 'clear',
|
||||
},
|
||||
'arguments' -> {
|
||||
'structure' -> {'type' -> 'term', 'suggest' -> [
|
||||
'monument', 'fortress', 'mansion', 'jungle_pyramid',
|
||||
'desert_pyramid', 'endcity', 'igloo', 'shipwreck',
|
||||
'swamp_hut', 'stronghold', 'ocean_ruin', 'buried_treasure',
|
||||
'pillager_outpost', 'mineshaft', 'village', 'nether_fossil',
|
||||
'bastion_remnant', 'ruined_portal'
|
||||
]},
|
||||
'player' -> {'type' -> 'players', 'single' -> true},
|
||||
'radius' -> {'type' -> 'int', 'min' -> 0, 'max' -> 1024, 'suggest' -> [128, 24, 32]},
|
||||
'shape' -> {'type' -> 'term', 'options' -> keys(global_shapes) },
|
||||
'color' -> {'type' -> 'teamcolor'}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
display_shape(shape, r, player, color, following) ->
|
||||
(
|
||||
|
||||
clear() -> for(global_renderers, global_renderers:_:'tasks' = m() );
|
||||
player = player(player);
|
||||
if (!player, return());
|
||||
if (shape == 'sphere',
|
||||
shape_config = {
|
||||
'center' -> if(following, [0,0,0], pos(player)),
|
||||
'radius' -> r
|
||||
}
|
||||
, shape == 'box',
|
||||
shape_config = {
|
||||
'from' -> if(following, [-r,-r,-r], pos(player)-r),
|
||||
'to' -> if(following, [r,r,r], pos(player)+r)
|
||||
}
|
||||
);
|
||||
if (shape_config,
|
||||
if (following, shape_config:'follow' = player);
|
||||
shape_config:'fill' = color:1 - 200;
|
||||
shape_config:'color' = color:1;
|
||||
shape_config:'line' = 5;
|
||||
draw_shape(shape, 72000, shape_config);
|
||||
global_shapes:shape += shape_config;
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
clear_shape(shape) ->
|
||||
(
|
||||
for(global_shapes:shape, draw_shape(shape, 0, _));
|
||||
global_shapes:shape = [];
|
||||
);
|
||||
|
||||
clear() ->
|
||||
(
|
||||
for(global_renderers, global_renderers:_:'tasks' = m() );
|
||||
for(global_shapes, clear_shape(_));
|
||||
);
|
||||
|
||||
__toggle(feature, renderer) ->
|
||||
(
|
||||
@@ -63,11 +104,11 @@ __toggle(feature, renderer) ->
|
||||
config = global_renderers:renderer;
|
||||
if( has(config:'tasks':feature),
|
||||
delete(config:'tasks':feature);
|
||||
'disabled '+feature+' overlays';
|
||||
print(p, format('gi disabled '+feature+' overlays'));
|
||||
,
|
||||
config:'tasks' += feature;
|
||||
if (!config:'active', call(config:'handler', p~'name'));
|
||||
'enabled '+feature+' overlays';
|
||||
print(p, format('gi enabled '+feature+' overlays'));
|
||||
)
|
||||
);
|
||||
|
||||
@@ -81,6 +122,9 @@ __should_run(renderer, player_name) ->
|
||||
l(p, config);
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
__structure_renderer(player_name) ->
|
||||
(
|
||||
l(p, config) = __should_run('structures', player_name);
|
||||
|
||||
Reference in new issue
Block a user