mirror of
https://github.com/CarmJos/MoeTeleport.git
synced 2026-06-04 16:46:10 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9ee18d0f3c | |||
| b311820483 | |||
| b8d2d060dc | |||
| 3b3e678fc7 |
@@ -1,7 +1,7 @@
|
|||||||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
||||||
|
|
||||||
name: Build
|
name: Build & Tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# 支持手动触发构建
|
# 支持手动触发构建
|
||||||
@@ -29,10 +29,15 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
MAVEN_USERNAME: ${{ github.repository_owner }}
|
MAVEN_USERNAME: ${{ github.repository_owner }}
|
||||||
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||||
- name: "Target Stage"
|
|
||||||
run: mkdir staging && cp target/*.jar staging
|
- name: "Target Staging"
|
||||||
|
run: |
|
||||||
|
mkdir artifacts
|
||||||
|
cp -vrf target/ artifacts/target/
|
||||||
|
cp -vrf asset/*.jar artifacts
|
||||||
|
|
||||||
- name: "Upload artifact"
|
- name: "Upload artifact"
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: Artifact
|
name: Artifact
|
||||||
path: staging
|
path: artifacts
|
||||||
@@ -18,6 +18,8 @@
|
|||||||
## [依赖](https://github.com/CarmJos/MoeTeleport/network/dependencies)
|
## [依赖](https://github.com/CarmJos/MoeTeleport/network/dependencies)
|
||||||
|
|
||||||
- **[必须]** 插件本体基于 [Spigot-API](https://hub.spigotmc.org/stash/projects/SPIGOT) 、[BukkitAPI](http://bukkit.org/) 实现。
|
- **[必须]** 插件本体基于 [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/) 实现。
|
- **[推荐]** 变量部分基于 [PlaceholderAPI](https://www.spigotmc.org/resources/6245/) 实现。
|
||||||
|
|
||||||
详细依赖列表可见 [Dependencies](https://github.com/CarmJos/MoeTeleport/network/dependencies) 。
|
详细依赖列表可见 [Dependencies](https://github.com/CarmJos/MoeTeleport/network/dependencies) 。
|
||||||
@@ -28,6 +30,10 @@
|
|||||||
- 可选参数 `[参数]`
|
- 可选参数 `[参数]`
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
# /MoeTeleport reload
|
||||||
|
@ 管理指令 (MoeTeleport.admin)
|
||||||
|
- 重载插件配置文件。
|
||||||
|
|
||||||
# /back
|
# /back
|
||||||
- 返回上一个传送地点
|
- 返回上一个传送地点
|
||||||
|
|
||||||
@@ -60,7 +66,9 @@
|
|||||||
|
|
||||||
### 消息配置文件 ([messages.yml](src/main/resources/messages.yml))
|
### 消息配置文件 ([messages.yml](src/main/resources/messages.yml))
|
||||||
|
|
||||||
详见源文件。
|
支持 [MineDown 语法](https://wiki.phoenix616.dev/library:minedown:syntax),详见源文件。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 玩家数据配置文件 (data/\<UUID\>.yml)
|
### 玩家数据配置文件 (data/\<UUID\>.yml)
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<groupId>cc.carm.plugin</groupId>
|
<groupId>cc.carm.plugin</groupId>
|
||||||
<artifactId>moeteleport</artifactId>
|
<artifactId>moeteleport</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>2.0.0</version>
|
||||||
|
|
||||||
<name>MoeTeleport</name>
|
<name>MoeTeleport</name>
|
||||||
<description>喵喵传送,简单的传送、设置家的插件。</description>
|
<description>喵喵传送,简单的传送、设置家的插件。</description>
|
||||||
@@ -71,6 +71,11 @@
|
|||||||
<url>https://repo1.maven.org/maven2/</url>
|
<url>https://repo1.maven.org/maven2/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
|
<repository>
|
||||||
|
<id>minebench-repo</id>
|
||||||
|
<url>https://repo.minebench.de/</url>
|
||||||
|
</repository>
|
||||||
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>github</id>
|
<id>github</id>
|
||||||
<name>GitHub Packages</name>
|
<name>GitHub Packages</name>
|
||||||
@@ -103,6 +108,13 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>de.themoep</groupId>
|
||||||
|
<artifactId>minedown</artifactId>
|
||||||
|
<version>1.7.1-SNAPSHOT</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
@@ -176,6 +188,12 @@
|
|||||||
</excludes>
|
</excludes>
|
||||||
</filter>
|
</filter>
|
||||||
</filters>
|
</filters>
|
||||||
|
<relocations>
|
||||||
|
<relocation>
|
||||||
|
<pattern>de.themoep.minedown</pattern>
|
||||||
|
<shadedPattern>cc.carm.plugin.moeteleport.lib.minedown</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
</relocations>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package cc.carm.plugin.moeteleport;
|
package cc.carm.plugin.moeteleport;
|
||||||
|
|
||||||
import cc.carm.plugin.moeteleport.command.BackCommand;
|
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.HomeNameCompleter;
|
||||||
import cc.carm.plugin.moeteleport.command.completer.PlayerNameCompleter;
|
import cc.carm.plugin.moeteleport.command.completer.PlayerNameCompleter;
|
||||||
import cc.carm.plugin.moeteleport.command.completer.TpRequestCompleter;
|
import cc.carm.plugin.moeteleport.command.completer.TpRequestCompleter;
|
||||||
@@ -13,7 +14,6 @@ import cc.carm.plugin.moeteleport.command.tpa.TpaCommand;
|
|||||||
import cc.carm.plugin.moeteleport.listener.UserListener;
|
import cc.carm.plugin.moeteleport.listener.UserListener;
|
||||||
import cc.carm.plugin.moeteleport.manager.ConfigManager;
|
import cc.carm.plugin.moeteleport.manager.ConfigManager;
|
||||||
import cc.carm.plugin.moeteleport.manager.RequestManager;
|
import cc.carm.plugin.moeteleport.manager.RequestManager;
|
||||||
import cc.carm.plugin.moeteleport.manager.TeleportManager;
|
|
||||||
import cc.carm.plugin.moeteleport.manager.UserManager;
|
import cc.carm.plugin.moeteleport.manager.UserManager;
|
||||||
import cc.carm.plugin.moeteleport.model.UserData;
|
import cc.carm.plugin.moeteleport.model.UserData;
|
||||||
import cc.carm.plugin.moeteleport.util.ColorParser;
|
import cc.carm.plugin.moeteleport.util.ColorParser;
|
||||||
@@ -32,7 +32,6 @@ public class Main extends JavaPlugin {
|
|||||||
public static boolean debugMode = true;
|
public static boolean debugMode = true;
|
||||||
private static Main instance;
|
private static Main instance;
|
||||||
private UserManager userManager;
|
private UserManager userManager;
|
||||||
private TeleportManager teleportManager;
|
|
||||||
private RequestManager requestManager;
|
private RequestManager requestManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -111,6 +110,8 @@ public class Main extends JavaPlugin {
|
|||||||
regListener(new UserListener());
|
regListener(new UserListener());
|
||||||
|
|
||||||
log("注册指令...");
|
log("注册指令...");
|
||||||
|
registerCommand("MoeTeleport", new MoeTeleportCommand());
|
||||||
|
|
||||||
registerCommand("back", new BackCommand());
|
registerCommand("back", new BackCommand());
|
||||||
|
|
||||||
registerCommand("home", new GoHomeCommand(), new HomeNameCompleter());
|
registerCommand("home", new GoHomeCommand(), new HomeNameCompleter());
|
||||||
@@ -132,8 +133,13 @@ public class Main extends JavaPlugin {
|
|||||||
log(getName() + " " + getDescription().getVersion() + " 开始卸载...");
|
log(getName() + " " + getDescription().getVersion() + " 开始卸载...");
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
|
|
||||||
|
log("关闭所有请求...");
|
||||||
getRequestManager().shutdown();
|
getRequestManager().shutdown();
|
||||||
|
|
||||||
|
log("保存用户数据...");
|
||||||
|
getUserManager().getUserDataMap().values().forEach(UserData::save);
|
||||||
|
getUserManager().getUserDataMap().clear();
|
||||||
|
|
||||||
log("卸载监听器...");
|
log("卸载监听器...");
|
||||||
Bukkit.getServicesManager().unregisterAll(this);
|
Bukkit.getServicesManager().unregisterAll(this);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package cc.carm.plugin.moeteleport.command;
|
||||||
|
|
||||||
|
import cc.carm.plugin.moeteleport.manager.ConfigManager;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
public class MoeTeleportCommand implements CommandExecutor {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command,
|
||||||
|
@NotNull String s, @NotNull String[] args) {
|
||||||
|
if (args[0].equalsIgnoreCase("reload")) {
|
||||||
|
commandSender.sendMessage("Reloading config...");
|
||||||
|
ConfigManager.reload();
|
||||||
|
commandSender.sendMessage("Config reloaded.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -53,8 +53,7 @@ public class TeleportManager {
|
|||||||
return false; // not transparent (will suffocate)
|
return false; // not transparent (will suffocate)
|
||||||
}
|
}
|
||||||
Block ground = leg.getRelative(BlockFace.DOWN);
|
Block ground = leg.getRelative(BlockFace.DOWN);
|
||||||
return ground.getType().isSolid()
|
return !PluginConfig.DANGEROUS_TYPES.get().contains(ground.getType().name());
|
||||||
&& !PluginConfig.DANGEROUS_TYPES.get().contains(ground.getType().name());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cc.carm.plugin.moeteleport.util;
|
package cc.carm.plugin.moeteleport.util;
|
||||||
|
|
||||||
|
import de.themoep.minedown.MineDown;
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@@ -17,7 +18,7 @@ public class MessageUtil {
|
|||||||
public static void send(@Nullable CommandSender sender, List<String> messages) {
|
public static void send(@Nullable CommandSender sender, List<String> messages) {
|
||||||
if (messages == null || messages.isEmpty() || sender == null) return;
|
if (messages == null || messages.isEmpty() || sender == null) return;
|
||||||
for (String s : messages) {
|
for (String s : messages) {
|
||||||
sender.sendMessage(ColorParser.parse(s));
|
sender.spigot().sendMessage(MineDown.parse(s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ not-online:
|
|||||||
- "&f目标玩家并不在线,无法发送请求。"
|
- "&f目标玩家并不在线,无法发送请求。"
|
||||||
tpa:
|
tpa:
|
||||||
- "&d%(player) &f请求传送到您身边,您有 &5%(expire)秒 &f的时间回应。"
|
- "&d%(player) &f请求传送到您身边,您有 &5%(expire)秒 &f的时间回应。"
|
||||||
- "&a&l[同意] &f输入 &5/tpaccept &f同意该请求。"
|
- "[&a&l[同意]](show_text=点击同意请求 run_command=/tpAccept %(player)) &f输入 &5/tpAccept &f同意该请求。"
|
||||||
- "&c&l[拒绝] &f输入 &5/tpdeny &f拒绝该请求。"
|
- "[&c&l[拒绝]](show_text=点击拒绝请求 run_command=/tpDeny %(player)) &f输入 &5/tpDeny &f拒绝该请求。"
|
||||||
tpahere:
|
tpahere:
|
||||||
- "&d%(player) &f请求传送您到Ta身边,您有 &5%(expire)秒 &f的时间回应。"
|
- "&d%(player) &f请求传送您到Ta身边,您有 &5%(expire)秒 &f的时间回应。"
|
||||||
- "&a&l[同意] &f输入 &5/tpaccept &f同意该请求。"
|
- "[&a&l[同意]](show_text=点击同意请求 run_command=/tpAccept %(player)) &f输入 &5/tpAccept &f同意该请求。"
|
||||||
- "&c&l[拒绝] &f输入 &5/tpdeny &f拒绝该请求。"
|
- "[&c&l[拒绝]](show_text=点击拒绝请求 run_command=/tpDeny %(player)) &f输入 &5/tpDeny &f拒绝该请求。"
|
||||||
tpaccept:
|
tpaccept:
|
||||||
- "&f您同意了 &d%(player) &f的传送请求。"
|
- "&f您同意了 &d%(player) &f的传送请求。"
|
||||||
tpdeny:
|
tpdeny:
|
||||||
@@ -38,7 +38,7 @@ no-request-player:
|
|||||||
- "&f您当前没有收到来自 &d%(player) &f的传送请求。"
|
- "&f您当前没有收到来自 &d%(player) &f的传送请求。"
|
||||||
multi-requests:
|
multi-requests:
|
||||||
- "&f您当前有&d%(num)条请求&f待处理,请输入 &5/%(command) <玩家名> &f决定回应谁的请求。"
|
- "&f您当前有&d%(num)条请求&f待处理,请输入 &5/%(command) <玩家名> &f决定回应谁的请求。"
|
||||||
- "&f您也可以再次输入 &5/%(command) &f直接回应最近的一条请求。"
|
- "&f您也可以再次输入 &5/%(command) &f快速回应最近的一条请求。"
|
||||||
request-sent-timeout:
|
request-sent-timeout:
|
||||||
- "&f发往 &d%(player) &f的传送请求已超时。"
|
- "&f发往 &d%(player) &f的传送请求已超时。"
|
||||||
request-received-timeout:
|
request-received-timeout:
|
||||||
@@ -48,13 +48,13 @@ teleporting:
|
|||||||
dangerous:
|
dangerous:
|
||||||
- "&f目标地点不安全,传送被取消。"
|
- "&f目标地点不安全,传送被取消。"
|
||||||
dangerous-here:
|
dangerous-here:
|
||||||
- "&f当前地点不安全,无法发送传送请求。"
|
- "&f当前地点不安全,传送被取消。"
|
||||||
notAvailable:
|
notAvailable:
|
||||||
- "&f目标地点暂时无法前往,传送被取消。"
|
- "&f目标地点暂时无法前往,传送被取消。"
|
||||||
|
|
||||||
home-list-header:
|
home-list-header:
|
||||||
- "&f您当前设定的所有家:"
|
- "&f您当前设定的所有家:"
|
||||||
home-list-object: "&8#&f%(id) &d%(location)"
|
home-list-object: "&8# &f%(id) &d%(location) [&7✈](show_text=点击返回家 %(id) run_command=/home %(id))"
|
||||||
home-not-found:
|
home-not-found:
|
||||||
- "&f您还没有设置这个家,请先输入 &5/setHome <家名称> &f设置一个吧!"
|
- "&f您还没有设置这个家,请先输入 &5/setHome <家名称> &f设置一个吧!"
|
||||||
home-set:
|
home-set:
|
||||||
|
|||||||
@@ -13,7 +13,16 @@ permissions:
|
|||||||
description: "插件的主权限节点"
|
description: "插件的主权限节点"
|
||||||
default: false
|
default: false
|
||||||
|
|
||||||
|
"MoeTeleport.admin":
|
||||||
|
description: "插件的管理员权限节点"
|
||||||
|
default: op
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
|
"MoeTeleport":
|
||||||
|
description: "插件的主命令,用于重载插件或查看插件信息。"
|
||||||
|
permission: "MoeTeleport.admin"
|
||||||
|
usage: "/MoeTeleport reload"
|
||||||
|
|
||||||
"back":
|
"back":
|
||||||
description: 返回传送前的上一个地点。
|
description: 返回传送前的上一个地点。
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user