From 3f66bb499f96e2fa7945960cdeee8eefea4f3507 Mon Sep 17 00:00:00 2001 From: Harveykang <1214946206@qq.com> Date: Mon, 28 Dec 2020 18:09:49 +0800 Subject: [PATCH] 2.0.0.11 --- README.md | 2 ++ data/fz/functions/install.mcfunction | 4 ++-- data/fz/functions/load.mcfunction | 4 ++-- tagplayer.sc | 26 +++++++++++++++++++++----- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 07fe88f..355dd4e 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,8 @@ A Minecraft Datapack - 记得用完就删掉它! - 计划 - 添加单独的记分板升级工具 +##### v2.0.0.11 +- “/tagplayer spawn xxx”后面现在可以追加“at”、“facing”、“in”参数 ##### v2.0.0.10 - 扫地机添加了位于怪物血条栏的文字提示,同时添加了各种提示的开关功能 ##### v2.0.0.9 diff --git a/data/fz/functions/install.mcfunction b/data/fz/functions/install.mcfunction index f4665e1..103959b 100644 --- a/data/fz/functions/install.mcfunction +++ b/data/fz/functions/install.mcfunction @@ -16,9 +16,9 @@ function fz:login/logintips/install function fz:carpet/carpet #版本信息 data merge storage fz.installed {installed:1b} -data merge storage fz {version:Beta-2.0.0.10} +data merge storage fz {version:Beta-2.0.0.11} data merge storage fz {date:2020-12.28} -data merge storage fz {time:"17:16"} +data merge storage fz {time:"18:01"} data merge storage fz {snapshot:-SNAPSHOT} ##data remove storage fz snapshot tellraw @a {"text": "[信息]启动完毕","color": "#5fff00"} diff --git a/data/fz/functions/load.mcfunction b/data/fz/functions/load.mcfunction index eb3c7f7..a538a00 100644 --- a/data/fz/functions/load.mcfunction +++ b/data/fz/functions/load.mcfunction @@ -1,8 +1,8 @@ #如果未安装且未卸载则安装 execute unless data storage fz.installed {installed:1b} unless data storage fz.installed {installed:0b} run function fz:install #如果版本正确且已安装则开始运行 -execute if data storage fz {version:Beta-2.0.0.10} if data storage fz.installed {installed:1b} run function fz:start +execute if data storage fz {version:Beta-2.0.0.11} if data storage fz.installed {installed:1b} run function fz:start #如果版本不符则更新 -execute unless data storage fz {version:Beta-2.0.0.10} run function fz:update +execute unless data storage fz {version:Beta-2.0.0.11} run function fz:update #输出版本信息 tellraw @a [{"text": "[版本信息]FZ's Datapack-","color": "#ffd900"},{"nbt":"version","storage":"fz","color": "#ffd900"},{"nbt": "snapshot", "storage": "fz","color": "red"}] \ No newline at end of file diff --git a/tagplayer.sc b/tagplayer.sc index 296c655..b5e5784 100644 --- a/tagplayer.sc +++ b/tagplayer.sc @@ -6,7 +6,7 @@ team_add('carpetBot'); team_add('shadowedPlayer'); team_property('carpetBot', 'prefix', '假的'); team_property('shadowedPlayer', 'prefix', '挂机'); -global_version = '2.1.0'; +global_version = '2.1.1'; global_carpet_version = split('\\+v',system_info('scarpet_version')); global_filename = system_info('app_name'); __config() -> { @@ -14,7 +14,10 @@ __config() -> { 'allow_command_conflicts' -> true, 'commands' -> { '' -> 'help', - 'spawn ' -> 'summon', + 'spawn ' -> ['summon',null,null,null], + 'spawn at ' -> ['summon',null,null], + 'spawn at facing ' -> ['summon',null], + 'spawn at facing in ' -> 'summon', 'kill ' -> 'kill', 'killall' -> 'killall', 'attack ' -> 'attack_once', @@ -81,6 +84,10 @@ __config() -> { 'shadow' -> 'shadow', }, 'arguments' -> { + 'dimension' -> { + 'type' -> 'text', + 'suggest' -> ['overworld','the_nether','the_end'] + }, 'hotbar' -> { 'type' -> 'int', 'min' -> 1, @@ -245,13 +252,22 @@ reload() ->( run('tellraw @a {"text":"+ global_filename +重载成功!"}'); return() ); -summon(player_name) ->( +summon(player_name, position, rotation, dimension) ->( player_name = slice(player_name,0,15); check_online(player_name); s_player = player(); + if(position == null, + position = query(s_player, 'pos') + ); + if(rotation == null, + rotation = l(query(s_player, 'yaw'), query(s_player, 'pitch')) + ); + if(dimension == null, + dimension = query(s_player, 'dimension') + ); run( - str('player %s spawn at %f %f %f facing %f %f', - player_name, s_player~'x', s_player~'y', s_player~'z', query(s_player, 'yaw'), query(s_player, 'pitch') + str('player %s spawn at %f %f %f facing %f %f in %s', + player_name, position:0, position:1, position:2, rotation:0, rotation:1, dimension ) ); f_player = player(player_name);