Skip to content

Commit

Permalink
重构商店系统&&适配1.21.6
Browse files Browse the repository at this point in the history
  • Loading branch information
NIANIANKNIA committed Feb 12, 2025
1 parent 87960d6 commit d155fba
Show file tree
Hide file tree
Showing 6 changed files with 420 additions and 211 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
## 写在前面

> [!WARNING]
> 当前服务器addons包仍处于开发状态,暂时没有对其他类型服务器做适配,所以我们并不推荐您直接使用!
> 当前服务器addons包仍处于开发状态,暂时没有对其他类型服务器做适配,所以我们并不推荐您直接使用
> **我们将在v2.0.0正式版提供可以适配其他服务器的addons包,敬请期待!**
> [!TIP]
>为了实现更多功能,服务器使用了@minecraft/server-net模块,所以本插件包不能在个人存档中正常运行,只能在BDS上运行!
Expand Down
8 changes: 4 additions & 4 deletions development_behavior_packs/NiaServer-Core-BP/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"name": "NiaServer-Core-1.5.0 BP",
"description": "§bCopyright (C) 2025 Nia-Server\n版本:v1.0.0\n项目地址:https://github.com/Nia-Server/NiaServer-Core",
"uuid": "cab0bbe3-eb10-465e-b1de-b09facc076c8",
"version": [ 1, 5, 0 ],
"min_engine_version": [ 1, 21, 50 ]
"version": [ 1, 5, 1 ],
"min_engine_version": [ 1, 21, 60 ]
},
"modules": [
{
Expand All @@ -14,13 +14,13 @@
"description": "gametest module",
"uuid": "92cd3fe1-e764-425a-aa40-a7e4d7760922",
"entry": "scripts/main.js",
"version": [ 1, 5, 0 ]
"version": [ 1, 5, 1 ]
}
],
"dependencies": [
{
"module_name": "@minecraft/server",
"version": "1.17.0-beta"
"version": "1.18.0-beta"
},
{
"module_name": "@minecraft/server-ui",
Expand Down
44 changes: 20 additions & 24 deletions development_behavior_packs/NiaServer-Core-BP/scripts/basic/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,26 @@ world.afterEvents.worldInitialize.subscribe((event) => {


system.runInterval(() => {
let TIME = new Date();
if (TIME.getSeconds() == 0) {
//增加在线时间
RunCmd(`scoreboard players add @a time 1`);
}
if (TIME.getMinutes() == 0 && TIME.getSeconds() == 0 ) {
let RN = parseInt(getNumberInNormalDistribution(100,20))
//防止物价指数出现极端数值
if (RN <= 20 || RN >= 180) {
RN = 100
}
RunCmd(`scoreboard players set RN DATA ${RN}`);
RunCmd(`title @a title §c物价指数发生变动!`)
RunCmd(`title @a subtitle §7物价指数由 §l§e${GetScore("DATA","RN") / 100} §r§7变为 §l§e${RN / 100}`)
//自动备份
if (TIME.getHours() == 16) {
let ScoreBoards = world.scoreboard.getObjectives()
for (let i = 0; i < ScoreBoards.length; i++) {
if (ScoreBoards[i].id.slice(0,2) == "R:") {
RunCmd(`scoreboard objectives remove "${ScoreBoards[i].id}"`)
}
}
Broadcast(`§a 服务器时间已更新!`)
}
}
},40)
// if (TIME.getMinutes() == 0 && TIME.getSeconds() == 0 ) {
// let RN = parseInt(getNumberInNormalDistribution(100,20))
// //防止物价指数出现极端数值
// if (RN <= 20 || RN >= 180) {
// RN = 100
// }
// RunCmd(`scoreboard players set RN DATA ${RN}`);
// RunCmd(`title @a title §c物价指数发生变动!`)
// RunCmd(`title @a subtitle §7物价指数由 §l§e${GetScore("DATA","RN") / 100} §r§7变为 §l§e${RN / 100}`)
// if (TIME.getHours() == 16) {
// let ScoreBoards = world.scoreboard.getObjectives()
// for (let i = 0; i < ScoreBoards.length; i++) {
// if (ScoreBoards[i].id.slice(0,2) == "R:") {
// RunCmd(`scoreboard objectives remove "${ScoreBoards[i].id}"`)
// }
// }
// Broadcast(`§a 服务器时间已更新!`)
// }
// }
},1200)

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const GUI = {
}
const HomeMainForm = new ActionFormData()
.title("传送点设置")
.body("请选择你要传送的地点\n如果要添加传送点请前往设置页面进行添加")
.body("请选择你要传送的地点")
.button("返回上一级菜单","textures/ui/wysiwyg_reset")
.button("添加/删除传送点","textures/ui/paste")
for (let i = 0; i < player_pos_data.length; i++) {
Expand Down
Loading

0 comments on commit d155fba

Please sign in to comment.