diff --git a/.github/ISSUE_TEMPLATE/bugs_report.md b/.github/ISSUE_TEMPLATE/bugs_report.md new file mode 100644 index 0000000..e163a00 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bugs_report.md @@ -0,0 +1,30 @@ +--- +name: 问题提交 +about: 提交并描述问题,帮助我们对其进行检查与修复。 +title: '' +labels: bug +assignees: '' + +--- + +**问题简述** +用简短的话语描述一下大概问题。 + +**问题来源** +描述一下通过哪些操作才发现的问题,如: +1. 打开 '...' +2. 点击了 '....' +3. 出现了报错 '....' + +**预期结果**(可选) +如果问题不发生,应该是什么情况 + +**问题截图/问题报错** +如果有报错或输出,请提供截图。 + +**操作环境** +请在后台输入 `version` 并复制相关输出。 + + +**其他补充** +如有其他补充,可以在这里描述。 diff --git a/.github/ISSUE_TEMPLATE/feature_issues.md b/.github/ISSUE_TEMPLATE/feature_issues.md new file mode 100644 index 0000000..b7e7f40 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_issues.md @@ -0,0 +1,20 @@ +--- +name: 功能需求 +about: 希望我们提供更多的功能。 +title: '' +labels: enhancement +assignees: '' + +--- + +**功能简述** +简单的描述一下你想要的功能 + +**需求来源** +简单的描述一下为什么需要这个功能。 + +**功能参考**(可选) +如果有相关功能的参考,如文本、截图,请提供给我们。 + +**附加内容** +如果有什么小细节需要重点注意,请在这里告诉我们。 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..925646b --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,42 @@ +# 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 + +name: Maven + +on: + # 支持手动触发构建 + workflow_dispatch: + release: + # 创建release的时候触发 + types: [ published ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: "Set up JDK" + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + cache: maven + server-id: github + # Nexus用户名环境变量 + server-username: MAVEN_USERNAME + # Nexus密码环境变量 + server-password: MAVEN_TOKEN + - name: "Package & Deploy" + run: mvn -B deploy --file pom.xml + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: "Stage" + run: mkdir staging && cp target/*.jar staging + - name: "Upload artifact" + uses: actions/upload-artifact@v2 + with: + name: artifact + path: staging \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5718d29..5aeee26 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /.idea/ /*/target/ -/*/.iml \ No newline at end of file +/*/*.iml +*.iml \ No newline at end of file diff --git a/2b2t-common/pom.xml b/2b2t-common/pom.xml index 96a897e..94a9947 100644 --- a/2b2t-common/pom.xml +++ b/2b2t-common/pom.xml @@ -3,35 +3,41 @@ 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"> - cn2b2t org.cn2b2t + cn2b2t-parent 1.0-SNAPSHOT 4.0.0 2b2t-common jar - - - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - - - - org.spigotmc - spigot - 1.12.2-R0.1-SNAPSHOT - ${basedir}/../_lib/spigot.jar - system + ${project.groupId} + 2b2t-core + ${project.version} + provided + + + me.clip + placeholderapi + provided + + + + com.comphenix.protocol + ProtocolLib + provided + + + + com.comphenix.packetwrapper + PacketWrapper + provided + + com.mcpay McPay @@ -40,11 +46,23 @@ system - - org.cn2b2t - 2b2t-core - 1.0-SNAPSHOT - + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-shade-plugin + + + + \ No newline at end of file diff --git a/2b2t-core/pom.xml b/2b2t-core/pom.xml index bb6c2ad..e80f6f6 100644 --- a/2b2t-core/pom.xml +++ b/2b2t-core/pom.xml @@ -2,31 +2,20 @@ + - cn2b2t org.cn2b2t + cn2b2t-parent 1.0-SNAPSHOT + 4.0.0 2b2t-core jar - - - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - - - - - + cn.moci McPay @@ -34,36 +23,48 @@ system ${basedir}/../_lib/McPay-obf-2.0.0-alpha-b92.jar - - com.comphenix - ProtocolLib - 4.3.0 - system - ${basedir}/../_lib/ProtocolLib.jar - - - com.comphenix - PacketWrapper - 1.0 - system - ${basedir}/../_lib/PacketWrapper.jar - org.spigotmc spigot - 1.12.2-R0.1-SNAPSHOT - ${basedir}/../_lib/spigot.jar - system - - - org.cn2b2t - 2b2t-proxy - 1.0-SNAPSHOT - compile + provided + + me.clip + placeholderapi + provided + + + + com.comphenix.protocol + ProtocolLib + provided + + + + com.comphenix.packetwrapper + PacketWrapper + provided + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-shade-plugin + + + + \ No newline at end of file diff --git a/2b2t-death/pom.xml b/2b2t-death/pom.xml index 321c11f..ab3a1ae 100644 --- a/2b2t-death/pom.xml +++ b/2b2t-death/pom.xml @@ -3,52 +3,62 @@ 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"> - cn2b2t org.cn2b2t + cn2b2t-parent 1.0-SNAPSHOT 4.0.0 2b2t-death jar + + + + + org.spigotmc + spigot + provided + + + + ${project.groupId} + 2b2t-core + ${project.version} + provided + + + + ${project.groupId} + 2b2t-common + ${project.version} + provided + + + + ${project.groupId} + 2b2t-logger + ${project.version} + provided + + + + org.apache.maven.plugins maven-compiler-plugin - - 8 - 8 - + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-shade-plugin - - - org.spigotmc - spigot - 1.12.2-R0.1-SNAPSHOT - ${basedir}/../_lib/spigot.jar - system - - - - org.cn2b2t - 2b2t-core - 1.0-SNAPSHOT - - - org.cn2b2t - 2b2t-common - 1.0-SNAPSHOT - - - org.cn2b2t - 2b2t-logger - 1.0-SNAPSHOT - - - \ No newline at end of file diff --git a/2b2t-faction/pom.xml b/2b2t-faction/pom.xml deleted file mode 100644 index 6f844f5..0000000 --- a/2b2t-faction/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - cn2b2t - org.cn2b2t - 1.0-SNAPSHOT - - 4.0.0 - - - 2b2t-faction - - - \ No newline at end of file diff --git a/2b2t-logger/pom.xml b/2b2t-logger/pom.xml index da6e58f..2d6c6b6 100644 --- a/2b2t-logger/pom.xml +++ b/2b2t-logger/pom.xml @@ -3,45 +3,54 @@ 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"> - cn2b2t org.cn2b2t + cn2b2t-parent 1.0-SNAPSHOT 4.0.0 2b2t-logger jar + + + + + ${project.groupId} + 2b2t-core + ${project.version} + provided + + + + ${project.groupId} + 2b2t-common + ${project.version} + provided + + + + org.spigotmc + spigot + provided + + + + org.apache.maven.plugins maven-compiler-plugin - - 8 - 8 - + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-shade-plugin - - - org.spigotmc - spigot - 1.12.2-R0.1-SNAPSHOT - ${basedir}/../_lib/spigot.jar - system - - - org.cn2b2t - 2b2t-core - 1.0-SNAPSHOT - - - org.cn2b2t - 2b2t-common - 1.0-SNAPSHOT - - - \ No newline at end of file diff --git a/2b2t-proxy/pom.xml b/2b2t-proxy/pom.xml index bae1a66..c8f789b 100644 --- a/2b2t-proxy/pom.xml +++ b/2b2t-proxy/pom.xml @@ -3,26 +3,14 @@ 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"> - cn2b2t org.cn2b2t + cn2b2t-parent 1.0-SNAPSHOT 4.0.0 2b2t-proxy jar - - - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - - - @@ -34,4 +22,21 @@ + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-shade-plugin + + + + \ No newline at end of file diff --git a/2b2t-spawn/pom.xml b/2b2t-spawn/pom.xml index f96323b..41fdd40 100644 --- a/2b2t-spawn/pom.xml +++ b/2b2t-spawn/pom.xml @@ -3,46 +3,55 @@ 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"> - cn2b2t org.cn2b2t + cn2b2t-parent 1.0-SNAPSHOT + 4.0.0 2b2t-spawn jar + + + + ${project.groupId} + 2b2t-core + ${project.version} + provided + + + + ${project.groupId} + 2b2t-common + ${project.version} + provided + + + + org.spigotmc + spigot + provided + + + + org.apache.maven.plugins maven-compiler-plugin - - 8 - 8 - + + + org.apache.maven.plugins + maven-jar-plugin + + + org.apache.maven.plugins + maven-shade-plugin - - - org.spigotmc - spigot - 1.12.2-R0.1-SNAPSHOT - ${basedir}/../_lib/spigot.jar - system - - - - org.cn2b2t - 2b2t-core - 1.0-SNAPSHOT - - - org.cn2b2t - 2b2t-common - 1.0-SNAPSHOT - - \ No newline at end of file diff --git a/ImperialGuards/pom.xml b/ImperialGuards/pom.xml deleted file mode 100644 index facc059..0000000 --- a/ImperialGuards/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - cn2b2t - org.cn2b2t - 1.0-SNAPSHOT - - 4.0.0 - - ImperialGuards - jar - - - - org.apache.maven.plugins - maven-compiler-plugin - - 8 - 8 - - - - - - - - - com.comphenix - ProtocolLib - 4.3.0 - system - ${basedir}/../_lib/ProtocolLib.jar - - - com.comphenix - PacketWrapper - 1.0 - system - ${basedir}/../_lib/PacketWrapper.jar - - - - org.spigotmc - spigot - 1.12.2-R0.1-SNAPSHOT - ${basedir}/../_lib/spigot.jar - system - - - org.cn2b2t - 2b2t-core - 1.0-SNAPSHOT - compile - - - org.cn2b2t - 2b2t-logger - 1.0-SNAPSHOT - compile - - - org.cn2b2t - 2b2t-logger - 1.0-SNAPSHOT - compile - - - org.cn2b2t - 2b2t-logger - 1.0-SNAPSHOT - compile - - - - - \ No newline at end of file diff --git a/ImperialGuards/src/main/java/cn/moci/ig/Main.java b/ImperialGuards/src/main/java/cn/moci/ig/Main.java deleted file mode 100644 index 46dc8ca..0000000 --- a/ImperialGuards/src/main/java/cn/moci/ig/Main.java +++ /dev/null @@ -1,46 +0,0 @@ -package cn.moci.ig; - -import cn.moci.ig.commands.IG; -import com.comphenix.protocol.ProtocolLibrary; -import com.comphenix.protocol.ProtocolManager; -import org.bukkit.ChatColor; -import org.bukkit.plugin.java.JavaPlugin; - -public class Main extends JavaPlugin { - - // - public static String pluginName = "ImperialGuards"; - public static String pluginVersion = "dev-SNAPSHOT"; - - private static Main instance; - public ProtocolManager protocolManager; - - public static Main getInstance() { - return Main.instance; - } - - public static String color(final String text) { - return text.replaceAll("&", "§"); - } - - private void pluginMessage(String s) { - this.getServer().getConsoleSender().sendMessage(ChatColor.DARK_GRAY + "[" + ChatColor.RED + "!" + ChatColor.DARK_GRAY + "] " + ChatColor.AQUA + pluginName + " " + ChatColor.WHITE + pluginVersion + ChatColor.GRAY + s); - } - - // - @Override - public void onEnable() { - protocolManager = ProtocolLibrary.getProtocolManager(); - Main.instance = this; - regCmds(); - pluginMessage("已启用。"); - - } - - - private void regCmds() { - this.getCommand("ig").setExecutor(new IG()); - } - - -} diff --git a/ImperialGuards/src/main/java/cn/moci/ig/commands/IG.java b/ImperialGuards/src/main/java/cn/moci/ig/commands/IG.java deleted file mode 100644 index 80df61a..0000000 --- a/ImperialGuards/src/main/java/cn/moci/ig/commands/IG.java +++ /dev/null @@ -1,68 +0,0 @@ -package cn.moci.ig.commands; - -import org.bukkit.Bukkit; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.cn2b2t.core.managers.utils.ServersManager; -import org.cn2b2t.core.utils.ColorParser; -import org.cn2b2t.logger.managers.LoggerManager; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 最终解释权归 墨瓷工作室 。 - * - * @author Cam, LSeng. - */ -public class IG implements CommandExecutor { - - public static List queue = new ArrayList<>(); - - @Override - public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { - if (sender instanceof Player) { - return true; - } // /IG condition KUMR killaura 1000 5 -1 Hitbox(Killaura) kick %(Player) #ac Task #00001 for IG generated an exception; - if (args.length < 1) { - return true; - } - switch (args[0]) { - case "notify": { - // /IG notify {player} HackType - if (args.length < 2) { - return true; - } - String username = args[1]; - String reason = Arrays.stream(args, 2, args.length - 1).collect(Collectors.joining()); - LoggerManager.writeIn(Bukkit.getOfflinePlayer(username).getUniqueId(), username, Bukkit.getServer().getPort(), LoggerManager.LogType.AC, reason); - return true; - } - case "punish": { - // /IG punish {player} HackType - String username = args[1]; - if (Bukkit.getPlayer(username) != null) { - Player p = Bukkit.getPlayer(username); - if (!p.hasPermission("ig.bypass")) { - ServersManager.goAFK(p); - for (Player onlinePlayer : Bukkit.getOnlinePlayers()) { - onlinePlayer.sendMessage(ColorParser.parse("&7玩家 &f" + p.getName() + " &7因&c疑似作弊&7被移出本局游戏。")); - onlinePlayer.sendMessage(ColorParser.parse("&7保持良好游戏环境需要各位的努力,感谢各位的支持。")); - } - } - } - - return true; - } - default: { - return true; - } - - } - } - -} diff --git a/ImperialGuards/src/main/resources/plugin.yml b/ImperialGuards/src/main/resources/plugin.yml deleted file mode 100644 index c77a3ef..0000000 --- a/ImperialGuards/src/main/resources/plugin.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: ImperialGuards -main: cn.moci.ig.Main -version: 1.0.0 - SNAPSHOT -author: Moci -depend: [ProtocolLib] -commands: - ig: - aliases: [imperialguards] \ No newline at end of file diff --git a/_img/2b2t.png b/_img/2b2t.png new file mode 100644 index 0000000..5e1f62c Binary files /dev/null and b/_img/2b2t.png differ diff --git a/_lib/BungeeTabListPlus_BukkitBridge-3.2.2.jar b/_lib/BungeeTabListPlus_BukkitBridge-3.2.2.jar deleted file mode 100644 index a2be685..0000000 Binary files a/_lib/BungeeTabListPlus_BukkitBridge-3.2.2.jar and /dev/null differ diff --git a/_lib/FastAsyncWorldEdite.jar b/_lib/FastAsyncWorldEdite.jar deleted file mode 100644 index 8ddf150..0000000 Binary files a/_lib/FastAsyncWorldEdite.jar and /dev/null differ diff --git a/_lib/PacketWrapper.jar b/_lib/PacketWrapper.jar deleted file mode 100644 index e67c3a1..0000000 Binary files a/_lib/PacketWrapper.jar and /dev/null differ diff --git a/_lib/PlaceholderAPI-2.10.5.jar b/_lib/PlaceholderAPI-2.10.5.jar deleted file mode 100644 index 5b39441..0000000 Binary files a/_lib/PlaceholderAPI-2.10.5.jar and /dev/null differ diff --git a/_lib/ProtocolLib.jar b/_lib/ProtocolLib.jar deleted file mode 100644 index 5056a18..0000000 Binary files a/_lib/ProtocolLib.jar and /dev/null differ diff --git a/_lib/spigot.jar b/_lib/spigot.jar deleted file mode 100644 index de50a4e..0000000 Binary files a/_lib/spigot.jar and /dev/null differ diff --git a/pom.xml b/pom.xml index ff8c7df..17ecdde 100644 --- a/pom.xml +++ b/pom.xml @@ -5,36 +5,246 @@ 4.0.0 org.cn2b2t - cn2b2t - pom + cn2b2t-parent 1.0-SNAPSHOT + pom - ImperialGuards 2b2t-common 2b2t-core - 2b2t-faction 2b2t-proxy 2b2t-death 2b2t-spawn 2b2t-logger + cn2b2t.org + cn2b2t相关代码,用于实现一些基础的功能。 + https://github.com/CarmJos/cn2b2t-paren + + + GitHub Issues + https://github.com/CarmJos/cn2b2t-parent/issues + + + + GitHub Actions + https://github.com/CarmJos/cn2b2t-parent/actions/workflows/maven.yml + + + + + CarmJos + Carm Jos + carm@carm.cc + + Main Developer + + https://work.carm.cc + + + + + + GNU General Public License v3.0 + https://opensource.org/licenses/GPL-3.0 + + + + 8 + 8 UTF-8 + UTF-8 + + + + spigotmc-repo + https://hub.spigotmc.org/nexus/content/repositories/public/ + + + + placeholder-api-repo + https://repo.extendedclip.com/content/repositories/placeholderapi/ + + + + lss233-repo + https://lss233.littleservice.cn/repositories/minecraft + + + + oss-repo + https://oss.sonatype.org/content/groups/public/ + + + + maven-central + https://repo1.maven.org/maven2/ + + + + + + + github + GitHub Packages + https://maven.pkg.github.com/CarmJos/2b2t-parent + + + + + + + + junit + junit + 4.13 + test + + + + + + + + + org.spigotmc + spigot + 1.12-R0.1-SNAPSHOT + + + + me.clip + placeholderapi + 2.10.9 + + + + com.comphenix.protocol + ProtocolLib + 4.5.0 + + + + com.comphenix.packetwrapper + PacketWrapper + 1.13-R0.1-SNAPSHOT + + + + + + + org.apache.maven.plugins - maven-compiler-plugin + maven-surefire-plugin + 2.22.1 - 8 - 8 + false + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + javadoc + + https://javadoc.io/doc/org.jetbrains/annotations/ + + true + UTF-8 + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + -parameters + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + org.apache.maven.plugins + maven-source-plugin + 3.2.0 + + + package + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.3 + + + package + + shade + + + false + + + + + + + *:* + + META-INF/MANIFEST.MF + META-INF/*.txt + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.1 + + false + + + + + + + src/main/resources + true + +