添加幻翼提醒;在重装后会自动重载
This commit is contained in:
parent
05853884de
commit
667822c436
19
data/fzsd/advancements/game_event/on_sleeping.json
Normal file
19
data/fzsd/advancements/game_event/on_sleeping.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"parent": "fzsd:game_event",
|
||||||
|
"criteria": {
|
||||||
|
"on_sleeping": {
|
||||||
|
"trigger": "minecraft:slept_in_bed",
|
||||||
|
"conditions": {
|
||||||
|
"player": [
|
||||||
|
{
|
||||||
|
"condition": "minecraft:reference",
|
||||||
|
"name": "fzsd:is_real_player"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rewards": {
|
||||||
|
"function": "fzsd:game_event/advancement/on_sleeping"
|
||||||
|
}
|
||||||
|
}
|
2
data/fzsd/functions/api/get_current_daytime.mcfunction
Normal file
2
data/fzsd/functions/api/get_current_daytime.mcfunction
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# 游戏时间范围:0-2147483647
|
||||||
|
execute store result score fzsd.var.cache fzsd.variable.integer run time query daytime
|
2
data/fzsd/functions/api/get_current_gametime.mcfunction
Normal file
2
data/fzsd/functions/api/get_current_gametime.mcfunction
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# 游戏时间范围:0-2147483647
|
||||||
|
execute store result score fzsd.var.cache fzsd.variable.integer run time query gametime
|
1
data/fzsd/functions/api/get_time_since_rest.mcfunction
Normal file
1
data/fzsd/functions/api/get_time_since_rest.mcfunction
Normal file
@ -0,0 +1 @@
|
|||||||
|
scoreboard players operation fzsd.var.cache fzsd.variable.integer = @s fzsd.api.time_since_rest
|
5
data/fzsd/functions/api/install.mcfunction
Normal file
5
data/fzsd/functions/api/install.mcfunction
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
## 距上次睡觉时间
|
||||||
|
scoreboard objectives add fzsd.api.time_since_rest minecraft.custom:time_since_rest
|
||||||
|
|
||||||
|
## 调试
|
||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "已安装系统组件:API"}]
|
5
data/fzsd/functions/api/uninstall.mcfunction
Normal file
5
data/fzsd/functions/api/uninstall.mcfunction
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
## 距上次睡觉时间
|
||||||
|
scoreboard objectives remove fzsd.api.time_since_rest
|
||||||
|
|
||||||
|
## 调试
|
||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "已卸载系统组件:API"}]
|
@ -1,5 +1,5 @@
|
|||||||
execute store success storage fzsd:version fzsd.need_update int 1 run data merge storage fzsd:version {fzsd: {version: '3.1.0.rc.1'}}
|
execute store success storage fzsd:version fzsd.need_update byte 1 run data merge storage fzsd:version {fzsd: {version: '3.1.1.rc.1'}}
|
||||||
execute if data storage fzsd:version fzsd{need_update: 1} run function fzsd:system/update
|
execute if data storage fzsd:version fzsd{need_update: 1b} run function fzsd:system/update
|
||||||
function fzsd:system/carpet/try_load_fzsd_score
|
function fzsd:system/carpet/try_load_fzsd_score
|
||||||
function #fzsd:load
|
function #fzsd:load
|
||||||
execute if score fzsd.logger.level fzsd.variable.integer matches ..500 run tellraw @a [{"nbt": "fzsd.level.info", "interpret": true, "storage": "fzsd:logger"}, {"text": "FZ Survival Data Pack,当前版本:", "color": "gold"}, {"nbt":"fzsd.version", "storage": "fzsd:version", "color": "red"}]
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..500 run tellraw @a [{"nbt": "fzsd.level.info", "interpret": true, "storage": "fzsd:logger"}, {"text": "FZ Survival Data Pack,当前版本:", "color": "gold"}, {"nbt":"fzsd.version", "storage": "fzsd:version", "color": "red"}]
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
# 调用者:advancements/fzsd:~
|
# 调用者:advancements/fzsd:~
|
||||||
|
|
||||||
|
## 调试
|
||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "事件已触发:玩家"}, {"selector": "@s"}, {"text": "放置了流体"}]
|
||||||
|
|
||||||
function #fzsd:game_event/player/on_placed_liquid
|
function #fzsd:game_event/player/on_placed_liquid
|
||||||
|
|
||||||
## 重置事件进度
|
## 重置事件进度
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
# 调用者:advancements/fzsd:~
|
# 调用者:advancements/fzsd:~
|
||||||
|
|
||||||
|
## 调试
|
||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "事件已触发:玩家"}, {"selector": "@s"}, {"text": "放置了方块"}]
|
||||||
|
|
||||||
function #fzsd:game_event/player/on_placed_solid
|
function #fzsd:game_event/player/on_placed_solid
|
||||||
|
|
||||||
## 重置事件进度
|
## 重置事件进度
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
# 调用者:advancements/fzsd:~
|
||||||
|
|
||||||
|
## 调试
|
||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "事件已触发:玩家"}, {"selector": "@s"}, {"text": "正在睡觉"}]
|
||||||
|
|
||||||
|
## 运行事件
|
||||||
|
function #fzsd:game_event/player/on_sleeping
|
||||||
|
|
||||||
|
## 重置事件进度
|
||||||
|
advancement revoke @s from fzsd:game_event/on_sleeping
|
@ -1,2 +0,0 @@
|
|||||||
## 调试
|
|
||||||
execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "事件已触发:玩家"}, {"selector": "@s"}, {"text": "放置了流体"}]
|
|
@ -1,2 +0,0 @@
|
|||||||
## 调试
|
|
||||||
execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "事件已触发:玩家"}, {"selector": "@s"}, {"text": "放置了方块"}]
|
|
7
data/fzsd/functions/game_event/game/on_night.mcfunction
Normal file
7
data/fzsd/functions/game_event/game/on_night.mcfunction
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# 调用者:fzsd:game_event/game/on_night/on_tick
|
||||||
|
|
||||||
|
## 调试
|
||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "事件已触发:夜幕降临"}]
|
||||||
|
|
||||||
|
## 运行事件
|
||||||
|
function #fzsd:game_event/game/on_night
|
@ -0,0 +1,3 @@
|
|||||||
|
# 由fzsd:game_event/on_tick事件调用
|
||||||
|
function #fzsd:api/get_current_daytime
|
||||||
|
execute if score fzsd.var.cache fzsd.variable.integer matches 12516 run function fzsd:game_event/game/on_night
|
@ -1,4 +1,4 @@
|
|||||||
# 调用者:fzsd:game_event/player/on_used_tool
|
# 调用者:fzsd:game_event/player/on_broke_block_with_tool/try_trigger
|
||||||
|
|
||||||
## 调试
|
## 调试
|
||||||
execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "事件已触发:玩家"}, {"selector": "@s"}, {"text": "挖掘了方块"}]
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "事件已触发:玩家"}, {"selector": "@s"}, {"text": "挖掘了方块"}]
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
|
# 调用者:#fzsd:game_event/player/on_used_tool
|
||||||
|
|
||||||
## 判断分数
|
## 判断分数
|
||||||
execute unless score fzsd.var.score fzsd.variable.integer matches ..0 run function fzsd:game_event/player/on_broke_block_with_tool
|
execute unless score fzsd.var.score fzsd.variable.integer matches ..0 run function fzsd:game_event/player/on_broke_block_with_tool
|
@ -1,5 +1,5 @@
|
|||||||
## 详细
|
## 调试
|
||||||
execute if score fzsd.logger.level fzsd.variable.integer matches ..300 run tellraw @a [{"nbt": "fzsd.level.fine", "interpret": true, "storage": "fzsd:logger"}, {"text": "事件已触发:玩家"}, {"selector": "@s"}, {"text": "使用了工具"}]
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.fine", "interpret": true, "storage": "fzsd:logger"}, {"text": "事件已触发:玩家"}, {"selector": "@s"}, {"text": "使用了工具"}]
|
||||||
|
|
||||||
## 运行事件
|
## 运行事件
|
||||||
function #fzsd:game_event/player/on_used_tool
|
function #fzsd:game_event/player/on_used_tool
|
@ -31,5 +31,5 @@ scoreboard players set @s fzsd.event.used_tool.wooden_pickaxe 0
|
|||||||
scoreboard players set @s fzsd.event.used_tool.wooden_shovel 0
|
scoreboard players set @s fzsd.event.used_tool.wooden_shovel 0
|
||||||
scoreboard players set @s fzsd.event.used_tool.wooden_sword 0
|
scoreboard players set @s fzsd.event.used_tool.wooden_sword 0
|
||||||
|
|
||||||
## 调试
|
## 详细
|
||||||
execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "重置了玩家"}, {"selector": "@s"}, {"text": "的used_tool计分板"}]
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..300 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "重置了玩家"}, {"selector": "@s"}, {"text": "的used_tool计分板"}]
|
@ -0,0 +1,3 @@
|
|||||||
|
# TODO: 数字有待商榷
|
||||||
|
function #fzsd:api/get_time_since_rest
|
||||||
|
execute if score fzsd.var.cache fzsd.variable.integer matches 61766.. run function #fzsd:module/phantom_warning/send_phantom_warning
|
@ -0,0 +1 @@
|
|||||||
|
execute if data storage fzsd:install fzsd.module{phantom_warning:1b} as @a[predicate=fzsd:is_real_player] run function #fzsd:module/phantom_warning/check_time_since_rest
|
@ -0,0 +1,5 @@
|
|||||||
|
## 标记为已安装
|
||||||
|
data modify storage fzsd:install fzsd.module.phantom_warning set value 1b
|
||||||
|
|
||||||
|
## 日志
|
||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..500 run tellraw @a [{"nbt": "fzsd.level.info", "interpret": true, "storage": "fzsd:logger"}, {"text": "已安装组件:幻翼预警"}]
|
@ -0,0 +1,5 @@
|
|||||||
|
## 对当前玩家发送提醒
|
||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @s [{"nbt": "fzsd.level.alert", "interpret": true, "storage": "fzsd:logger"}, {"text": "今晚可能会生成幻翼,建议睡觉!"}]
|
||||||
|
|
||||||
|
## 调试
|
||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "事件已触发:已向玩家"}, {"selector": "@s"}, {"text": "发送幻翼预警"}]
|
@ -0,0 +1 @@
|
|||||||
|
execute unless data storage fzsd:install fzsd.module{phantom_warning:0b} run function #fzsd:module/phantom_warning/install
|
@ -0,0 +1,5 @@
|
|||||||
|
## 标记为已卸载
|
||||||
|
data modify storage fzsd:install fzsd.module.phantom_warning set value 0b
|
||||||
|
|
||||||
|
## 日志
|
||||||
|
execute if score fzsd.logger.level fzsd.variable.integer matches ..500 run tellraw @a [{"nbt": "fzsd.level.info", "interpret": true, "storage": "fzsd:logger"}, {"text": "已卸载组件:幻翼预警"}]
|
@ -2,4 +2,5 @@
|
|||||||
scoreboard players set -1 fzsd.variable.integer -1
|
scoreboard players set -1 fzsd.variable.integer -1
|
||||||
scoreboard players set 10 fzsd.variable.integer 10
|
scoreboard players set 10 fzsd.variable.integer 10
|
||||||
scoreboard players set 200 fzsd.variable.integer 200
|
scoreboard players set 200 fzsd.variable.integer 200
|
||||||
|
scoreboard players set 24000 fzsd.variable.integer 24000
|
||||||
scoreboard players set 72000 fzsd.variable.integer 72000
|
scoreboard players set 72000 fzsd.variable.integer 72000
|
6
data/fzsd/tags/functions/api/get_current_daytime.json
Normal file
6
data/fzsd/tags/functions/api/get_current_daytime.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:api/get_current_daytime"
|
||||||
|
]
|
||||||
|
}
|
6
data/fzsd/tags/functions/api/get_current_gametime.json
Normal file
6
data/fzsd/tags/functions/api/get_current_gametime.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:api/get_current_gametime"
|
||||||
|
]
|
||||||
|
}
|
6
data/fzsd/tags/functions/api/get_time_since_rest.json
Normal file
6
data/fzsd/tags/functions/api/get_time_since_rest.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:api/get_time_since_rest"
|
||||||
|
]
|
||||||
|
}
|
6
data/fzsd/tags/functions/api/install.json
Normal file
6
data/fzsd/tags/functions/api/install.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:api/install"
|
||||||
|
]
|
||||||
|
}
|
6
data/fzsd/tags/functions/api/uninstall.json
Normal file
6
data/fzsd/tags/functions/api/uninstall.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:api/uninstall"
|
||||||
|
]
|
||||||
|
}
|
@ -2,7 +2,8 @@
|
|||||||
"__comment": "本标签将强制重装所有模块",
|
"__comment": "本标签将强制重装所有模块",
|
||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
"#fzsd:uninstall",
|
"#fzsd:deep_uninstall",
|
||||||
"#fzsd:deep_install"
|
"#fzsd:deep_install",
|
||||||
|
"#fzsd:load"
|
||||||
]
|
]
|
||||||
}
|
}
|
6
data/fzsd/tags/functions/game_event/game/on_night.json
Normal file
6
data/fzsd/tags/functions/game_event/game/on_night.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"#fzsd:module/phantom_warning/event/on_night"
|
||||||
|
]
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
|
"fzsd:game_event/game/on_night/on_tick"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
"fzsd:game_event/callback/on_placed_liquid"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
"fzsd:game_event/callback/on_placed_solid",
|
|
||||||
"#fzsd:module/scoreboard/assign/scoreboard/placement_count"
|
"#fzsd:module/scoreboard/assign/scoreboard/placement_count"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:module/phantom_warning/check_time_since_rest"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:module/phantom_warning/event/on_night"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:module/phantom_warning/install"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:module/phantom_warning/send_phantom_warning"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"fzsd:module/phantom_warning/uninstall"
|
||||||
|
]
|
||||||
|
}
|
@ -2,6 +2,7 @@
|
|||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
"#fzsd:uninstall",
|
"#fzsd:uninstall",
|
||||||
"#fzsd:install"
|
"#fzsd:install",
|
||||||
|
"#fzsd:load"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -1,13 +1,15 @@
|
|||||||
{
|
{
|
||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
"#fzsd:module/health/install",
|
"fzsd:module/health/install",
|
||||||
"#fzsd:module/here/install",
|
"fzsd:module/here/install",
|
||||||
"#fzsd:module/interactor/install",
|
"fzsd:module/interactor/install",
|
||||||
"#fzsd:module/last_death/install",
|
"fzsd:module/join_message/install",
|
||||||
"#fzsd:module/last_nether_portal/install",
|
"fzsd:module/last_death/install",
|
||||||
"#fzsd:module/last_spawn_point/install",
|
"fzsd:module/last_nether_portal/install",
|
||||||
"#fzsd:module/scoreboard/install",
|
"fzsd:module/last_spawn_point/install",
|
||||||
"#fzsd:module/sweeper/install"
|
"fzsd:module/phantom_warning/install",
|
||||||
|
"fzsd:module/scoreboard/install",
|
||||||
|
"fzsd:module/sweeper/install"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -8,6 +8,7 @@
|
|||||||
"fzsd:module/last_death/try_install",
|
"fzsd:module/last_death/try_install",
|
||||||
"fzsd:module/last_nether_portal/try_install",
|
"fzsd:module/last_nether_portal/try_install",
|
||||||
"fzsd:module/last_spawn_point/try_install",
|
"fzsd:module/last_spawn_point/try_install",
|
||||||
|
"fzsd:module/phantom_warning/try_install",
|
||||||
"fzsd:module/scoreboard/try_install",
|
"fzsd:module/scoreboard/try_install",
|
||||||
"fzsd:module/sweeper/try_install"
|
"fzsd:module/sweeper/try_install"
|
||||||
]
|
]
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
"values": [
|
"values": [
|
||||||
"fzsd:system/install/install",
|
"fzsd:system/install/install",
|
||||||
"#fzsd:logger/install",
|
"#fzsd:logger/install",
|
||||||
|
"#fzsd:api/install",
|
||||||
"#fzsd:game_event/install"
|
"#fzsd:game_event/install"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
|
"#fzsd:api/uninstall",
|
||||||
"#fzsd:game_event/uninstall",
|
"#fzsd:game_event/uninstall",
|
||||||
"#fzsd:logger/uninstall",
|
"#fzsd:logger/uninstall",
|
||||||
"fzsd:system/uninstall/uninstall"
|
"fzsd:system/uninstall/uninstall"
|
||||||
|
Loading…
Reference in New Issue
Block a user