Skip to content

Commit

Permalink
[2.0.0] 版本更新
Browse files Browse the repository at this point in the history
- [A] 添加消息点击执行功能(基于MineDown实现)。
  • Loading branch information
CarmJos committed Feb 18, 2022
1 parent b311820 commit 9ee18d0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
## [依赖](https://github.com/CarmJos/MoeTeleport/network/dependencies)

- **[必须]** 插件本体基于 [Spigot-API](https://hub.spigotmc.org/stash/projects/SPIGOT)[BukkitAPI](http://bukkit.org/) 实现。
- **[自带]** 消息格式基于 [MineDown](https://github.com/Phoenix616/MineDown) 实现。
- 所有 messages.yml 均支持 MineDown 语法。
- **[推荐]** 变量部分基于 [PlaceholderAPI](https://www.spigotmc.org/resources/6245/) 实现。

详细依赖列表可见 [Dependencies](https://github.com/CarmJos/MoeTeleport/network/dependencies)
Expand Down Expand Up @@ -64,7 +66,9 @@

### 消息配置文件 ([messages.yml](src/main/resources/messages.yml))

详见源文件。
支持 [MineDown 语法](https://wiki.phoenix616.dev/library:minedown:syntax),详见源文件。



### 玩家数据配置文件 (data/\<UUID\>.yml)

Expand Down
20 changes: 19 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<groupId>cc.carm.plugin</groupId>
<artifactId>moeteleport</artifactId>
<version>1.2.1</version>
<version>2.0.0</version>

<name>MoeTeleport</name>
<description>喵喵传送,简单的传送、设置家的插件。</description>
Expand Down Expand Up @@ -71,6 +71,11 @@
<url>https://repo1.maven.org/maven2/</url>
</repository>

<repository>
<id>minebench-repo</id>
<url>https://repo.minebench.de/</url>
</repository>

<repository>
<id>github</id>
<name>GitHub Packages</name>
Expand Down Expand Up @@ -103,6 +108,13 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>de.themoep</groupId>
<artifactId>minedown</artifactId>
<version>1.7.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down Expand Up @@ -176,6 +188,12 @@
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>de.themoep.minedown</pattern>
<shadedPattern>cc.carm.plugin.moeteleport.lib.minedown</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
<plugin>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/cc/carm/plugin/moeteleport/Main.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cc.carm.plugin.moeteleport;

import cc.carm.plugin.moeteleport.command.BackCommand;
import cc.carm.plugin.moeteleport.command.MoeTeleportCommand;
import cc.carm.plugin.moeteleport.command.completer.HomeNameCompleter;
import cc.carm.plugin.moeteleport.command.completer.PlayerNameCompleter;
import cc.carm.plugin.moeteleport.command.completer.TpRequestCompleter;
Expand Down Expand Up @@ -109,6 +110,8 @@ public void onEnable() {
regListener(new UserListener());

log("注册指令...");
registerCommand("MoeTeleport", new MoeTeleportCommand());

registerCommand("back", new BackCommand());

registerCommand("home", new GoHomeCommand(), new HomeNameCompleter());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cc.carm.plugin.moeteleport.util;

import de.themoep.minedown.MineDown;
import me.clip.placeholderapi.PlaceholderAPI;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
Expand All @@ -17,7 +18,7 @@ public static boolean hasPlaceholderAPI() {
public static void send(@Nullable CommandSender sender, List<String> messages) {
if (messages == null || messages.isEmpty() || sender == null) return;
for (String s : messages) {
sender.sendMessage(ColorParser.parse(s));
sender.spigot().sendMessage(MineDown.parse(s));
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ not-online:
- "&f目标玩家并不在线,无法发送请求。"
tpa:
- "&d%(player) &f请求传送到您身边,您有 &5%(expire)秒 &f的时间回应。"
- "&a&l[command=/tpAccept %(player)][同意][/command] &f输入 &5/tpaccept &f同意该请求。"
- "&c&l[command=/tpDeny %(player)][拒绝][/command] &f输入 &5/tpdeny &f拒绝该请求。"
- "[&a&l[同意]](show_text=点击同意请求 run_command=/tpAccept %(player)) &f输入 &5/tpAccept &f同意该请求。"
- "[&c&l[拒绝]](show_text=点击拒绝请求 run_command=/tpDeny %(player)) &f输入 &5/tpDeny &f拒绝该请求。"
tpahere:
- "&d%(player) &f请求传送您到Ta身边,您有 &5%(expire)秒 &f的时间回应。"
- "&a&l[command=/tpAccept %(player)][同意][/command] &f输入 &5/tpaccept &f同意该请求。"
- "&c&l[command=/tpDeny %(player)][拒绝][/command] &f输入 &5/tpdeny &f拒绝该请求。"
- "[&a&l[同意]](show_text=点击同意请求 run_command=/tpAccept %(player)) &f输入 &5/tpAccept &f同意该请求。"
- "[&c&l[拒绝]](show_text=点击拒绝请求 run_command=/tpDeny %(player)) &f输入 &5/tpDeny &f拒绝该请求。"
tpaccept:
- "&f您同意了 &d%(player) &f的传送请求。"
tpdeny:
Expand Down Expand Up @@ -54,7 +54,7 @@ notAvailable:

home-list-header:
- "&f您当前设定的所有家:"
home-list-object: "&8# &f%(id) &d%(location) &7[command=/home %(id)]✈[/command]"
home-list-object: "&8# &f%(id) &d%(location) [&7✈](show_text=点击返回家 %(id) run_command=/home %(id))"
home-not-found:
- "&f您还没有设置这个家,请先输入 &5/setHome <家名称> &f设置一个吧!"
home-set:
Expand Down

0 comments on commit 9ee18d0

Please sign in to comment.