Skip to content

Commit

Permalink
更新1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zimuya4153 committed Jan 22, 2025
1 parent 7748479 commit b0945b9
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 733 deletions.
11 changes: 10 additions & 1 deletion Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/// <reference path="../GMLIB-LegacyRemoteCallApi/lib/BEPlaceholderAPI-JS.d.ts"/>
/// <reference path="../GMLIB-LegacyRemoteCallApi/lib/GMLIB_API-JS.d.ts"/>

const { I18nAPI, UserCache } = require("./GMLIB-LegacyRemoteCallApi/lib/GMLIB_API-JS.js");

module.exports = {
Config: {
/** 无论如何都会显示(方块和实体前面) @type {ConfigItem[]} */
Expand All @@ -23,7 +25,7 @@ module.exports = {
},
{// 是否可以采集
Conditions: (Player, Block) => !Player.isCreative && !Block.isUnbreakable,
Text: (Player, Block, Cache) => "\n" + tr("plugins.Waila.block.destroy", Player.langCode, (!(Player.isAdventure && !Cache["HandItem"].canDestroy(Block)) && (Block.isAlwaysDestroyable() || Cache["HandItem"].canDestroySpecial(Block))) ? "§a✔" : "§c✘")
Text: (Player, Block, Cache) => "\n" + tr("plugins.Waila.block.destroy", Player.langCode, (!(Player.isAdventure && !Cache["HandItem"].canDestroy(Block)) && Cache["HandItem"].canDestroySpecial(Block)) ? "§a✔" : "§c✘")
},
{// 蛋糕
Conditions: (_Player, Block) => Block.type === "minecraft:cake",
Expand Down Expand Up @@ -263,6 +265,13 @@ module.exports = {
/** 默认文本 @type {String} */
DefaultText: "",
/** 默认显示位置 @type {0 | 1 | 2 | 3 | 4} */
/**
* 0 - Boss栏
* 1 - 音符盒提示
* 2 - 物品栏上方
* 3 - 活动栏
* 4 - Sidebar 侧边栏
*/
DefaultMode: 0,
/** 刷新时间(秒) @type {Number} */
Hz: 0.1,
Expand Down
675 changes: 7 additions & 668 deletions LICENSE

Large diffs are not rendered by default.

File renamed without changes.
87 changes: 44 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@ Waila 是一个 LSE 高亮显示插件,他集成了许多原版信息的具体

<details>
<summary>展开</summary>
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_1.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_2.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_3.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_4.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_5.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_6.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_7.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_8.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_9.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_10.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_11.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_12.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_13.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_14.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_15.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_16.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_17.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_18.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_19.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_20.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_21.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_22.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_23.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_24.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_25.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_26.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_27.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_28.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_29.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_30.png?raw=true">
<img src="https://github.com/zimuya4153/LSE_Waila/blob/main/image/image_31.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_1.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_2.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_3.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_4.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_5.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_6.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_7.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_8.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_9.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_10.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_11.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_12.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_13.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_14.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_15.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_16.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_17.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_18.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_19.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_20.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_21.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_22.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_23.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_24.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_25.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_26.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_27.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_28.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_29.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_30.png?raw=true">
<img src="https://github.com/ZMBlocks/LSE_Waila/blob/main/image/image_31.png?raw=true">
</details>

## 如何正确加载 Waila
Expand All @@ -48,20 +48,20 @@ Waila 是一个 LSE 高亮显示插件,他集成了许多原版信息的具体

需要在 Bedrock Dedicated Server(BDS)服务端下装载前置:

- LeviLamina`>=0.12.x`
- legacy-script-engine-quickjs`≥0.7.9`
- GMLIB`≥0.12.8`
- GMLIB-LegacyRemoteCallApi`≥v0.12.8`
- LeviLamina`>=1.0.0-rc.1`
- legacy-script-engine-quickjs`≥0.9.0-rc.1`
- GMLIB`≥0.13.9`
- GMLIB-LegacyRemoteCallApi`≥v0.13.6`

### 如何装载

- 第一种:下载释放文件,解压插件文件夹至 BDS 服务端 plugins 文件夹内,并加载
- 第二种:使用 Lip 安装,输入命令 `lip install github.com/zimuya4153/LSE_Waila`
- 第二种:使用 Lip 安装,输入命令 `lip install github.com/ZMBlocks/LSE_Waila`

## 使用方法

游戏内玩家可输入/waila 来设置自己的 Waila 开关及样式
![表单](https://github.com/zimuya4153/LSE_Waila/blob/main/image/form.png?raw=true)
![表单](https://github.com/ZMBlocks/LSE_Waila/blob/main/image/form.png?raw=true)
PS:如果装了我们的 [UI 包](https://wwm.lanzouq.com/iSMiT20o39ze "点击前往下载链接"),那活动栏将是一个非常好的选择
PS:如果装了 [信息栏](https://www.minebbs.com/resources/information-bar.5208/ "点击前往下载链接"),那侧边栏也是一个很好的选择
(装了信息栏材质包,需前往`Config.json`文件修改`NewLine``false`)
Expand Down Expand Up @@ -106,12 +106,6 @@ PS:如果装了 [信息栏](https://www.minebbs.com/resources/information-bar.52
| zh_TW | 中文(繁体) |
| ko_KR | 韩语 |

这里是 WuHuiZhang6902(合作者),教你点东西,看到 Config.js 文件没,如果你觉着名称后面的英文 id 显示太长,你可以将以下代码替换第 19 行,那么这 type 就变成短短的整数 id 了

```javascript
Text: (Player, Block) => I18nAPI.get('plugins.Waila.block.name', [Block.getTranslateName(Player.langCode), Block.id.toString()], Player.langCode)
```

## 配置文件介绍

**Config.js**
Expand Down Expand Up @@ -156,6 +150,13 @@ module.exports = {
/** 默认文本 @type {String} */
DefaultText: "",
/** 默认显示位置 @type {0 | 1 | 2 | 3 | 4} */
/**
* 0 - Boss栏
* 1 - 音符盒提示
* 2 - 物品栏上方
* 3 - 活动栏
* 4 - Sidebar 侧边栏
*/
DefaultMode: 0,
/** 刷新时间(秒) @type {Number} */
Hz: 0.1,
Expand Down
29 changes: 18 additions & 11 deletions Waila.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,12 @@ LLSE_Player.prototype.updateBossBarTitle =
bs.writeUnsignedVarInt(0x5);
bs.writeString(name);
return this.sendPacket(bs.createPacket(0x4A));
}
};

/** 配置文件 @type {{AllBefore:ConfigItem[],Block:ConfigItem[],Entity:ConfigItem[],AllAfter:ConfigItem[],Bossbar:{ID:Number,Color:Number,Percent:Number},DefaultText:String,DefaultMode:0|1|2|3,Hz:Number,maxDistance:Number,NewLine:boolean}} */
const Config = require('./Waila/Config.js').Config;
(() => {
let requireFunction = {};
const modules = ['GMLIB-LegacyRemoteCallApi/lib/GMLIB_API-JS.js', 'GMLIB-LegacyRemoteCallApi/lib/EventAPI-JS.js', 'GMLIB-LegacyRemoteCallApi/lib/BEPlaceholderAPI-JS.js'];
modules.forEach(path => {
try { requireFunction = Object.assign(requireFunction, require(`./${path}`)); } catch { }
try { requireFunction = Object.assign(requireFunction, require(`./../${path}`)); } catch { }
});
Object.keys(requireFunction).forEach(name => this[name] = requireFunction[name]);
})();
const { Minecraft, I18nAPI, Version } = require("./GMLIB-LegacyRemoteCallApi/lib/GMLIB_API-JS.js");
const { PAPI } = require("./GMLIB-LegacyRemoteCallApi/lib/BEPlaceholderAPI-JS.js");
const /** 玩家数据文件 */ Data = new JsonConfigFile('./plugins/Waila/Data.json');
Minecraft.setFixI18nEnabled();// 修复Mojang的i18n问题

Expand Down Expand Up @@ -190,4 +183,18 @@ function unloadDetection(cmd) {
}

mc.listen('onConsoleCmd', cmd => unloadDetection(cmd));
mc.listen('onPlayerCmd', (player, cmd) => player.permLevel >= 3 && unloadDetection(cmd) || true);
mc.listen('onPlayerCmd', (player, cmd) => player.permLevel >= 3 && unloadDetection(cmd) || true);

if (Version.getLrcaVersion().valueOf() == 130006) { // 临时修复
const languageFiles = File.getFilesList(`./plugins/Waila/Language`).filter(fileName => fileName.endsWith('.lang'));
for (const languageFile of languageFiles) {
File.copy(`./resource_packs/vanilla/texts/${languageFile}`, `./resource_packs/vanilla/texts/${languageFile}.bak`);
File.writeLine(`./resource_packs/vanilla/texts/${languageFile}`, File.readFrom(`./plugins/Waila/Language/${languageFile}`));
}
mc.listen("onServerStarted", () => {
for (const languageFile of languageFiles){
File.delete(`./resource_packs/vanilla/texts/${languageFile}`);
File.rename(`./resource_packs/vanilla/texts/${languageFile}.bak`, `./resource_packs/vanilla/texts/${languageFile}`);
}
});
}
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "lse-quickjs",
"description":"普普通通的搞高亮显示",
"author":"小小的子沐呀",
"version":"1.4.1",
"version":"1.4.2",
"dependencies": [
{
"name": "legacy-script-engine-quickjs"
Expand Down
18 changes: 9 additions & 9 deletions tooth.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"format_version": 2,
"tooth": "github.com/zimuya4153/LSE_Waila",
"version": "1.4.1",
"tooth": "github.com/ZMBlocks/LSE_Waila",
"version": "1.4.2",
"info": {
"name": "LSE_Waila",
"description": "普普通通的高亮显示~",
"source": "github.com/zimuya4153/LSE_Waila",
"source": "github.com/ZMBlocks/LSE_Waila",
"author": "小小的子沐呀",
"tags": [
"levilamina",
Expand All @@ -15,12 +15,12 @@
"legacyscriptengine"
]
},
"asset_url": "https://github.com/zimuya4153/LSE_Waila/releases/download/v1.4.1/LSE_Waila-1.4.1.zip",
"dependencies": {
"github.com/LiteLDev/LeviLamina": ">=0.12.x",
"gitea.litebds.com/LiteLDev/legacy-script-engine-quickjs": ">=0.7.9",
"github.com/GroupMountain/GMLIB": ">=0.12.8",
"github.com/GroupMountain/GMLIB-LegacyRemoteCallApi": ">=0.12.8"
"asset_url": "https://github.com/ZMBlocks/LSE_Waila/releases/download/v1.4.2/LSE_Waila-1.4.2.zip",
"prerequisites": {
"github.com/LiteLDev/LeviLamina": ">=1.0.0-rc.1",
"gitea.litebds.com/LiteLDev/legacy-script-engine-quickjs": ">=0.9.0-rc.1",
"github.com/GroupMountain/GMLIB": ">=0.13.9",
"github.com/GroupMountain/GMLIB-LegacyRemoteCallApi": ">=0.13.6"
},
"files": {
"place": [
Expand Down

0 comments on commit b0945b9

Please sign in to comment.