-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from stevei5mc/dev
Dev 1.0.0-beta1
- Loading branch information
Showing
14 changed files
with
293 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
# NewTipsVeriable | ||
## 敬请期待 | ||
## 插件介绍 | ||
> 该插件可以为Tips添加更多的变量内容,更多变量敬请期待 | ||
## 使用方法 | ||
> 1、将插件放进`plugins`文件夹 | ||
> 2、需确保安装`Tips`插件后重启服务器 | ||
> 3、在`/plugins/NewTipsVariables`文件夹中的txt文件获取相关变量介绍,也可在本页面获取相关的变量介绍 | ||
## 变量介绍 | ||
### 文字相关的变量 | ||
|变量名|对应内容|变量名|对应内容|变量名|对应内容|变量名|对应内容| | ||
|-|-|-|-|-|-|-|-| | ||
|{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}|§r|---|---|---|---|---|---| | ||
### 玩家相关的变量 | ||
|变量|介绍|变量|介绍| | ||
|-|-|-|-| | ||
|{xp}|获取玩家在游戏中的经验等级(minecraft的)|{DeviceModel}|获取玩家使用的设备型号| | ||
|{XUID}|获取玩家的xuid|{PlayerLang}|获取玩家客户端使用的语言| | ||
### 服务器相关的变量 | ||
|变量|介绍|变量|介绍| | ||
|-|-|-|-| | ||
|{Motd}|获取服务器主motd|{SubMotd}|获取服务器副motd| | ||
|{ServerIp}|获取服务器IP|{ServerPort}|获取服务器端口| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>cn.stevei5mc</groupId> | ||
<artifactId>NewTipsVariables</artifactId> | ||
<version>1.0.0-beta1</version> | ||
|
||
<repositories> | ||
<repository> | ||
<id>opencollab-repo-release</id> | ||
<url>https://repo.opencollab.dev/maven-releases/</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>false</enabled> | ||
</snapshots> | ||
</repository> | ||
<repository> | ||
<id>opencollab-repo-snapshot</id> | ||
<url>https://repo.opencollab.dev/maven-snapshots/</url> | ||
<releases> | ||
<enabled>false</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</repository> | ||
<repository> | ||
<id>repo-lanink-cn</id> | ||
<url>https://repo.lanink.cn/repository/maven-public/</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>cn.nukkit</groupId> | ||
<artifactId>nukkit</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.smallaswater.tips</groupId> | ||
<artifactId>Tips</artifactId> | ||
<version>2.1.8</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<properties> | ||
<maven.compiler.source>8</maven.compiler.source> | ||
<maven.compiler.target>8</maven.compiler.target> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.2</version> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
<encoding>UTF-8</encoding> | ||
</configuration> | ||
</plugin> | ||
|
||
</plugins> | ||
</build> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package cn.stevei5mc.NewTipsVariables; | ||
|
||
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; | ||
|
||
public class main extends PluginBase { | ||
public void onEnable() { | ||
this.loadresource(); | ||
if (this.getServer().getPluginManager().getPlugin("Tips") != null) { | ||
this.tipsvariables(); | ||
this.loadover(); | ||
} else { | ||
this.getLogger().warning("§c未检测到前置插件§aTips§c,请安装§aTips§c再试!!!"); | ||
this.getLogger().warning("§b下载地址: §ehttps://ci.lanink.cn/job/Tips/"); | ||
this.onDisable(); | ||
} | ||
} | ||
|
||
public void onDisable() { | ||
this.getLogger().info("停止运行"); | ||
this.getLogger().info("§6感谢你的使用"); | ||
} | ||
|
||
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.getLogger().info("变量说明文件生成成功"); | ||
} | ||
|
||
public void tipsvariables() { | ||
Api.registerVariables("tipstext", tipstext.class); | ||
Api.registerVariables("tipsserver", tipsserver.class); | ||
Api.registerVariables("tipsplayer", tipsplayer.class); | ||
} | ||
|
||
public void loadover() { | ||
this.getLogger().info("加载成功"); | ||
this.getLogger().warning("§c警告:"); | ||
this.getLogger().warning("§c本插件为免费且开源的一款插件,如果你是付费获取到的那么你就被骗了"); | ||
this.getLogger().info("§a开源链接和使用方法: §bhttps://github.com/stevei5mc/NewTipsVariables"); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsplayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package cn.stevei5mc.NewTipsVariables.variables; | ||
|
||
import cn.nukkit.Player; | ||
import cn.nukkit.Server; | ||
import tip.utils.variables.BaseVariable; | ||
|
||
public class tipsplayer extends BaseVariable { | ||
public tipsplayer(Player player) { | ||
super(player); | ||
} | ||
|
||
public void strReplace() { | ||
playervar(); | ||
} | ||
|
||
public void playervar() { | ||
addStrReplaceString("{xp}", String.valueOf(player.getExperienceLevel())); | ||
addStrReplaceString("{DeviceModel}", player.getLoginChainData().getDeviceModel()); | ||
addStrReplaceString("{XUID}", String.valueOf(player.getLoginChainData().getXUID())); | ||
addStrReplaceString("{PlayerLang}", player.getLoginChainData().getLanguageCode()); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipsserver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package cn.stevei5mc.NewTipsVariables.variables; | ||
|
||
import cn.nukkit.Player; | ||
import cn.nukkit.Server; | ||
import tip.utils.variables.BaseVariable; | ||
|
||
public class tipsserver extends BaseVariable { | ||
public tipsserver(Player player) { | ||
super(player); | ||
} | ||
|
||
public void strReplace() { | ||
scv(); | ||
} | ||
|
||
public void scv() { | ||
addStrReplaceString("{Motd}", Server.getInstance().getMotd()); | ||
addStrReplaceString("{SubMotd}", Server.getInstance().getSubMotd()); | ||
addStrReplaceString("{ServerIp}", Server.getInstance().getIp()); | ||
addStrReplaceString("{ServerPort}", String.valueOf(Server.getInstance().getPort())); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/cn/stevei5mc/NewTipsVariables/variables/tipstext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package cn.stevei5mc.NewTipsVariables.variables; | ||
|
||
import cn.nukkit.Player; | ||
import tip.utils.variables.BaseVariable; | ||
|
||
public class tipstext extends BaseVariable { | ||
public tipstext(Player player) { | ||
super(player); | ||
} | ||
|
||
public void strReplace() { | ||
tc(); | ||
} | ||
|
||
public void tc() { | ||
addStrReplaceString("{text-s0}", "§0"); | ||
addStrReplaceString("{text-s1}", "§1"); | ||
addStrReplaceString("{text-s2}", "§2"); | ||
addStrReplaceString("{text-s3}", "§3"); | ||
addStrReplaceString("{text-s4}", "§4"); | ||
addStrReplaceString("{text-s5}", "§5"); | ||
addStrReplaceString("{text-s6}", "§6"); | ||
addStrReplaceString("{text-s7}", "§7"); | ||
addStrReplaceString("{text-s8}", "§8"); | ||
addStrReplaceString("{text-s9}", "§9"); | ||
addStrReplaceString("{text-sa}", "§a"); | ||
addStrReplaceString("{text-sb}", "§b"); | ||
addStrReplaceString("{text-sc}", "§c"); | ||
addStrReplaceString("{text-sd}", "§d"); | ||
addStrReplaceString("{text-se}", "§e"); | ||
addStrReplaceString("{text-sf}", "§f"); | ||
addStrReplaceString("{text-bold}", "§l"); | ||
addStrReplaceString("{text-italic}", "§o"); | ||
addStrReplaceString("{text-reset}", "§r"); | ||
addStrReplaceString("{text-mess}", "§k"); | ||
addStrReplaceString("{text-next}", "\n"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# 更新功能(这个功能展示没有用) | ||
updata: | ||
#检查更新(暂时没有用) | ||
check: false | ||
#自动更新(需开启检查更新但暂时没有用) | ||
auto: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
变量名 变量说明 | ||
{xp} 获取玩家在游戏中的经验等级(minecraft的) | ||
{DeviceModel} 获取玩家使用的设备型号 | ||
{XUID} 获取玩家的xuid | ||
{PlayerLang} 获取玩家客户端使用的语言 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: NewTipsVariables | ||
main: cn.stevei5mc.NewTipsVariables.main | ||
version: '1.0.0-beta1' | ||
author: stevei5mc | ||
api: ["1.0.14"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
变量名 变量说明 | ||
{Motd} 获取服务器主motd | ||
{SubMotd} 获取服务器副motd | ||
{ServerIp} 获取服务器IP | ||
{ServerPort} 获取服务器端口 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
变量名 === 对应内容 | ||
{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 |