diff --git a/README.txt b/README.txt index 6c54dc3..bde584d 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,11 @@ 记分板:/trigger scoreswitch set -1关;1循环播放;2-7订阅单独的记分板 扫地姬:/trigger cleaner set -1关;>=30开 +v1.3.1 +-增加活跃度排行(小时)记分板 + v1.3.0 +-支持1.15 -大修记分板,增加了总分数计算和显示 -*不兼容*1.2.x的记分板 -添加部分代码的注释 @@ -39,6 +43,7 @@ v1.1 -增加扫地姬,以及扫地姬开关 v1.0 +-支持1.14.x -增加玩家睡觉提醒 -增加玩家tab栏和头顶的血量显示 -增加记分版:挖掘量、造成伤害量、死亡次数、钓鱼次数、交易次数,以及记分版开关 \ No newline at end of file diff --git a/data/fz/functions/install.mcfunction b/data/fz/functions/install.mcfunction index 8a8471b..7552454 100644 --- a/data/fz/functions/install.mcfunction +++ b/data/fz/functions/install.mcfunction @@ -6,4 +6,4 @@ function fz:health/install function fz:sleep/install function fz:cleaner/install function fz:logintips/install -tellraw @a [{"text":"[Datapack]"},{"text":" FZ'sDataPack v1.3.0 installed successfully","color":"gold"}] \ No newline at end of file +tellraw @a [{"text":"[Datapack]"},{"text":" FZ'sDataPack v1.3.1 installed successfully","color":"gold"}] \ No newline at end of file diff --git a/data/fz/functions/score/activation/install.mcfunction b/data/fz/functions/score/activation/install.mcfunction new file mode 100644 index 0000000..3dd990f --- /dev/null +++ b/data/fz/functions/score/activation/install.mcfunction @@ -0,0 +1,11 @@ +scoreboard objectives add actCounter dummy +scoreboard objectives add activation dummy [{"text":"活跃度排行","color":"aqua"},{"text":"(小时)","color":"gold"}] +team add activation +team modify activation color aqua +team join activation totalActivation +scoreboard objectives setdisplay sidebar.team.aqua activation +scoreboard objectives add tActC dummy +###实验性###在分项目下显示总量### +scoreboard objectives add totalActivation dummy +scoreboard players set totalActivation totalActivation 1 +#### \ No newline at end of file diff --git a/data/fz/functions/score/activation/main.mcfunction b/data/fz/functions/score/activation/main.mcfunction new file mode 100644 index 0000000..cd13df3 --- /dev/null +++ b/data/fz/functions/score/activation/main.mcfunction @@ -0,0 +1,2 @@ +scoreboard players add @a actCounter 1 +execute as @a if score @s actCounter matches 72000 run function fz:score/activation/sub \ No newline at end of file diff --git a/data/fz/functions/score/activation/sub.mcfunction b/data/fz/functions/score/activation/sub.mcfunction new file mode 100644 index 0000000..00a93c0 --- /dev/null +++ b/data/fz/functions/score/activation/sub.mcfunction @@ -0,0 +1,2 @@ +scoreboard players set @s actCounter 0 +scoreboard players add @s activation 1 \ No newline at end of file diff --git a/data/fz/functions/score/activation/team.mcfunction b/data/fz/functions/score/activation/team.mcfunction new file mode 100644 index 0000000..5b62c8b --- /dev/null +++ b/data/fz/functions/score/activation/team.mcfunction @@ -0,0 +1,3 @@ +tellraw @a[scores={scoreswitch=8},team=!activation] [{"text":"您已订阅"},{"text":"活跃度排行(小时)","color":"aqua"}] +team join activation @a[scores={scoreswitch=8},team=!activation] +scoreboard objectives setdisplay sidebar.team.aqua activation \ No newline at end of file diff --git a/data/fz/functions/score/activation/totalcalculator.mcfunction b/data/fz/functions/score/activation/totalcalculator.mcfunction new file mode 100644 index 0000000..3a548d0 --- /dev/null +++ b/data/fz/functions/score/activation/totalcalculator.mcfunction @@ -0,0 +1,6 @@ +#计算每个玩家本游戏刻挖掘量和上一游戏刻受伤害量的差 +scoreboard players operation @s tActC -= @s activation +#将两游戏刻玩家受伤害量的差之和加在总榜上 +scoreboard players operation totalActivation totalList -= @s tActC +#储存当前游戏刻的玩家受伤害量 +scoreboard players operation @s tActC = @s activation \ No newline at end of file diff --git a/data/fz/functions/score/activation/totalnodisplay.mcfunction b/data/fz/functions/score/activation/totalnodisplay.mcfunction new file mode 100644 index 0000000..2e691e1 --- /dev/null +++ b/data/fz/functions/score/activation/totalnodisplay.mcfunction @@ -0,0 +1,2 @@ +scoreboard players reset totalActivation activation +scoreboard players reset totalActivation totalActivation \ No newline at end of file diff --git a/data/fz/functions/score/activation/uninstall.mcfunction b/data/fz/functions/score/activation/uninstall.mcfunction new file mode 100644 index 0000000..feaf1a5 --- /dev/null +++ b/data/fz/functions/score/activation/uninstall.mcfunction @@ -0,0 +1,5 @@ +scoreboard objectives remove actCounter +scoreboard objectives remove activation +scoreboard objectives remove tActC +team remove activation +scoreboard objectives remove totalActivation \ No newline at end of file diff --git a/data/fz/functions/score/install.mcfunction b/data/fz/functions/score/install.mcfunction index d100f89..1629e72 100644 --- a/data/fz/functions/score/install.mcfunction +++ b/data/fz/functions/score/install.mcfunction @@ -1,3 +1,6 @@ +#安装活跃度排行# +function fz:score/activation/install +#### #安装记分项目# scoreboard objectives add digCounter dummy {"text":"挖掘榜","color":"gray"} scoreboard objectives add deathCounter deathCount {"text":"死亡榜","color":"dark_red"} diff --git a/data/fz/functions/score/main.mcfunction b/data/fz/functions/score/main.mcfunction index 9997031..2f86c66 100644 --- a/data/fz/functions/score/main.mcfunction +++ b/data/fz/functions/score/main.mcfunction @@ -1,3 +1,6 @@ +#活跃度模块# +function fz:score/activation/main +#### #记分板循环# scoreboard players add scoreboard timeCounter 1 execute if score scoreboard timeCounter matches 600 run scoreboard objectives setdisplay sidebar.team.gold killCounter @@ -6,8 +9,9 @@ execute if score scoreboard timeCounter matches 1800 run scoreboard objectives s execute if score scoreboard timeCounter matches 2400 run scoreboard objectives setdisplay sidebar.team.gold tradingCounter execute if score scoreboard timeCounter matches 3000 run scoreboard objectives setdisplay sidebar.team.gold fishingCounter execute if score scoreboard timeCounter matches 3600 run scoreboard objectives setdisplay sidebar.team.gold damageTaken -execute if score scoreboard timeCounter matches 4200 run scoreboard objectives setdisplay sidebar.team.light_purple totalList -execute if score scoreboard timeCounter matches 4200.. run scoreboard players set scoreboard timeCounter 0 +execute if score scoreboard timeCounter matches 4200 run scoreboard objectives setdisplay sidebar.team.gold activation +execute if score scoreboard timeCounter matches 4800 run scoreboard objectives setdisplay sidebar.team.gold totalList +execute if score scoreboard timeCounter matches 4800.. run scoreboard players set scoreboard timeCounter 0 #### #记分板开关# scoreboard players enable @a scoreswitch @@ -19,8 +23,9 @@ execute if entity @a[scores={scoreswitch=4},team=!deathCounter] run function fz: execute if entity @a[scores={scoreswitch=5},team=!tradingCounter] run function fz:score/teams/tradingcounter execute if entity @a[scores={scoreswitch=6},team=!fishingCounter] run function fz:score/teams/fishingcounter execute if entity @a[scores={scoreswitch=7},team=!damageTaken] run function fz:score/teams/damagetaken -execute if entity @a[scores={scoreswitch=8},team=!totalList] run function fz:score/teams/totallist -execute if entity @a[scores={scoreswitch=9..}] run tellraw @a[scores={scoreswitch=9..}] [{"text":"不存在编号为9及以上的记分板","color":"dark_red"}] +execute if entity @a[scores={scoreswitch=8},team=!activation] run function fz:score/activation/team +execute if entity @a[scores={scoreswitch=9},team=!totalList] run function fz:score/teams/totallist +execute if entity @a[scores={scoreswitch=10..}] run tellraw @a[scores={scoreswitch=10..}] [{"text":"不存在编号为10及以上的记分板","color":"dark_red"}] scoreboard players set @a[scores={scoreswitch=..-1}] scoreswitch 0 scoreboard players set @a[scores={scoreswitch=1..}] scoreswitch 0 team join displayScoresOff @a[team=] @@ -44,6 +49,7 @@ execute as @a unless score @s tDeathC matches -2147483648..2147483647 run scoreb execute as @a unless score @s tTradeC matches -2147483648..2147483647 run scoreboard players operation @s tTradeC = @s tTradeC execute as @a unless score @s tFishC matches -2147483648..2147483647 run scoreboard players operation @s tFishC = @s tFishC execute as @a unless score @s tHurtC matches -2147483648..2147483647 run scoreboard players operation @s tHurtC = @s tHurtC +execute as @a unless score @s tActC matches -2147483648..2147483647 run scoreboard players operation @s tActC = @s tActC #两板分数不等时运行计算函数 execute as @a unless score @s tDigC = @s digCounter run function fz:score/totalcalculator/tdigc execute as @a unless score @s tKillC = @s killCounter run function fz:score/totalcalculator/tkillc @@ -51,6 +57,7 @@ execute as @a unless score @s tDeathC = @s deathCounter run function fz:score/to execute as @a unless score @s tTradeC = @s tradingCounter run function fz:score/totalcalculator/ttradec execute as @a unless score @s tFishC = @s fishingCounter run function fz:score/totalcalculator/tfishc execute as @a unless score @s tHurtC = @s damageTaken run function fz:score/totalcalculator/thurtc +execute as @a unless score @s tActC = @s activation run function fz:score/activation/totalcalculator #总榜在分榜中显示开sc=1 execute if score totalDug totalDug matches 1.. run scoreboard players operation totalDug digCounter = totalDug totalList execute if score totalKilled totalKilled matches 1.. run scoreboard players operation totalKilled killCounter = totalKilled totalList @@ -58,6 +65,7 @@ execute if score totalDeath totalDeath matches 1.. run scoreboard players operat execute if score totalTraded totalTraded matches 1.. run scoreboard players operation totalTraded tradingCounter = totalTraded totalList execute if score totalFished totalFished matches 1.. run scoreboard players operation totalFished fishingCounter = totalFished totalList execute if score totalHurt totalHurt matches 1.. run scoreboard players operation totalHurt damageTaken = totalHurt totalList +execute if score totalActivation totalActivation matches 1.. run scoreboard players operation totalActivation activation = totalActivation totalList #总榜在分榜中显示关sc=0 #execute if score totalDug totalDug matches ..0 run function fz:score/totalnodisplay/digcounter #execute if score totalKilled totalKilled matches ..0 run function fz:score/totalnodisplay/killcounter @@ -65,4 +73,5 @@ execute if score totalHurt totalHurt matches 1.. run scoreboard players operatio #execute if score totalTraded totalTraded matches ..0 run function fz:score/totalnodisplay/tradingcounter #execute if score totalFished totalFished matches ..0 run function fz:score/totalnodisplay/fishingcounter #execute if score totalHurt totalHurt matches ..0 run function fz:score/totalnodisplay/damagetaken +#execute if score totalActivation totalActivation matches ..0 run function fz:score/activation/totalnodisplay #### \ No newline at end of file diff --git a/data/fz/functions/score/teams/totallist.mcfunction b/data/fz/functions/score/teams/totallist.mcfunction index 75422d2..dd132d6 100644 --- a/data/fz/functions/score/teams/totallist.mcfunction +++ b/data/fz/functions/score/teams/totallist.mcfunction @@ -1,3 +1,3 @@ -tellraw @a[scores={scoreswitch=8},team=!totalList] [{"text":"您已订阅"},{"text":"统计总量","color":"light_purple"}] -team join totalList @a[scores={scoreswitch=8},team=!totalList] +tellraw @a[scores={scoreswitch=9},team=!totalList] [{"text":"您已订阅"},{"text":"统计总量","color":"light_purple"}] +team join totalList @a[scores={scoreswitch=9},team=!totalList] scoreboard objectives setdisplay sidebar.team.light_purple totalList \ No newline at end of file