diff --git a/README.md b/README.md
index 838e84d..4c4e313 100644
--- a/README.md
+++ b/README.md
@@ -30,9 +30,10 @@
|{Player-Ui}|获取玩家客户端使用的UI|{Device-Os}|获取玩家设备的系统|
|{{Player-Uuid}|获取玩家的uuid|{Player-Ping}|获取玩家当前的延迟|
|{Player-Food}|玩家当前的饥饿度|{Player-Health}|玩家当前的血量|
-### 服务器相关的变
+### 服务器相关的变量
|变量|介绍|变量|介绍|
|-|-|-|-|
|{Server-Motd}|获取服务器主motd|{Server-SubMotd}|获取服务器副motd|
|{Server-Ip}|获取服务器IP|{Server-Port}|获取服务器端口|
-|{Server-Tps}|获取服务器当前TPS|---|---|
\ No newline at end of file
+|{Server-Tps}|获取服务器当前TPS|---|---|
+### [支持的插件](SupportPluginsVariables.md)
\ No newline at end of file
diff --git a/SupportPluginsVariables.md b/SupportPluginsVariables.md
new file mode 100644
index 0000000..f326d43
--- /dev/null
+++ b/SupportPluginsVariables.md
@@ -0,0 +1,80 @@
+[返回](README.md)
+# NewTipsVariables(变量文档)
+> **支持的插件篇**
+> **按插件的英文字母排序**
+> **TipsVeriable 相关变量移值中,部分变量名有改动**
+
+## A
+---
+## B
+---
+## C
+---
+## D
+---
+## **E**
+### **[EconomyAPI](https://github.com/Nukkit-coders/EconomyAPI)**
+|变量名|变量介绍|
+|-|-|
+|{economyApi-money}|玩家金钱数量|
+---
+## F
+---
+## G
+---
+## H
+---
+## I
+---
+## J
+---
+## K
+---
+## L
+---
+## M
+---
+## N
+---
+## **O**
+### **[OreArea](https://github.com/SmallasWater/OreArea)**
+**注意: 变量`{orearea-time-use}`在有限时的矿区会有BUG(到秒就不动了)**
+|变量名|变量介绍|
+|-|-|
+|{orearea-level-this}|获取玩家的矿区等级|
+|{orearea-level-next}|获取玩家的矿区下一等级|
+|{orearea-time-use}|获取玩家所在的矿区可以使用的时间|
+|{orearea-time-reset}|获取玩家所在的刷新时间|
+|{orearea-name}|获取玩家所在的矿区等级|
+---
+## **P**
+### **[playerPoints](https://github.com/SmallasWater/PlayerPoints)**
+|变量名|变量介绍|
+|-|-|
+|{point}|获取玩家的点券数量|
+---
+## Q
+---
+## R
+### **[RsTask](https://github.com/MemoriesOfTime/RSTask)**
+|变量名|变量介绍|
+|-|-|
+|{task-name}|正在进行中的任务 (显示第一个)|
+|{task-count}|玩家任务积分|
+---
+## S
+---
+## T
+---
+## U
+---
+## V
+---
+## W
+---
+## X
+---
+## Y
+---
+## Z
+---
\ No newline at end of file
diff --git a/lib/OreArea_v1.3.8.jar b/lib/OreArea_v1.3.8.jar
new file mode 100644
index 0000000..0b3f913
Binary files /dev/null and b/lib/OreArea_v1.3.8.jar differ
diff --git a/lib/RsTask_v1.8.4.jar b/lib/RsTask_v1.8.4.jar
new file mode 100644
index 0000000..3800b0c
Binary files /dev/null and b/lib/RsTask_v1.8.4.jar differ
diff --git a/pom.xml b/pom.xml
index 30fe3d0..b680cb4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
cn.stevei5mc
NewTipsVariables
- 1.0.0-beta2
+ 1.0.0-beta3
@@ -41,13 +41,36 @@
nukkit
1.0-SNAPSHOT
-
com.smallaswater.tips
Tips
2.1.8
provided
+
+ com.smallaswater
+ PlayerPoints
+ 1.3.0-20231117.131552-1
+
+
+ me.onebone
+ economyapi
+ 2.0.3
+
+
+ com.smallaswater.orearea
+ OreArea
+ 1.3.8
+ system
+ ${project.basedir}/lib/OreArea_v1.3.8.jar
+
+
+ com.smallaswater.rstask
+ RsTask
+ 1.8.4
+ system
+ ${project.basedir}/lib/RsTask_v1.8.4.jar
+
diff --git a/src/main/java/cn/stevei5mc/NewTipsVariables/main.java b/src/main/java/cn/stevei5mc/NewTipsVariables/Main.java
similarity index 59%
rename from src/main/java/cn/stevei5mc/NewTipsVariables/main.java
rename to src/main/java/cn/stevei5mc/NewTipsVariables/Main.java
index 02da068..1532538 100644
--- a/src/main/java/cn/stevei5mc/NewTipsVariables/main.java
+++ b/src/main/java/cn/stevei5mc/NewTipsVariables/Main.java
@@ -3,13 +3,17 @@
import cn.nukkit.plugin.PluginBase;
import cn.nukkit.plugin.PluginManager;
import tip.utils.Api;
-import cn.stevei5mc.NewTipsVariables.variables.tipstext;
-import cn.stevei5mc.NewTipsVariables.variables.tipsserver;
-import cn.stevei5mc.NewTipsVariables.variables.tipsplayer;
-import cn.stevei5mc.NewTipsVariables.variables.tipsplayer2;
-import cn.stevei5mc.NewTipsVariables.variables.tipsserver2;
+import cn.stevei5mc.NewTipsVariables.variables.tipsText;
+import cn.stevei5mc.NewTipsVariables.variables.tipsServer;
+import cn.stevei5mc.NewTipsVariables.variables.tipsPlayer;
+import cn.stevei5mc.NewTipsVariables.variables.tipsPlayerConfig;
+import cn.stevei5mc.NewTipsVariables.variables.tipsServerConfig;
+import cn.stevei5mc.NewTipsVariables.variables.supportPlugins.loadSupportPlugins;
+import cn.nukkit.Player;
+
+public class Main extends PluginBase {
+ public static Player player;
-public class main extends PluginBase {
public void onEnable() {
this.loadresource();//先把资源文件给加载了
//判断需要的前置插件是否存在
@@ -33,22 +37,22 @@ public void onDisable() {
public void loadresource() {
this.getDataFolder().mkdirs(); //创建插件文件夹
//每次都加载最新的变量信息
- this.saveResource("text-variables.txt","/text-variables.txt",true);
- this.saveResource("server-variables.txt","/server-variables.txt",true);
- this.saveResource("player-variables.txt","/player-variables.txt",true);
+ this.saveResource("base-variables.txt","/base-variables.txt",true);
+ this.saveResource("SupportPluginsVariables.txt","SupportPluginsVariables.txt",true);
this.getLogger().info("§a变量说明文件加载成功");
}
public void tipsvariables() {
- Api.registerVariables("tipstext", tipstext.class);
- Api.registerVariables("tipsserver", tipsserver.class);
- Api.registerVariables("tipsplayer", tipsplayer.class);
- Api.registerVariables("tipsplayer2", tipsplayer2.class);
- Api.registerVariables("tipsserver2", tipsserver2.class);
+ Api.registerVariables("tipsText", tipsText.class);
+ Api.registerVariables("tipsServer", tipsServer.class);
+ Api.registerVariables("tipsPlayer", tipsPlayer.class);
+ Api.registerVariables("tipsPlayerConfig", tipsPlayerConfig.class);
+ Api.registerVariables("tipsServerConfig", tipsServerConfig.class);
+ loadSupportPlugins.loadSupportVariables(player);
}
public void loadover() {
- this.getLogger().info("§a加载成功");
+ this.getLogger().info("§a变量加载完成");
this.getLogger().warning("§c警告:");
this.getLogger().warning("§c本插件为免费且开源的一款插件,如果你是付费获取到的那么你就被骗了");
this.getLogger().info("§a开源链接和使用方法: §bhttps://github.com/stevei5mc/NewTipsVariables");
diff --git a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/economyApiVariable.java b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/economyApiVariable.java
new file mode 100644
index 0000000..9e9fd91
--- /dev/null
+++ b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/economyApiVariable.java
@@ -0,0 +1,19 @@
+package cn.stevei5mc.NewTipsVariables.variables.supportPlugins;
+
+import cn.nukkit.Player;
+import tip.utils.variables.BaseVariable;
+import me.onebone.economyapi.EconomyAPI;
+
+public class economyApiVariable extends BaseVariable {
+ public economyApiVariable(Player player) {
+ super(player);
+ }
+
+ public void strReplace() {
+ economyApi();
+ }
+
+ public void economyApi() {
+ addStrReplaceString("{economyApi-money}", String.format("%.2f", EconomyAPI.getInstance().myMoney(player))); //这个代码的是复制TipsVeriable的
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/loadSupportPlugins.java b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/loadSupportPlugins.java
new file mode 100644
index 0000000..bd512d4
--- /dev/null
+++ b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/loadSupportPlugins.java
@@ -0,0 +1,61 @@
+package cn.stevei5mc.NewTipsVariables.variables.supportPlugins;
+
+import tip.utils.Api;
+import cn.nukkit.Server;
+import cn.nukkit.Player;
+import cn.stevei5mc.NewTipsVariables.variables.supportPlugins.economyApiVariable;
+import cn.stevei5mc.NewTipsVariables.variables.supportPlugins.smallasWater.playerPointsVariable;
+import cn.stevei5mc.NewTipsVariables.variables.supportPlugins.smallasWater.OreAreaVariable;
+import cn.stevei5mc.NewTipsVariables.variables.supportPlugins.smallasWater.RsTaskVariable;
+
+public class loadSupportPlugins {
+
+ public static void loadSupportVariables(Player player) {
+ //加载相关插件的变量时的提示
+ String loadSuccessMsg1 = "§a找到插件§e【§b";
+ String loadSuccessMsg2 = "§e】§a相关变量已加载";
+ String loadFailureMsg1 = "§c无法找到插件§e【§b";
+ String loadFailureMsg2 = "§e】§c相关变量加载失败,请安装相关插件再试";
+ //需要加载的变量的插件
+
+ String loadPlugin1 = "playerPoints";
+ if (Server.getInstance().getPluginManager().getPlugin(loadPlugin1) != null) {
+ //存在
+ Api.registerVariables("playerPointsVariable", playerPointsVariable.class);
+ Server.getInstance().getLogger().info(loadSuccessMsg1 + loadPlugin1 + loadSuccessMsg2);
+ } else {
+ //不存在
+ Server.getInstance().getLogger().info(loadFailureMsg1 + loadPlugin1 + loadFailureMsg2);
+ }
+
+ String loadPlugin2 = "EconomyAPI";
+ if (Server.getInstance().getPluginManager().getPlugin(loadPlugin2) != null) {
+ //存在
+ Api.registerVariables("economyApiVariable", economyApiVariable.class);
+ Server.getInstance().getLogger().info(loadSuccessMsg1 + loadPlugin2 + loadSuccessMsg2);
+ } else {
+ //不存在
+ Server.getInstance().getLogger().info(loadFailureMsg1 + loadPlugin2 + loadFailureMsg2);
+ }
+
+ String loadPlugin3 = "OreArea";
+ if (Server.getInstance().getPluginManager().getPlugin(loadPlugin3) != null) {
+ //存在
+ Api.registerVariables("OreAreaVariable", OreAreaVariable.class);
+ Server.getInstance().getLogger().info(loadSuccessMsg1 + loadPlugin3 + loadSuccessMsg2);
+ } else {
+ //不存在
+ Server.getInstance().getLogger().info(loadFailureMsg1 + loadPlugin3 + loadFailureMsg2);
+ }
+
+ String loadPlugin4 = "RSTask";
+ if (Server.getInstance().getPluginManager().getPlugin(loadPlugin4) != null) {
+ //存在
+ Api.registerVariables("RsTaskVariable", RsTaskVariable.class);
+ Server.getInstance().getLogger().info(loadSuccessMsg1 + loadPlugin4 + loadSuccessMsg2);
+ } else {
+ //不存在
+ Server.getInstance().getLogger().info(loadFailureMsg1 + loadPlugin4 + loadFailureMsg2);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/smallasWater/OreAreaVariable.java b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/smallasWater/OreAreaVariable.java
new file mode 100644
index 0000000..13087a3
--- /dev/null
+++ b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/smallasWater/OreAreaVariable.java
@@ -0,0 +1,78 @@
+package cn.stevei5mc.NewTipsVariables.variables.supportPlugins.smallasWater;
+
+import cn.nukkit.Player;
+import tip.utils.variables.BaseVariable;
+import ore.area.utils.player.PlayerClass;
+import ore.area.utils.area.AreaClass;
+import ore.area.utils.Tools;
+import ore.area.AreaMainClass;
+import java.util.LinkedHashMap;
+
+public class OreAreaVariable extends BaseVariable {
+ public OreAreaVariable(Player player) {
+ super(player);
+ }
+
+ public void strReplace() {
+ OreAreaVarPlayer();
+ OreAreaVarArea();
+ }
+
+ public void OreAreaVarPlayer() {
+ //这个代码的是复制TipsVeriable的
+ PlayerClass playerClass = PlayerClass.getPlayerClass(player.getName());
+ addStrReplaceString("{orearea-level-this}", playerClass.getMaxAreaLevel() + "");
+ addStrReplaceString("{orearea-level-next}", playerClass.getMaxAreaLevel() + 1 + "");
+ }
+
+ //参考(复制但有改动) https://github.com/SmallasWater/OreArea/blob/master/src/main/java/ore/area/utils/OreAreaVariable.java
+ public void OreAreaVarArea() {
+ AreaClass areaClass = Tools.getDefaultArea(player, 2);
+ String time = "§c不在范围,无法获取可使用时间";
+ String reset = "§c不在范围,无法获取刷新时间";
+ String name = "§c没有解锁矿区";
+ if(areaClass != null){
+ if(AreaMainClass.getInstance().useTime.containsKey(player.getName())) {
+ LinkedHashMap map = AreaMainClass.getInstance().useTime.get(player.getName());
+ if(map.containsKey(areaClass.getName())){
+ int i = Math.round(map.get(areaClass.getName()) /60);
+ if(i != 0) {
+ time = "§7" +i + "§2分钟";
+ }else{
+ time = "§7" +areaClass.getUseTime() + "§2秒";
+ }
+ }
+ }else{
+ if(!areaClass.isKey()){
+ time = "§c未开启";
+ }else{
+ PlayerClass playerClass = PlayerClass.getPlayerClass(player.getName());
+ if(playerClass.canKey(areaClass.getName())) {
+ if(areaClass.getUseTime() == -1) {
+ time = "§7无时限";
+ }else{
+ int i = Math.round(areaClass.getUseTime() /60);
+ if(i != 0) {
+ time = "§7" +i + "§2分钟";
+ }else{
+ time = "§7" +areaClass.getUseTime() + "§2秒";
+ }
+ }
+ }else{
+ time = "§c未解锁矿区";
+ }
+ }
+
+ }
+ if(AreaMainClass.timer.containsKey(areaClass.getName())) {
+ reset = String.valueOf(AreaMainClass.timer.get(areaClass.getName()));
+ }else{
+ reset = "§c未刷新";
+ }
+ name = areaClass.getName();
+ }
+ addStrReplaceString("{orearea-time-use}", time);
+ addStrReplaceString("{orearea-time-reset}", reset);
+ addStrReplaceString("{orearea-name}", name);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/smallasWater/RsTaskVariable.java b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/smallasWater/RsTaskVariable.java
new file mode 100644
index 0000000..c3a42d7
--- /dev/null
+++ b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/smallasWater/RsTaskVariable.java
@@ -0,0 +1,33 @@
+package cn.stevei5mc.NewTipsVariables.variables.supportPlugins.smallasWater;
+
+import cn.nukkit.Player;
+import tip.utils.variables.BaseVariable;
+import com.task.utils.tasks.PlayerFile;
+import com.task.utils.tasks.taskitems.PlayerTask;
+import java.util.LinkedList;
+
+public class RsTaskVariable extends BaseVariable {
+ public RsTaskVariable(Player player) {
+ super(player);
+ }
+
+ public void strReplace() {
+ RsTaskVar();
+ }
+
+ public void RsTaskVar() {
+ //这个代码的是复制TipsVeriable的
+ PlayerFile file = PlayerFile.getPlayerFile(this.player.getName());
+ LinkedList tasks = file.getInviteTasks();
+ String taskName = "暂无";
+ if (tasks.size() > 0) {
+ PlayerTask task = (PlayerTask)tasks.get(0);
+ if (task != null) {
+ taskName = task.getTaskName();
+ }
+ }
+
+ this.addStrReplaceString("{task-name}", taskName);
+ this.addStrReplaceString("{task-count}", file.getCount() + "");
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/smallasWater/playerPointsVariable.java b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/smallasWater/playerPointsVariable.java
new file mode 100644
index 0000000..e1f1737
--- /dev/null
+++ b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/supportPlugins/smallasWater/playerPointsVariable.java
@@ -0,0 +1,19 @@
+package cn.stevei5mc.NewTipsVariables.variables.supportPlugins.smallasWater;
+
+import cn.nukkit.Player;
+import tip.utils.variables.BaseVariable;
+import net.player.api.Point;
+
+public class playerPointsVariable extends BaseVariable {
+ public playerPointsVariable(Player player) {
+ super(player);
+ }
+
+ public void strReplace() {
+ playerPoint();
+ }
+
+ public void playerPoint() {
+ addStrReplaceString("{point}", String.format("%.2f", Point.myPoint(player))); //这个代码的是复制TipsVeriable的
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsplayer.java b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsPlayer.java
similarity index 74%
rename from src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsplayer.java
rename to src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsPlayer.java
index 4a99964..1648fb6 100644
--- a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsplayer.java
+++ b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsPlayer.java
@@ -4,20 +4,20 @@
import cn.nukkit.Server;
import tip.utils.variables.BaseVariable;
-public class tipsplayer extends BaseVariable {
- public tipsplayer(Player player) {
+public class tipsPlayer extends BaseVariable {
+ public tipsPlayer(Player player) {
super(player);
}
public void strReplace() {
- playervar();
+ playerVar();
}
- public void playervar() {
+ public void playerVar() {
addStrReplaceString("{Player-Xp}", String.valueOf(player.getExperienceLevel()));
addStrReplaceString("{Device-Model}", player.getLoginChainData().getDeviceModel());
addStrReplaceString("{XUID}", String.valueOf(player.getLoginChainData().getXUID()));
- addStrReplaceString("{Player-Lang}", player.getLoginChainData().getLanguageCode());
- addStrReplaceString("{Player-Uuid}", String.valueOf(player.getLoginChainData().getClientUUID()));
+ addStrReplaceString("{Player-Lang}", player.getLoginChainData().getLanguageCode());
+ addStrReplaceString("{Player-Uuid}", String.valueOf(player.getLoginChainData().getClientUUID()));
}
}
\ No newline at end of file
diff --git a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsplayer2.java b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsPlayerConfig.java
similarity index 95%
rename from src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsplayer2.java
rename to src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsPlayerConfig.java
index f8bb82e..7e0ae7a 100644
--- a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsplayer2.java
+++ b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsPlayerConfig.java
@@ -4,16 +4,16 @@
import cn.nukkit.Server;
import tip.utils.variables.BaseVariable;
-public class tipsplayer2 extends BaseVariable {
- public tipsplayer2(Player player) {
+public class tipsPlayerConfig extends BaseVariable {
+ public tipsPlayerConfig(Player player) {
super(player);
}
public void strReplace() {
- playervar();
+ playerVarConfig();
}
- public void playervar() {
+ public void playerVarConfig() {
addStrReplaceString("{Device-Os}", this.mapDeviceOSToString(player.getLoginChainData().getDeviceOS()));
addStrReplaceString("{Player-Ui}", this.playerUiString(player.getLoginChainData().getUIProfile()));
addStrReplaceString("{Player-Ping}", this.getPlayerPing(player));
@@ -21,7 +21,6 @@ public void playervar() {
addStrReplaceString("{Player-Health}", this.getPlayerHealth(player));
}
-
//这下面的内容是要从config.yml获取内容的,但是现在还不行
/*这ui档案应该只有classic ui和pocket ui这两种UI(测试出来的)
diff --git a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsserver.java b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsServer.java
similarity index 79%
rename from src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsserver.java
rename to src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsServer.java
index a537363..b4603cb 100644
--- a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsserver.java
+++ b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsServer.java
@@ -4,16 +4,16 @@
import cn.nukkit.Server;
import tip.utils.variables.BaseVariable;
-public class tipsserver extends BaseVariable {
- public tipsserver(Player player) {
+public class tipsServer extends BaseVariable {
+ public tipsServer(Player player) {
super(player);
}
public void strReplace() {
- scv();
+ serverVar();
}
- public void scv() {
+ public void serverVar() {
addStrReplaceString("{Server-Motd}", Server.getInstance().getMotd());
addStrReplaceString("{Server-SubMotd}", Server.getInstance().getSubMotd());
addStrReplaceString("{Server-Ip}", Server.getInstance().getIp());
diff --git a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsserver2.java b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsServerConfig.java
similarity index 77%
rename from src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsserver2.java
rename to src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsServerConfig.java
index 83acc1f..db5038b 100644
--- a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsserver2.java
+++ b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsServerConfig.java
@@ -4,19 +4,21 @@
import cn.nukkit.Server;
import tip.utils.variables.BaseVariable;
-public class tipsserver2 extends BaseVariable {
- public tipsserver2(Player player) {
+public class tipsServerConfig extends BaseVariable {
+ public tipsServerConfig(Player player) {
super(player);
}
public void strReplace() {
- scv();
+ serverVarConfig();
}
- public void scv() {
+ public void serverVarConfig() {
addStrReplaceString("{Server-Tps}", this.getServerTps(player));
}
+ //这下面的内容是要从config.yml获取内容的,但是现在还不行
+
public static String getServerTps(Player player) {
String serverTps = "§a15";
if (Server.getInstance().getTicksPerSecond() >= 0) {
diff --git a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipstext.java b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsText.java
similarity index 90%
rename from src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipstext.java
rename to src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsText.java
index a81b23e..4034e6e 100644
--- a/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipstext.java
+++ b/src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsText.java
@@ -3,16 +3,16 @@
import cn.nukkit.Player;
import tip.utils.variables.BaseVariable;
-public class tipstext extends BaseVariable {
- public tipstext(Player player) {
+public class tipsText extends BaseVariable {
+ public tipsText(Player player) {
super(player);
}
public void strReplace() {
- tc();
+ textVar();
}
- public void tc() {
+ public void textVar() {
addStrReplaceString("{text-s0}", "§0");
addStrReplaceString("{text-s1}", "§1");
addStrReplaceString("{text-s2}", "§2");
diff --git a/src/main/resources/SupportPluginsVariables.txt b/src/main/resources/SupportPluginsVariables.txt
new file mode 100644
index 0000000..ffacb6d
--- /dev/null
+++ b/src/main/resources/SupportPluginsVariables.txt
@@ -0,0 +1,20 @@
+NewTipsVariables(变量文档)
+ 本文档内容为支持的插件变量
+ 变量内容排序按插件的英文字母排序
+E
+ EconomyAPI
+ {economyApi-money} 玩家金钱数量
+O
+ OreArea
+ {orearea-level-this} 获取玩家的矿区等级
+ {orearea-level-next} 获取玩家的矿区下一等级
+ {orearea-time-use} 获取玩家所在的矿区可以使用的时间(在有限时的矿区会有BUG,是到秒就不动了)
+ {orearea-time-reset} 获取玩家所在的刷新时间
+ {orearea-name} 获取玩家所在的矿区等级
+P
+ playerPoints
+ {point} 获取玩家的点券数量
+R
+ RsTask
+ {task-name} 正在进行中的任务 (显示第一个)
+ {task-count} 玩家任务积分
\ No newline at end of file
diff --git a/src/main/resources/base-variables.txt b/src/main/resources/base-variables.txt
new file mode 100644
index 0000000..bc798da
--- /dev/null
+++ b/src/main/resources/base-variables.txt
@@ -0,0 +1,40 @@
+变量名 变量说明
+玩家相关的变量:
+{XUID} 获取玩家的xuid
+{Player-Ui} 获取玩家客户端使用的UI
+{Device-Os} 获取玩家设备的系统
+{Player-Xp} 获取玩家在游戏中的经验等级(minecraft的)
+{Player-Lang} 获取玩家客户端使用的语言
+{Player-Uuid} 获取玩家的uuid
+{Player-Ping} 获取玩家当前的延迟
+{Player-Food} 玩家当前的饥饿度
+{Device-Model} 获取玩家使用的设备型号
+{Player-Health} 玩家当前的血量
+服务器相关变量:
+{Server-Ip} 获取服务器IP
+{Server-Tps} 获取服务器当前TPS
+{Server-Port} 获取服务器端口
+{Server-Motd} 获取服务器主motd
+{Server-SubMotd} 获取服务器副motd
+文字相关的:
+{text-s0} §0
+{text-s1} §1
+{text-s2} §2
+{text-s3} §3
+{text-s4} §4
+{text-s5} §5
+{text-s6} §6
+{text-s7} §7
+{text-s8} §8
+{text-s9} §9
+{text-sa} §a
+{text-sb} §b
+{text-sc} §c
+{text-sd} §d
+{text-se} §e
+{text-sf} §f
+{text-bold} §l
+{text-italic} §o
+{text-reset} §r
+{text-mess} §k
+{text-next} \n
\ No newline at end of file
diff --git a/src/main/resources/player-variables.txt b/src/main/resources/player-variables.txt
deleted file mode 100644
index f3a5d09..0000000
--- a/src/main/resources/player-variables.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-变量名 变量说明
-{Player-Xp} 获取玩家在游戏中的经验等级(minecraft的)
-{Device-Model} 获取玩家使用的设备型号
-{XUID} 获取玩家的xuid
-{Player-Lang} 获取玩家客户端使用的语言
-{Player-Ui} 获取玩家客户端使用的UI
-{Device-Os} 获取玩家设备的系统
-{Player-Uuid} 获取玩家的uuid
-{Player-Ping} 获取玩家当前的延迟
-{Player-Food} 玩家当前的饥饿度
-{Player-Health} 玩家当前的血量
\ No newline at end of file
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 66a7510..f913fbc 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -1,5 +1,5 @@
name: NewTipsVariables
-main: cn.stevei5mc.NewTipsVariables.main
-version: '1.0.0-beta2'
+main: cn.stevei5mc.NewTipsVariables.Main
+version: '1.0.0-beta3'
author: stevei5mc
api: ["1.0.14"]
\ No newline at end of file
diff --git a/src/main/resources/server-variables.txt b/src/main/resources/server-variables.txt
deleted file mode 100644
index 41ad645..0000000
--- a/src/main/resources/server-variables.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-变量名 变量说明
-{Server-Motd} 获取服务器主motd
-{Server-SubMotd} 获取服务器副motd
-{Server-Ip} 获取服务器IP
-{Server-Port} 获取服务器端口
-{Server-Tps} 获取服务器当前TPS
\ No newline at end of file
diff --git a/src/main/resources/text-variables.txt b/src/main/resources/text-variables.txt
deleted file mode 100644
index 6d31c6d..0000000
--- a/src/main/resources/text-variables.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-变量名 === 对应内容
-{text-s0} === §0
-{text-s1} === §1
-{text-s2} === §2
-{text-s3} === §3
-{text-s4} === §4
-{text-s5} === §5
-{text-s6} === §6
-{text-s7} === §7
-{text-s8} === §8
-{text-s9} === §9
-{text-sa} === §a
-{text-sb} === §b
-{text-sc} === §c
-{text-sd} === §d
-{text-se} === §e
-{text-sf} === §f
-{text-bold} === §l
-{text-italic} === §o
-{text-reset} === §r
-{text-mess} === §k
-{text-next} === \n
\ No newline at end of file