Skip to content

Commit

Permalink
修改一些细节
Browse files Browse the repository at this point in the history
  • Loading branch information
stevei5mc committed Feb 7, 2024
1 parent 821bd35 commit 1cd593a
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 12 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
> **1、将插件放进`plugins`文件夹**
> **2、需确保安装`Tips`插件后重启服务器**
> **3、在`/plugins/NewTipsVariables`文件夹中的`.txt`文件获取相关变量介绍,也可在本页面获取相关的变量介绍**
## **[配置文件使用说明](config-info.md)**
## 变量介绍
### 文字相关的变量
|变量名|对应内容|变量名|对应内容|变量名|对应内容|变量名|对应内容|
Expand Down
2 changes: 1 addition & 1 deletion SupportPluginsVariables.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[返回](README.md)
[返回](README.md) [配置文件说明](config-info.md)
# NewTipsVariables(变量文档)
> **支持的插件篇**
> **按插件的英文字母排序**
Expand Down
66 changes: 61 additions & 5 deletions config-info.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
[返回](README.md) [支持的插件](SupportPluginsVariables.md)
# **配置文件使用说明**
> **若未在此说明中写配置项出则代表该配置项还没有支持**
```
```
## **[config.yml](src/main/resources/config.yml)**
> **主配置文件**
### **是否释放新的变量说明文档**
```
save-variables-doc: true
```
> 1、该配置项启用后,服务器每次启动后都会生成新的变量文档
> 2、若关闭后,就算删除变量文档也不会生成新的变量文档
> 3、该配置项默认启用
> **1、该配置项启用后,服务器每次启动后都会生成新的变量文档**
> **2、若关闭后,就算删除变量文档也不会生成新的变量文档**
> **3、该配置项默认启用**
## **[server.yml](src/main/resources/server.yml)**
> **服务器相关变量配置文件**
```
Expand All @@ -18,5 +22,57 @@ TPS:
high_value: 15
high_color: "§a"
```
> 1、color设置显示的颜色,low、medium、high为显示的范围
> 2、value是一个范围值,medium、high为可设置的范围值,low值只能为0
> **1、```color```设置显示的颜色,```low``````medium``````high```为显示的范围**
> **2、```value```是一个范围值,```medium``````high```为可设置的范围值,```low```值只能为```0```**
## **[player.yml](src/main/resources/player.yml)**
> **玩家相关变量配置文件**
```
Device:
OS:
Android: "安卓"
iOS: "苹果"
macOS: "苹果但是电脑"
Fire_OS: "Fire_OS"
Gear_VR: "Gear_VR"
HoloLens: "HoloLens"
Windows_10: "Windows 10"
Windows: "Windows"
Dedicated: "Dedicated"
tvOS: "tvOS"
PlayStation: "PlayStation"
Switch: "Switch"
Xbox: "Xbox"
Windows_Phone: "windows但是手机"
Unknown: "未知的系统"
UIProfile:
classic: "classic ui"
pocket: "pocket ui"
Unknown: "Unknown ui
```
> 1、**```OS```玩家的设备系统**
> 2、**```UIProfile```玩家的设备UI**
```
ping:
low_color: "§a"
medium_value: 80
medium_color: "§e"
high_value: 120
high_color: "§c"
HP:
symbols: "§7/"
low_color: "§c"
medium_value: 9
medium_color: "§e"
high_value: 15
high_color: "§a"
Food:
symbols: "§7/"
low_color: "§c"
medium_value: 9
medium_color: "§e"
high_value: 15
high_color: "§a"
```
> **1、```color```设置显示的颜色,```low``````medium``````high```为显示的范围**
> **2、```value```是一个范围值,```medium``````high```为可设置的范围值,```low```值只能为```0```**
> **3、```symbols```是用来设置分割符号的,例如: ```HP: 20/20```**
Original file line number Diff line number Diff line change
Expand Up @@ -37,44 +37,48 @@ private String playerUiString(int uiprofile) {

//获取玩家的饱食度状态
public static String getPlayerFood(Player player) {
String playerFoodSymbols = Main.getInstance().getConfigInPlayer().getString("Food.symbols");
String playerFoodLowColor = Main.getInstance().getConfigInPlayer().getString("Food.low_color");
int playerFoodMediumValue = Main.getInstance().getConfigInPlayer().getInt("Food.medium_value");
String playerFoodMediumColor = Main.getInstance().getConfigInPlayer().getString("Food.medium_color");
int playerFoodHgihValue = Main.getInstance().getConfigInPlayer().getInt("Food.high_value");
String playerFoodHgihColor = Main.getInstance().getConfigInPlayer().getString("Food.high_color");
String playerFood = playerFoodHgihColor + playerFoodHgihValue;
float foodValue = player.getFoodData().getLevel();
int foodMaxValue = player.getFoodData().getMaxLevel();
//最低值为0
if (foodValue >= 0) {
playerFood = playerFoodLowColor + foodValue;
playerFood = playerFoodLowColor + foodValue + playerFoodSymbols + playerFoodLowColor + foodMaxValue;
}
if (foodValue >= playerFoodMediumValue) {
playerFood = playerFoodMediumColor + foodValue;
playerFood = playerFoodMediumColor + foodValue + playerFoodSymbols + playerFoodMediumColor + foodMaxValue;
}
if (foodValue >= playerFoodHgihValue) {
playerFood = playerFoodHgihColor + foodValue;
playerFood = playerFoodHgihColor + foodValue + playerFoodSymbols + playerFoodHgihColor + foodMaxValue;
}
return playerFood;
}

//获取玩家的生命值状态
public static String getPlayerHealth(Player player) {
String playerHealthSymbols = Main.getInstance().getConfigInPlayer().getString("HP.symbols");
String playerHealthLowColor = Main.getInstance().getConfigInPlayer().getString("HP.low_color");
int playerHealthMediumValue = Main.getInstance().getConfigInPlayer().getInt("HP.medium_value");
String playerHealthMediumColor = Main.getInstance().getConfigInPlayer().getString("HP.medium_color");
int playerHealthHgihValue = Main.getInstance().getConfigInPlayer().getInt("HP.high_value");
String playerHealthHgihColor = Main.getInstance().getConfigInPlayer().getString("HP.high_color");
String playerHealth = playerHealthHgihColor + playerHealthHgihValue;
float healthValue = player.getHealth();
int healthMaxValue = player.getMaxHealth();
//最低值为0
if (healthValue >= 0) {
playerHealth = playerHealthLowColor + healthValue;
playerHealth = playerHealthLowColor + healthValue + playerHealthSymbols + playerHealthLowColor + healthMaxValue;
}
if (healthValue >= playerHealthMediumValue) {
playerHealth = playerHealthMediumColor + healthValue;
playerHealth = playerHealthMediumColor + healthValue + playerHealthSymbols + playerHealthMediumColor + healthMaxValue;
}
if (healthValue >= playerHealthHgihValue) {
playerHealth = playerHealthHgihColor + healthValue;
playerHealth = playerHealthHgihColor + healthValue + playerHealthSymbols + playerHealthHgihColor + healthMaxValue;
}
return playerHealth;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#使用说明: https://github.com/stevei5mc/NewTipsVariables/blob/main/README.md
#配置文件版本,勿动
version: 1
# 更新功能(这个功能展示没有用)
updata:
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/player.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#使用说明: https://github.com/stevei5mc/NewTipsVariables/blob/main/README.md
#配置文件版本,勿动
version: 1
Device:
OS:
Expand Down Expand Up @@ -27,12 +29,14 @@ ping:
high_value: 120
high_color: "§c"
HP:
symbols: "§7/"
low_color: "§c"
medium_value: 9
medium_color: "§e"
high_value: 15
high_color: "§a"
Food:
symbols: "§7/"
low_color: "§c"
medium_value: 9
medium_color: "§e"
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/server.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#使用说明: https://github.com/stevei5mc/NewTipsVariables/blob/main/README.md
#配置文件版本,勿动
version: 1
TPS:
low_color: "§c"
Expand Down

0 comments on commit 1cd593a

Please sign in to comment.