├── version.txt
├── tool_version.txt
├── folia
├── folia-1.21.4
│ └── support_version.txt
└── origin
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── src
│ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── github
│ │ │ └── theword
│ │ │ └── queqiao
│ │ │ ├── command
│ │ │ ├── SpigotSubCommand.java
│ │ │ ├── CommandManager.java
│ │ │ ├── subCommand
│ │ │ │ ├── ReloadCommand.java
│ │ │ │ ├── ServerCommand.java
│ │ │ │ ├── client
│ │ │ │ │ └── ReconnectCommand.java
│ │ │ │ ├── HelpCommand.java
│ │ │ │ └── ClientCommand.java
│ │ │ └── CommandExecutor.java
│ │ │ ├── QueQiao.java
│ │ │ ├── handle
│ │ │ └── HandleCommandReturnMessageImpl.java
│ │ │ └── utils
│ │ │ └── FoliaTool.java
│ │ └── resources
│ │ └── plugin.yml
│ └── gradle.properties
├── paper
├── paper-1.17.1
│ └── support_version.txt
└── origin
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── src
│ └── main
│ │ ├── resources
│ │ └── plugin.yml
│ │ └── java
│ │ └── com
│ │ └── github
│ │ └── theword
│ │ └── queqiao
│ │ ├── command
│ │ ├── PaperSubCommand.java
│ │ ├── CommandManager.java
│ │ ├── subCommand
│ │ │ ├── ReloadCommand.java
│ │ │ ├── ServerCommand.java
│ │ │ ├── client
│ │ │ │ └── ReconnectCommand.java
│ │ │ ├── HelpCommand.java
│ │ │ └── ClientCommand.java
│ │ └── CommandExecutor.java
│ │ ├── handle
│ │ └── HandleCommandReturnMessageImpl.java
│ │ └── QueQiao.java
│ ├── gradle.properties
│ └── gradlew.bat
├── spigot
├── spigot-1.13
│ └── support_version.txt
└── origin
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── src
│ └── main
│ │ ├── resources
│ │ └── plugin.yml
│ │ └── java
│ │ └── com
│ │ └── github
│ │ └── theword
│ │ └── queqiao
│ │ ├── command
│ │ ├── SpigotSubCommand.java
│ │ ├── CommandManager.java
│ │ ├── subCommand
│ │ │ ├── ReloadCommand.java
│ │ │ ├── ServerCommand.java
│ │ │ ├── client
│ │ │ │ └── ReconnectCommand.java
│ │ │ ├── HelpCommand.java
│ │ │ └── ClientCommand.java
│ │ └── CommandExecutor.java
│ │ ├── handle
│ │ └── HandleCommandReturnMessageImpl.java
│ │ ├── QueQiao.java
│ │ └── utils
│ │ └── SpigotTool.java
│ └── gradle.properties
├── velocity
├── velocity-3.4.0
│ └── support_version.txt
├── velocity-3.3.0
│ └── support_version.txt
└── origin
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── src
│ └── main
│ │ ├── templates
│ │ └── com
│ │ │ └── github
│ │ │ └── theword
│ │ │ └── queqiao
│ │ │ └── BuildConstants.java
│ │ └── java
│ │ └── com
│ │ └── github
│ │ └── theword
│ │ └── queqiao
│ │ ├── command
│ │ ├── VelocitySubCommand.java
│ │ ├── CommandManager.java
│ │ └── subCommand
│ │ │ ├── ReloadCommand.java
│ │ │ ├── client
│ │ │ ├── ReconnectCommand.java
│ │ │ └── ReconnectAllCommand.java
│ │ │ └── HelpCommand.java
│ │ ├── utils
│ │ └── VelocityTool.java
│ │ ├── handle
│ │ └── HandleCommandReturnMessageImpl.java
│ │ ├── QueQiao.java
│ │ └── EventProcessor.java
│ ├── build
│ └── generated
│ │ └── sources
│ │ └── templates
│ │ └── com
│ │ └── github
│ │ └── theword
│ │ └── queqiao
│ │ └── BuildConstants.java
│ └── gradle.properties
├── fabric
├── fabric-1.21.9
│ ├── support_version.txt
│ └── gradlew.bat
├── origin
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ ├── src
│ │ └── main
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── github
│ │ │ │ └── theword
│ │ │ │ └── queqiao
│ │ │ │ ├── command
│ │ │ │ ├── FabricSubCommand.java
│ │ │ │ ├── CommandManager.java
│ │ │ │ └── subCommand
│ │ │ │ │ ├── ReloadCommand.java
│ │ │ │ │ ├── client
│ │ │ │ │ ├── ReconnectCommand.java
│ │ │ │ │ └── ReconnectAllCommand.java
│ │ │ │ │ └── HelpCommand.java
│ │ │ │ ├── QueQiao.java
│ │ │ │ ├── mixin
│ │ │ │ ├── PlayerManagerMixin.java
│ │ │ │ ├── ServerPlayNetworkHandlerMixin.java
│ │ │ │ └── ServerPlayerEntityMixin.java
│ │ │ │ └── handle
│ │ │ │ └── HandleCommandReturnMessageImpl.java
│ │ │ └── resources
│ │ │ ├── fabric.mod.json
│ │ │ └── queqiao.mixins.json5
│ └── gradle.properties
├── fabric-1.21.11
│ └── gradlew.bat
└── fabric-1.21
│ └── gradlew.bat
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── enhancement_report.yml
│ ├── version_feature.yml
│ └── bug_report.yml
└── workflows
│ └── release.yml
├── .idea
├── .gitignore
├── vcs.xml
├── modules.xml
├── ModMultiLoaders.xml
└── checkstyle-idea.xml
├── cleanroom
└── origin
│ ├── tags.properties
│ ├── gradle
│ ├── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ └── scripts
│ │ ├── extra.gradle
│ │ └── dependencies.gradle
│ ├── src
│ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── github
│ │ │ └── theword
│ │ │ └── queqiao
│ │ │ ├── package-info.java
│ │ │ ├── command
│ │ │ ├── package-info.java
│ │ │ ├── subCommand
│ │ │ │ ├── package-info.java
│ │ │ │ ├── client
│ │ │ │ │ ├── package-info.java
│ │ │ │ │ └── ReconnectCommand.java
│ │ │ │ ├── ReloadCommand.java
│ │ │ │ └── HelpCommand.java
│ │ │ ├── CommandTreeQueQiao.java
│ │ │ └── ForgeSubCommand.java
│ │ │ ├── handle
│ │ │ └── HandleCommandReturnMessageImpl.java
│ │ │ ├── QueQiao.java
│ │ │ └── utils
│ │ │ └── ForgeTool.java
│ │ └── resources
│ │ ├── queqiao_at.cfg
│ │ └── mcmod.info
│ └── settings.gradle
├── tool
└── ModMultiVersionTool-1.5.7.jar
├── gtnh
└── origin
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── repositories.gradle
│ ├── build.gradle.kts
│ ├── settings.gradle.kts
│ └── src
│ └── main
│ ├── resources
│ ├── mcmod.info
│ └── LICENSE
│ └── java
│ └── com
│ └── github
│ └── theword
│ └── queqiao
│ ├── handle
│ └── HandleCommandReturnMessageImpl.java
│ ├── QueQiao.java
│ └── utils
│ └── ForgeTool.java
├── forge
├── origin
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ ├── src
│ │ └── main
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── github
│ │ │ │ └── theword
│ │ │ │ └── queqiao
│ │ │ │ ├── command
│ │ │ │ ├── ForgeSubCommand.java
│ │ │ │ ├── CommandManager.java
│ │ │ │ ├── subCommand
│ │ │ │ │ ├── ReloadCommand.java
│ │ │ │ │ ├── client
│ │ │ │ │ │ ├── ReconnectCommand.java
│ │ │ │ │ │ └── ReconnectAllCommand.java
│ │ │ │ │ └── HelpCommand.java
│ │ │ │ └── CommandExecutor.java
│ │ │ │ ├── QueQiao.java
│ │ │ │ └── handle
│ │ │ │ └── HandleCommandReturnMessageImpl.java
│ │ │ └── resources
│ │ │ ├── pack.mcmeta.json5
│ │ │ └── META-INF
│ │ │ └── mods.toml
│ └── gradle.properties
├── forge-1.16.5
│ └── gradlew.bat
├── forge-1.18.2
│ └── gradlew.bat
├── forge-1.19.2
│ └── gradlew.bat
└── forge-1.20.1
│ └── gradlew.bat
├── neoforge
└── origin
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── src
│ └── main
│ │ ├── resources
│ │ └── assets
│ │ │ └── queqiao
│ │ │ └── lang
│ │ │ └── en_us.json
│ │ └── java
│ │ └── com
│ │ └── github
│ │ └── theword
│ │ └── queqiao
│ │ ├── command
│ │ ├── NeoForgeSubCommand.java
│ │ ├── CommandManager.java
│ │ ├── subCommand
│ │ │ ├── ReloadCommand.java
│ │ │ ├── client
│ │ │ │ ├── ReconnectCommand.java
│ │ │ │ └── ReconnectAllCommand.java
│ │ │ └── HelpCommand.java
│ │ └── CommandExecutor.java
│ │ ├── QueQiao.java
│ │ ├── handle
│ │ └── HandleCommandReturnMessageImpl.java
│ │ └── utils
│ │ └── NeoForgeTool.java
│ ├── settings.gradle
│ └── gradle.properties
├── vanilla
├── origin
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ ├── src
│ │ └── main
│ │ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── github
│ │ │ │ └── theword
│ │ │ │ └── queqiao
│ │ │ │ ├── config
│ │ │ │ ├── RegexConfig.kt
│ │ │ │ └── Config.kt
│ │ │ │ ├── handle
│ │ │ │ ├── HandleCommandReturnMessageImpl.kt
│ │ │ │ └── HandleApiImpl.kt
│ │ │ │ ├── QueQiao.kt
│ │ │ │ ├── EventProcessor.kt
│ │ │ │ └── utils
│ │ │ │ └── LineProcessor.kt
│ │ │ └── resources
│ │ │ └── regex.yml
│ ├── gradle.properties
│ └── build.gradle
└── vanilla-minecraft
│ └── gradlew.bat
├── init.sh
├── init.ps1
├── QueQiao.iml
├── .devcontainer
└── devcontainer.json
├── .gitignore
├── matrix.ps1
├── LICENSE
├── matrix.sh
└── test_messages.json
/version.txt:
--------------------------------------------------------------------------------
1 | 0.3.7
2 |
--------------------------------------------------------------------------------
/tool_version.txt:
--------------------------------------------------------------------------------
1 | 0.4.7
2 |
--------------------------------------------------------------------------------
/folia/folia-1.21.4/support_version.txt:
--------------------------------------------------------------------------------
1 | [1.21.4,)
--------------------------------------------------------------------------------
/paper/paper-1.17.1/support_version.txt:
--------------------------------------------------------------------------------
1 | [1.17.1,)
--------------------------------------------------------------------------------
/spigot/spigot-1.13/support_version.txt:
--------------------------------------------------------------------------------
1 | [1.13,)
--------------------------------------------------------------------------------
/velocity/velocity-3.4.0/support_version.txt:
--------------------------------------------------------------------------------
1 | [1.20.1]
--------------------------------------------------------------------------------
/fabric/fabric-1.21.9/support_version.txt:
--------------------------------------------------------------------------------
1 | [1.21.9,1.21.10]
--------------------------------------------------------------------------------
/velocity/velocity-3.3.0/support_version.txt:
--------------------------------------------------------------------------------
1 | [1.20.1]
2 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | custom: ["https://afdian.com/a/17TheWord"]
2 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | !/icon.svg
2 | !/ModMultiLoaders.xml
3 | !/modules.xml
4 | !/vcs.xml
5 | /*
--------------------------------------------------------------------------------
/cleanroom/origin/tags.properties:
--------------------------------------------------------------------------------
1 | VERSION = ${mod_version}
2 | MOD_ID = ${mod_id}
3 | MOD_NAME = ${mod_name}
--------------------------------------------------------------------------------
/tool/ModMultiVersionTool-1.5.7.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/17TheWord/QueQiao/HEAD/tool/ModMultiVersionTool-1.5.7.jar
--------------------------------------------------------------------------------
/gtnh/origin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/17TheWord/QueQiao/HEAD/gtnh/origin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/fabric/origin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/17TheWord/QueQiao/HEAD/fabric/origin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/folia/origin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/17TheWord/QueQiao/HEAD/folia/origin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/forge/origin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/17TheWord/QueQiao/HEAD/forge/origin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/paper/origin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/17TheWord/QueQiao/HEAD/paper/origin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/spigot/origin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/17TheWord/QueQiao/HEAD/spigot/origin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/cleanroom/origin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/17TheWord/QueQiao/HEAD/cleanroom/origin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/neoforge/origin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/17TheWord/QueQiao/HEAD/neoforge/origin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/vanilla/origin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/17TheWord/QueQiao/HEAD/vanilla/origin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/velocity/origin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/17TheWord/QueQiao/HEAD/velocity/origin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/vanilla/origin/settings.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
3 | }
4 | rootProject.name = 'minecraft-vanilla'
5 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/neoforge/origin/src/main/resources/assets/queqiao/lang/en_us.json:
--------------------------------------------------------------------------------
1 | {
2 | "itemGroup.queqiao": "Example Mod Tab",
3 | "block.queqiao.example_block": "Example Block",
4 | "item.queqiao.example_item": "Example Item"
5 | }
6 |
--------------------------------------------------------------------------------
/init.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | file=$(find tool -name "ModMultiVersionTool*.jar" | head -n 1)
4 |
5 | if [ -n "$file" ]; then
6 | java -jar "$file"
7 | else
8 | echo "can't find ModMultiVersionTool.jar"
9 | fi
10 |
--------------------------------------------------------------------------------
/fabric/origin/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | maven {
4 | name = 'Fabric'
5 | url = 'https://maven.fabricmc.net/'
6 | }
7 | gradlePluginPortal()
8 | }
9 | }
--------------------------------------------------------------------------------
/init.ps1:
--------------------------------------------------------------------------------
1 | $file = Get-ChildItem -Path "tool" -Filter "ModMultiVersionTool*.jar" | Select-Object -First 1
2 |
3 | if ($file) {
4 | java -jar $file.FullName
5 | } else {
6 | Write-Output "can't find ModMultiVersionTool.jar"
7 | }
8 |
--------------------------------------------------------------------------------
/velocity/origin/src/main/templates/com/github/theword/queqiao/BuildConstants.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao;
2 |
3 | // The constants are replaced before compilation
4 | public class BuildConstants {
5 |
6 | public static final String VERSION = "${version}";
7 | }
8 |
--------------------------------------------------------------------------------
/velocity/origin/build/generated/sources/templates/com/github/theword/queqiao/BuildConstants.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao;
2 |
3 | // The constants are replaced before compilation
4 | public class BuildConstants {
5 |
6 | public static final String VERSION = "0.2.13";
7 | }
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/cleanroom/origin/src/main/java/com/github/theword/queqiao/package-info.java:
--------------------------------------------------------------------------------
1 | @MethodsReturnNonnullByDefault
2 | @ParametersAreNonnullByDefault
3 | package com.github.theword.queqiao;
4 |
5 | import mcp.MethodsReturnNonnullByDefault;
6 |
7 | import javax.annotation.ParametersAreNonnullByDefault;
--------------------------------------------------------------------------------
/cleanroom/origin/src/main/java/com/github/theword/queqiao/command/package-info.java:
--------------------------------------------------------------------------------
1 | @MethodsReturnNonnullByDefault
2 | @ParametersAreNonnullByDefault
3 | package com.github.theword.queqiao.command;
4 |
5 | import mcp.MethodsReturnNonnullByDefault;
6 |
7 | import javax.annotation.ParametersAreNonnullByDefault;
--------------------------------------------------------------------------------
/cleanroom/origin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
--------------------------------------------------------------------------------
/fabric/origin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
--------------------------------------------------------------------------------
/folia/origin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/forge/origin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/gtnh/origin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/neoforge/origin/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | mavenLocal()
4 | gradlePluginPortal()
5 | maven { url = 'https://maven.neoforged.net/releases' }
6 | }
7 | }
8 |
9 | plugins {
10 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
11 | }
12 |
--------------------------------------------------------------------------------
/paper/origin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/spigot/origin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/vanilla/origin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
--------------------------------------------------------------------------------
/neoforge/origin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/velocity/origin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/cleanroom/origin/src/main/java/com/github/theword/queqiao/command/subCommand/package-info.java:
--------------------------------------------------------------------------------
1 | @MethodsReturnNonnullByDefault
2 | @ParametersAreNonnullByDefault
3 | package com.github.theword.queqiao.command.subCommand;
4 |
5 | import mcp.MethodsReturnNonnullByDefault;
6 |
7 | import javax.annotation.ParametersAreNonnullByDefault;
--------------------------------------------------------------------------------
/cleanroom/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/package-info.java:
--------------------------------------------------------------------------------
1 | @MethodsReturnNonnullByDefault
2 | @ParametersAreNonnullByDefault
3 | package com.github.theword.queqiao.command.subCommand.client;
4 |
5 | import mcp.MethodsReturnNonnullByDefault;
6 |
7 | import javax.annotation.ParametersAreNonnullByDefault;
--------------------------------------------------------------------------------
/vanilla/origin/src/main/kotlin/com/github/theword/queqiao/config/RegexConfig.kt:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.config
2 |
3 | import java.util.regex.Pattern
4 |
5 | class RegexConfig(
6 | regex: String,
7 | val playerGroup: Int,
8 | val messageGroup: Int?
9 | ) {
10 | val pattern: Pattern = Pattern.compile(regex)
11 | }
12 |
--------------------------------------------------------------------------------
/cleanroom/origin/src/main/resources/queqiao_at.cfg:
--------------------------------------------------------------------------------
1 | public net.minecraft.advancements.AdvancementRewards field_192115_b # experience
2 | public net.minecraft.advancements.AdvancementRewards field_192116_c # loot
3 | public net.minecraft.advancements.AdvancementRewards field_192117_d # recipes
4 | public net.minecraft.advancements.DisplayInfo field_192301_b # icon
--------------------------------------------------------------------------------
/forge/origin/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | gradlePluginPortal()
4 | maven {
5 | name = 'MinecraftForge'
6 | url = 'https://maven.minecraftforge.net/'
7 | }
8 | }
9 | }
10 |
11 | plugins {
12 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
13 | }
--------------------------------------------------------------------------------
/paper/origin/src/main/resources/plugin.yml:
--------------------------------------------------------------------------------
1 | name: QueQiao
2 | version: '${version}'
3 | main: "com.github.theword.queqiao.QueQiao"
4 | api-version: ${api_version}
5 | load: STARTUP
6 | author: ${author}
7 | description: ${description}
8 | website: ${website}
9 | commands:
10 | queqiao:
11 | description: 鹊桥命令
12 | permission: queqiao
13 | permission-message: 您没有执行命令的权限
14 |
--------------------------------------------------------------------------------
/spigot/origin/src/main/resources/plugin.yml:
--------------------------------------------------------------------------------
1 | name: QueQiao
2 | version: ${version}
3 | main: com.github.theword.queqiao.QueQiao
4 | api-version: ${api_version}
5 | authors: [ 17TheWord ]
6 | description: ${description}
7 | website: https://github.com/17TheWord/QueQiao
8 | commands:
9 | queqiao:
10 | description: 鹊桥命令
11 | permission: queqiao
12 | permission-message: 您没有执行命令的权限
--------------------------------------------------------------------------------
/vanilla/origin/src/main/resources/regex.yml:
--------------------------------------------------------------------------------
1 | log_path: ".\\logs\\latest.log"
2 |
3 | # 以下正则均为原版示例
4 |
5 | chat_regex:
6 | - regex: "(.*)]:(.*)<(.*)> (.*)"
7 | player_group: 3
8 | message_group: 4
9 |
10 | join_regex:
11 | - regex: "Server thread/INFO]: (.*) joined the game"
12 | player_group: 1
13 |
14 | quit_regex:
15 | - regex: "Server thread/INFO]: (.*) left the game"
16 | player_group: 1
17 |
--------------------------------------------------------------------------------
/gtnh/origin/repositories.gradle:
--------------------------------------------------------------------------------
1 | // Add any additional repositories for your dependencies here.
2 |
3 | repositories {
4 | mavenLocal()
5 | maven {
6 | name = " GitHub Packages"
7 | url = uri(project.properties["maven_repository_url"] as String)
8 | credentials {
9 | username = System.getenv("GH_USERNAME")
10 | password = System.getenv("PACKAGE_READ_ONLY_TOKEN")
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/neoforge/origin/src/main/java/com/github/theword/queqiao/command/NeoForgeSubCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.mojang.brigadier.context.CommandContext;
4 | import net.minecraft.commands.CommandSourceStack;
5 |
6 | public interface NeoForgeSubCommand {
7 |
8 | String getName();
9 | String getDescription();
10 | String getUsage();
11 |
12 | int onCommand(CommandContext context);
13 | }
14 |
--------------------------------------------------------------------------------
/cleanroom/origin/src/main/resources/mcmod.info:
--------------------------------------------------------------------------------
1 | [{
2 | "modid": "${mod_id}",
3 | "name": "${mod_name}",
4 | "version": "${mod_version}",
5 | "mcversion": "1.12.2",
6 | "description": "${mod_description}",
7 | "authorList": ["${mod_authors}"],
8 | "credits": "${mod_credits}",
9 | "url": "${mod_url}",
10 | "updateUrl": "${mod_update_json}",
11 | "logoFile": "${mod_logo_path}",
12 | "serverSideOnly": true,
13 | "clientSideOnly": false,
14 | "requiredOnClient": false
15 | }]
--------------------------------------------------------------------------------
/cleanroom/origin/gradle/scripts/extra.gradle:
--------------------------------------------------------------------------------
1 | // You may write any gradle buildscript component in this file
2 | // This file is automatically applied after build.gradle + dependencies.gradle is ran
3 |
4 | // If you wish to use the default helper methods, uncomment the line below
5 | // apply from: 'gradle/scripts/helpers.gradle'
6 |
7 |
8 | task printTokens {
9 | doLast {
10 | println System.getenv('CURSEFORGE_TOKEN')
11 | println System.getenv('MODRINTH_TOKEN')
12 | }
13 | }
--------------------------------------------------------------------------------
/vanilla/origin/src/main/kotlin/com/github/theword/queqiao/handle/HandleCommandReturnMessageImpl.kt:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.handle
2 |
3 | import com.github.theword.queqiao.tool.handle.HandleCommandReturnMessageService
4 |
5 | class HandleCommandReturnMessageImpl : HandleCommandReturnMessageService() {
6 | override fun handleCommandReturnMessage(o: Any, s: String) {
7 | }
8 |
9 | override fun hasPermission(o: Any, s: String): Boolean {
10 | return false
11 | }
12 | }
--------------------------------------------------------------------------------
/velocity/origin/src/main/java/com/github/theword/queqiao/command/VelocitySubCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.github.theword.queqiao.tool.command.SubCommand;
4 | import com.mojang.brigadier.context.CommandContext;
5 | import com.velocitypowered.api.command.CommandSource;
6 | import com.velocitypowered.api.command.SimpleCommand;
7 |
8 | public interface VelocitySubCommand extends SubCommand {
9 |
10 | int onCommand(SimpleCommand.Invocation invocation);
11 |
12 | }
--------------------------------------------------------------------------------
/folia/origin/src/main/java/com/github/theword/queqiao/command/SpigotSubCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.github.theword.queqiao.tool.command.SubCommand;
4 | import org.bukkit.command.CommandSender;
5 |
6 | import java.util.List;
7 |
8 | public interface SpigotSubCommand extends SubCommand {
9 |
10 | boolean onCommand(CommandSender commandSender, String[] args);
11 |
12 | List getSubCommands(CommandSender commandSender, String[] args);
13 |
14 | String getPrefix();
15 |
16 | }
--------------------------------------------------------------------------------
/paper/origin/src/main/java/com/github/theword/queqiao/command/PaperSubCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.github.theword.queqiao.tool.command.SubCommand;
4 | import org.bukkit.command.CommandSender;
5 |
6 | import java.util.List;
7 |
8 | public interface PaperSubCommand extends SubCommand {
9 |
10 | boolean onCommand(CommandSender commandSender, String[] args);
11 |
12 | List getSubCommands(CommandSender commandSender, String[] args);
13 |
14 | String getPrefix();
15 |
16 | }
--------------------------------------------------------------------------------
/fabric/origin/src/main/java/com/github/theword/queqiao/command/FabricSubCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.github.theword.queqiao.tool.command.SubCommand;
4 | import com.mojang.brigadier.context.CommandContext;
5 | import net.minecraft.server.command.ServerCommandSource;
6 |
7 | public interface FabricSubCommand extends SubCommand {
8 | String getName();
9 |
10 | String getDescription();
11 |
12 | String getUsage();
13 |
14 | int onCommand(CommandContext context);
15 | }
--------------------------------------------------------------------------------
/spigot/origin/src/main/java/com/github/theword/queqiao/command/SpigotSubCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.github.theword.queqiao.tool.command.SubCommand;
4 | import org.bukkit.command.CommandSender;
5 |
6 | import java.util.List;
7 |
8 | public interface SpigotSubCommand extends SubCommand {
9 |
10 | boolean onCommand(CommandSender commandSender, String[] args);
11 |
12 | List getSubCommands(CommandSender commandSender, String[] args);
13 |
14 | String getPrefix();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/QueQiao.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/forge/origin/src/main/java/com/github/theword/queqiao/command/ForgeSubCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.mojang.brigadier.context.CommandContext;
4 |
5 | public interface ForgeSubCommand {
6 |
7 | String getName();
8 |
9 | String getDescription();
10 |
11 | String getUsage();
12 |
13 | // IF > forge-1.16.5
14 | // int onCommand(CommandContext context);
15 | // ELSE
16 | // int onCommand(CommandContext context);
17 | // END IF
18 | }
--------------------------------------------------------------------------------
/folia/origin/src/main/resources/plugin.yml:
--------------------------------------------------------------------------------
1 | name: QueQiao
2 | version: ${version}
3 | main: com.github.theword.queqiao.QueQiao
4 | api-version: ${api_version}
5 | authors: [ 17TheWord ]
6 | description: ${description}
7 | website: https://github.com/17TheWord/QueQiao
8 |
9 | # Folia 特定配置
10 | folia-supported: true
11 |
12 | # 命令配置
13 | commands:
14 | queqiao:
15 | description: 鹊桥命令
16 | permission: queqiao
17 | permission-message: 您没有执行命令的权限
18 | usage: /queqiao [参数]
19 |
20 | # 权限节点
21 | permissions:
22 | queqiao:
23 | description: 允许使用鹊桥命令
24 | default: op
25 |
--------------------------------------------------------------------------------
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Java21 Development",
3 | "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
4 | "features": {
5 | "ghcr.io/devcontainers/features/java:1": {
6 | "version": "21",
7 | "jdkDistro": "temurin"
8 | }
9 | },
10 | "customizations": {
11 | "vscode": {
12 | "extensions": [
13 | "redhat.java",
14 | "vscjava.vscode-java-pack",
15 | "vscjava.vscode-java-test"
16 | ]
17 | }
18 | },
19 | "postCreateCommand": "sudo apt-get update && sudo apt-get install -y maven gradle",
20 | "forwardPorts": [8080]
21 | }
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/enhancement_report.yml:
--------------------------------------------------------------------------------
1 | name: 功能建议
2 | description: 改进现有功能或提出新功能
3 | title: "[Enhancement](在此简单描述新的功能或建议)"
4 | assignees: 17TheWord
5 | labels: [ "enhancement" ]
6 | body:
7 | - type: markdown
8 | attributes:
9 | value: |
10 | ## 请补全标题并认真填写下方内容
11 |
12 | - type: textarea
13 | id: feature-description
14 | attributes:
15 | label: 功能建议
16 | description: 想要改进或者添加的功能
17 | validations:
18 | required: true
19 |
20 | - type: textarea
21 | id: extra-info
22 | attributes:
23 | label: 额外信息(可选)
24 | description: 如:为什么需要这个功能?在什么场景下适用?
25 |
--------------------------------------------------------------------------------
/gtnh/origin/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.gtnewhorizons.gtnhconvention")
3 | }
4 | fun getVersionFromFile(fileName: String): String {
5 | val versionFile = file(fileName)
6 | return if (versionFile.exists()) {
7 | versionFile.readText().trim()
8 | } else {
9 | throw Exception("File not found: ${versionFile.absolutePath}")
10 | }
11 | }
12 |
13 | val modVersion = getVersionFromFile("../../version.txt")
14 |
15 | extra["modVersion"] = modVersion
16 |
17 | tasks.named("jar") {
18 | destinationDirectory.set(layout.projectDirectory.dir("../../QueQiao-jar/${version}"))
19 | }
--------------------------------------------------------------------------------
/fabric/origin/src/main/resources/fabric.mod.json:
--------------------------------------------------------------------------------
1 | {
2 | "schemaVersion": 1,
3 | "id": "queqiao",
4 | "version": "${version}",
5 | "name": "QueQiao",
6 | "description": "",
7 | "authors": [],
8 | "contact": {},
9 | "license": "MIT",
10 | "icon": "queqiao/logo.png",
11 | "environment": "server",
12 | "entrypoints": {
13 | "main": [
14 | "com.github.theword.queqiao.QueQiao"
15 | ]
16 | },
17 | "mixins": [
18 | "queqiao.mixins.json"
19 | ],
20 | "depends": {
21 | "fabricloader": ">=${loader_version}",
22 | "fabric": "*",
23 | "minecraft": "${minecraft_version}"
24 | }
25 | }
--------------------------------------------------------------------------------
/vanilla/origin/gradle.properties:
--------------------------------------------------------------------------------
1 | kotlin.code.style=official
2 | org.gradle.jvmargs=-Xmx3G
3 | org.gradle.daemon=false
4 | # Mod Properties
5 | mod_id=queqiao
6 | mod_name=QueQiao
7 | mod_license=MIT
8 | mod_group_id=com.github.theword.queqiao
9 | mod_authors=17TheWord
10 | mod_description=Connect to nonebot2.
11 | # Lib Properties
12 | gson_version=2.10.1
13 | slf4j_version=1.7.36
14 | glavo_rcon_version=3.0
15 | kotlin_version=2.0.21
16 | snakeyaml_version=2.2
17 | commons_io_version=2.15.1
18 | java_websocket_version=1.5.3
19 | jetbrains_annotations_version=24.0.0
20 | maven_repository_url=https://maven.pkg.github.com/17TheWord/QueQiaoTool
--------------------------------------------------------------------------------
/gtnh/origin/settings.gradle.kts:
--------------------------------------------------------------------------------
1 |
2 | pluginManagement {
3 | repositories {
4 | maven {
5 | // RetroFuturaGradle
6 | name = "GTNH Maven"
7 | url = uri("https://nexus.gtnewhorizons.com/repository/public/")
8 | mavenContent {
9 | includeGroup("com.gtnewhorizons")
10 | includeGroupByRegex("com\\.gtnewhorizons\\..+")
11 | }
12 | }
13 | gradlePluginPortal()
14 | mavenCentral()
15 | mavenLocal()
16 | }
17 | }
18 |
19 | plugins {
20 | id("com.gtnewhorizons.gtnhsettingsconvention") version("1.0.41")
21 | }
22 |
--------------------------------------------------------------------------------
/velocity/origin/src/main/java/com/github/theword/queqiao/utils/VelocityTool.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.utils;
2 |
3 | import com.github.theword.queqiao.tool.event.model.PlayerModel;
4 | import com.velocitypowered.api.proxy.Player;
5 |
6 | public class VelocityTool {
7 |
8 | public static PlayerModel getVelocityPlayer(Player player) {
9 | PlayerModel playerModel = new PlayerModel();
10 | playerModel.setNickname(player.getUsername());
11 | playerModel.setUuid(player.getUniqueId());
12 | playerModel.setOp(player.hasPermission("minecraft.command.op"));
13 | return playerModel;
14 | }
15 | }
--------------------------------------------------------------------------------
/fabric/origin/src/main/resources/queqiao.mixins.json5:
--------------------------------------------------------------------------------
1 | // ONEWAY
2 | // RENAME queqiao.mixins.json
3 | {
4 | "required": true,
5 | "package": "com.github.theword.queqiao.mixin",
6 | // IF >= fabric-1.20.5
7 | // "compatibilityLevel": "JAVA_21",
8 | // ELSE IF > fabric-1.16.5
9 | // "compatibilityLevel": "JAVA_17",
10 | // ELSE
11 | // "compatibilityLevel": "JAVA_8",
12 | // END IF
13 | "mixins": [
14 | "AdvancementMixin",
15 | "PlayerManagerMixin",
16 | "ServerPlayerEntityMixin",
17 | "ServerPlayNetworkHandlerMixin"
18 | ],
19 | "injectors": {
20 | "defaultRequire": 1
21 | },
22 | "client": [
23 | ]
24 | }
25 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 | .gradle/
4 | # Log file
5 | *.log
6 |
7 | # BlueJ files
8 | *.ctxt
9 |
10 | # Mobile Tools for Java (J2ME)
11 | .mtj.tmp/
12 | QueQiao-jar/
13 | # Package Files #
14 | *.jar
15 | *.war
16 | *.nar
17 | *.ear
18 | *.zip
19 | *.tar.gz
20 | *.rar
21 |
22 | !gradle-wrapper.jar
23 | !ModMultiVersionTool-*.jar
24 |
25 | */*-*/*
26 |
27 | !*/*-*/gradlew
28 | !*/*-*/gradlew.bat
29 | !*/*-*/support_version.txt
30 |
31 | !velocity/velocity-*/build/generated/sources/tamplates/
32 |
33 | !tool/
34 |
35 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
36 | hs_err_pid*
37 | replay_pid*
38 |
--------------------------------------------------------------------------------
/.idea/ModMultiLoaders.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
19 |
20 |
--------------------------------------------------------------------------------
/matrix.ps1:
--------------------------------------------------------------------------------
1 | param (
2 | [string[]]$paths
3 | )
4 |
5 | $allFolderObjects = @()
6 |
7 | foreach ($path in $paths) {
8 | $folders = Get-ChildItem -Path $path -Directory
9 | $filteredFolders = $folders | Where-Object { $_.Name -ne "origin" }
10 |
11 | $folderObjects = $filteredFolders | ForEach-Object {
12 | [PSCustomObject]@{
13 | "mc-version" = $_.Name.Replace("$path-", "")
14 | "mc-loader" = $path
15 | }
16 | }
17 |
18 | $allFolderObjects += $folderObjects
19 | }
20 |
21 | $json = [PSCustomObject]@{
22 | "config" = $allFolderObjects
23 | } | ConvertTo-Json -Compress
24 |
25 | Write-Output "::set-output name=matrix::$json"
26 |
--------------------------------------------------------------------------------
/paper/origin/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx3G
2 | org.gradle.daemon=false
3 | # Mod Properties
4 | mod_id=queqiao
5 | mod_name=QueQiao
6 | mod_license=MIT
7 | mod_group_id=com.github.theword.queqiao
8 | mod_authors=17TheWord
9 | mod_website=https://github.com/17TheWord/QueQiao
10 | mod_description=A Minecraft server Mod/Plugin for real-time player event handling and API-based message broadcasting.
11 | # Lib Properties
12 | glavo_rcon_version=3.0
13 | slf4j_version=1.7.25
14 | snakeyaml_version=2.0
15 | junit_jupiter_version=5.11.4
16 | java_websocket_version=1.5.3
17 | jetbrains_annotations_version=24.0.0
18 | maven_repository_url=https://maven.pkg.github.com/17TheWord/QueQiaoTool
19 | # Plugin Properties
20 | api_version=1.17.1
21 | java_version=17
22 |
--------------------------------------------------------------------------------
/velocity/origin/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx3G
2 | org.gradle.daemon=false
3 | # Mod Properties
4 | mod_id=queqiao
5 | mod_name=QueQiao
6 | mod_license=MIT
7 | mod_group_id=com.github.theword.queqiao
8 | mod_authors=17TheWord
9 | mod_description=Connect to nonebot2.
10 | # Lib Properties
11 | glavo_rcon_version=3.0
12 | slf4j_version=2.0.12
13 | snakeyaml_version=2.2
14 | commons_io_version=2.15.1
15 | junit_jupiter_version=5.10.0
16 | java_websocket_version=1.5.3
17 | jetbrains_annotations_version=24.0.0
18 | maven_repository_url=https://maven.pkg.github.com/17TheWord/QueQiaoTool
19 | # JDK Version
20 | java_version=17
21 | # Api Version
22 | # IF velocity-3.3.0
23 | #api_version=3.3.0
24 | # ELSE IF velocity-3.4.0
25 | #api_version=3.4.0
26 | # END IF
--------------------------------------------------------------------------------
/.idea/checkstyle-idea.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 10.17.0
5 | JavaOnly
6 | true
7 |
8 |
9 |
10 |
11 | (bundled)
12 | (bundled)
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/cleanroom/origin/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | maven {
4 | // RetroFuturaGradle
5 | name 'GTNH Maven'
6 | url 'https://nexus.gtnewhorizons.com/repository/public/'
7 | mavenContent {
8 | includeGroup 'com.gtnewhorizons'
9 | includeGroup 'com.gtnewhorizons.retrofuturagradle'
10 | }
11 | }
12 | gradlePluginPortal()
13 | mavenCentral()
14 | mavenLocal()
15 | }
16 | }
17 |
18 | plugins {
19 | // Automatic toolchain provisioning
20 | id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0'
21 | }
22 |
23 | // Due to an IntelliJ bug, this has to be done
24 | // rootProject.name = archives_base_name
25 | rootProject.name = rootProject.projectDir.getName()
--------------------------------------------------------------------------------
/gtnh/origin/src/main/resources/mcmod.info:
--------------------------------------------------------------------------------
1 | {
2 | "modListVersion": 2,
3 | "modList": [
4 | {
5 | "modid": "${modId}",
6 | "name": "${modName}",
7 | "description": "Minecraft Server Mod/Plugin for Real-time Player Events & API Broadcast Messaging.",
8 | "version": "${modVersion}",
9 | "mcversion": "${minecraftVersion}",
10 | "url": "https://github.com/17TheWord/QueQiao",
11 | "updateUrl": "",
12 | "authorList": [
13 | "17TheWord"
14 | ],
15 | "credits": "",
16 | "logoFile": "queqiao/logo.png",
17 | "screenshots": [],
18 | "parent": "",
19 | "requiredMods": [],
20 | "dependencies": [],
21 | "dependants": [],
22 | "useDependencyInformation": false,
23 | "clientSideRequired": false,
24 | "serverSideRequired": true
25 | }
26 | ]
27 | }
28 |
--------------------------------------------------------------------------------
/velocity/origin/src/main/java/com/github/theword/queqiao/command/CommandManager.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 |
4 | import com.github.theword.queqiao.command.subCommand.HelpCommand;
5 | import com.github.theword.queqiao.command.subCommand.ReloadCommand;
6 | import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | public class CommandManager {
12 | List subCommandList = new ArrayList<>();
13 |
14 |
15 | public CommandManager() {
16 | subCommandList.add(new HelpCommand());
17 | subCommandList.add(new ReloadCommand());
18 | subCommandList.add(new ReconnectCommand());
19 | }
20 |
21 | public List getSubCommandList() {
22 | return subCommandList;
23 | }
24 | }
--------------------------------------------------------------------------------
/forge/origin/src/main/java/com/github/theword/queqiao/command/CommandManager.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.github.theword.queqiao.command.subCommand.HelpCommand;
4 | import com.github.theword.queqiao.command.subCommand.ReloadCommand;
5 | import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | public class CommandManager {
11 |
12 | public List getSubCommandList() {
13 | return subCommandList;
14 | }
15 |
16 | private final List subCommandList = new ArrayList<>();
17 |
18 | public CommandManager() {
19 | subCommandList.add(new HelpCommand());
20 | subCommandList.add(new ReloadCommand());
21 | subCommandList.add(new ReconnectCommand());
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/velocity/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.VelocitySubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.ReloadCommandAbstract;
6 | import com.mojang.brigadier.Command;
7 | import com.velocitypowered.api.command.SimpleCommand;
8 |
9 |
10 | public class ReloadCommand extends ReloadCommandAbstract implements VelocitySubCommand {
11 | @Override
12 | public int onCommand(SimpleCommand.Invocation invocation) {
13 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(invocation, getPermissionNode())) return 0;
14 | execute(invocation, false);
15 | return Command.SINGLE_SUCCESS;
16 | }
17 | }
--------------------------------------------------------------------------------
/neoforge/origin/src/main/java/com/github/theword/queqiao/command/CommandManager.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.github.theword.queqiao.command.subCommand.HelpCommand;
4 | import com.github.theword.queqiao.command.subCommand.ReloadCommand;
5 | import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | public class CommandManager {
11 |
12 | public List getSubCommandList() {
13 | return subCommandList;
14 | }
15 |
16 | private final List subCommandList = new ArrayList<>();
17 |
18 | public CommandManager() {
19 | subCommandList.add(new HelpCommand());
20 | subCommandList.add(new ReloadCommand());
21 | subCommandList.add(new ReconnectCommand());
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/forge/origin/src/main/resources/pack.mcmeta.json5:
--------------------------------------------------------------------------------
1 | // ONEWAY
2 | // RENAME pack.mcmeta
3 | {
4 | "pack": {
5 | "description": "queqiao resources",
6 | // IF forge-1.16.5
7 | // "pack_format": 6,
8 | // "_comment": "A pack_format of 6 requires json lang files and some texture changes from 1.16.2. Note: we require v6 pack meta for all mods."
9 | // ELSE IF forge-1.18.2
10 | // "pack_format": 9,
11 | // "forge:resource_pack_format": 8,
12 | // "forge:data_pack_format": 9
13 | // ELSE IF forge-1.19.2
14 | // "pack_format": 10,
15 | // "forge:resource_pack_format": 9,
16 | // "forge:data_pack_format": 10
17 | // ELSE IF forge-1.20.1
18 | // "pack_format": 12,
19 | // "forge:server_data_pack_format": 12
20 | // ELSE IF forge-1.21
21 | // "pack_format": 15,
22 | // "forge:server_data_pack_format": 12
23 | // END IF
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/forge/origin/src/main/resources/META-INF/mods.toml:
--------------------------------------------------------------------------------
1 | modLoader = "javafml" #mandatory
2 | loaderVersion = "${forge_version_range}" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
3 | license = "${mod_license}"
4 | [[mods]] #mandatory
5 | modId = "${mod_id}" #mandatory
6 | version = "${mod_version}" #mandatory
7 | displayName = "${mod_name}" #mandatory
8 | authors = "${mod_authors}" #optional
9 | description = '''${mod_description}'''
10 | [[dependencies."${mod_id}"]] #optional
11 | modId = "forge" #mandatory
12 | mandatory = true #mandatory
13 | versionRange = "${forge_version_range}" #mandatory
14 | ordering = "NONE"
15 | side = "BOTH"# Here's another dependency
16 | [[dependencies."${mod_id}"]]
17 | modId = "minecraft"
18 | mandatory = true
19 | versionRange = "${minecraft_version_range}"
20 | ordering = "NONE"
21 | side = "BOTH"
22 |
--------------------------------------------------------------------------------
/neoforge/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.NeoForgeSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.ReloadCommandAbstract;
6 | import com.mojang.brigadier.Command;
7 | import com.mojang.brigadier.context.CommandContext;
8 |
9 |
10 | public class ReloadCommand extends ReloadCommandAbstract implements NeoForgeSubCommand {
11 |
12 | @Override
13 | public int onCommand(CommandContext context) {
14 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(context, getPermissionNode())) return 0;
15 | execute(context, true);
16 | return Command.SINGLE_SUCCESS;
17 | }
18 | }
--------------------------------------------------------------------------------
/velocity/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand.client;
2 |
3 | import com.github.theword.queqiao.command.VelocitySubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.client.ReconnectCommandAbstract;
6 | import com.mojang.brigadier.Command;
7 | import com.velocitypowered.api.command.SimpleCommand;
8 |
9 |
10 | public class ReconnectCommand extends ReconnectCommandAbstract implements VelocitySubCommand {
11 | @Override
12 | public int onCommand(SimpleCommand.Invocation invocation) {
13 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(invocation, getPermissionNode())) return 0;
14 | execute(invocation, false);
15 | return Command.SINGLE_SUCCESS;
16 | }
17 | }
--------------------------------------------------------------------------------
/folia/origin/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx3G
2 | org.gradle.daemon=false
3 | # Mod Properties
4 | mod_id=queqiao
5 | mod_name=QueQiao
6 | mod_license=MIT
7 | mod_group_id=com.github.theword.queqiao
8 | mod_authors=17TheWord
9 | mod_description=Minecraft Server Mod/Plugin for Real-time Player Events & API Broadcast Messaging
10 | # Lib Properties
11 | glavo_rcon_version=3.0
12 | slf4j_version=1.7.36
13 | snakeyaml_version=2.2
14 | junit_jupiter_version=5.11.4
15 | java_websocket_version=1.5.3
16 | jetbrains_annotations_version=24.0.0
17 | maven_repository_url=https://maven.pkg.github.com/17TheWord/QueQiaoTool
18 | # JDK Version
19 | # IF folia-1.12.2
20 | #java_version=8
21 | # ELSE IF >= folia-1.20.5
22 | #java_version=21
23 | # ELSE
24 | #java_version=17
25 | # END IF
26 | # Folia Properties
27 | # IF folia-1.21.4
28 | #api_version=1.21.4
29 | #folia_version=1.21.4-R0.1-SNAPSHOT
30 | # END IF
31 | #
--------------------------------------------------------------------------------
/fabric/origin/src/main/java/com/github/theword/queqiao/command/CommandManager.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.github.theword.queqiao.command.subCommand.HelpCommand;
4 | import com.github.theword.queqiao.command.subCommand.ReloadCommand;
5 | import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
6 | import com.github.theword.queqiao.tool.command.SubCommand;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | public class CommandManager {
12 | private final List subCommandList = new ArrayList<>();
13 |
14 | public CommandManager() {
15 | subCommandList.add(new HelpCommand());
16 | subCommandList.add(new ReloadCommand());
17 | subCommandList.add(new ReconnectCommand());
18 | }
19 |
20 | public List getSubCommandList() {
21 | return subCommandList;
22 | }
23 | }
--------------------------------------------------------------------------------
/velocity/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectAllCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand.client;
2 |
3 | import com.github.theword.queqiao.command.VelocitySubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.client.ReconnectCommandAbstract;
6 | import com.mojang.brigadier.Command;
7 | import com.velocitypowered.api.command.SimpleCommand;
8 |
9 |
10 | public class ReconnectAllCommand extends ReconnectCommandAbstract implements VelocitySubCommand {
11 | @Override
12 | public int onCommand(SimpleCommand.Invocation invocation) {
13 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(invocation, getPermissionNode()))
14 | return 0;
15 | execute(invocation, true);
16 | return Command.SINGLE_SUCCESS;
17 | }
18 |
19 | }
--------------------------------------------------------------------------------
/neoforge/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand.client;
2 |
3 | import com.github.theword.queqiao.command.NeoForgeSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.client.ReconnectCommandAbstract;
6 | import com.mojang.brigadier.Command;
7 | import com.mojang.brigadier.context.CommandContext;
8 |
9 |
10 | public class ReconnectCommand extends ReconnectCommandAbstract implements NeoForgeSubCommand {
11 |
12 | @Override
13 | public int onCommand(CommandContext context) {
14 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(context, getPermissionNode())) return 0;
15 | execute(context, false);
16 | return Command.SINGLE_SUCCESS;
17 | }
18 |
19 | }
--------------------------------------------------------------------------------
/cleanroom/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.ForgeSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.ReloadCommandAbstract;
6 | import net.minecraft.command.ICommandSender;
7 |
8 |
9 | public class ReloadCommand extends ForgeSubCommand {
10 |
11 | public ReloadCommand() {
12 | super(new InnerReloadCommand());
13 | }
14 |
15 | public static class InnerReloadCommand extends ReloadCommandAbstract {
16 |
17 | }
18 | @Override
19 | public int onCommand(ICommandSender sender) {
20 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(sender, inner.getPermissionNode())) return 0;
21 | inner.execute(sender, true);
22 | return 1;
23 | }
24 | }
--------------------------------------------------------------------------------
/neoforge/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectAllCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand.client;
2 |
3 | import com.github.theword.queqiao.command.NeoForgeSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.client.ReconnectCommandAbstract;
6 | import com.mojang.brigadier.Command;
7 | import com.mojang.brigadier.context.CommandContext;
8 |
9 |
10 |
11 | public class ReconnectAllCommand extends ReconnectCommandAbstract implements NeoForgeSubCommand {
12 |
13 | @Override
14 | public int onCommand(CommandContext context) {
15 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(context, getPermissionNode())) return 0;
16 | execute(context, true);
17 | return Command.SINGLE_SUCCESS;
18 | }
19 |
20 | }
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/version_feature.yml:
--------------------------------------------------------------------------------
1 | name: 新增版本支持
2 | description: 希望支持某个版本
3 | title: "[Version Support]添加对 XXX 服务端,XXX 版本的支持"
4 | assignees: 17TheWord
5 | labels: [ "version support" ]
6 | body:
7 | - type: markdown
8 | attributes:
9 | value: |
10 | ## 请补全标题
11 |
12 | - type: input
13 | id: server-type
14 | attributes:
15 | label: 服务端类型
16 | placeholder: Spigot
17 | validations:
18 | required: true
19 |
20 | - type: input
21 | id: server-version
22 | attributes:
23 | label: 服务端版本
24 | placeholder: 1.20.1
25 | validations:
26 | required: true
27 |
28 | - type: textarea
29 | id: other-description
30 | attributes:
31 | label: 其他补充
32 | render: markdown
33 | description: 其他补充(如果有)
34 | placeholder: |
35 | 如果有其他补充,请填写在这里。
36 |
37 | 例如:
38 | - 是否需要修改配置文件?
39 | - 是否有服务端官方文档链接?
40 | - ...
41 |
--------------------------------------------------------------------------------
/neoforge/origin/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx3G
2 | org.gradle.daemon=true
3 | org.gradle.parallel=true
4 | org.gradle.caching=true
5 | org.gradle.configuration-cache=true
6 | minecraft_version=1.21.1
7 | minecraft_version_range=[1.21.1,1.22)
8 | neo_version=21.1.117
9 | neo_version_range=[21,)
10 | loader_version_range=[4,)
11 | parchment_minecraft_version=1.21.1
12 | parchment_mappings_version=2024.11.17
13 | # Mod Properties
14 | mod_id=queqiao
15 | mod_name=QueQiao
16 | mod_license=MIT
17 | mod_group_id=com.github.theword.queqiao
18 | mod_authors=17TheWord
19 | mod_description=A server plugin/mod that distributes Minecraft server player events in JSON format via Websocket.
20 | # JDK Version
21 | java_version=21
22 | # Lib Properties
23 | gson_version=2.10.1
24 | glavo_rcon_version=3.0
25 | slf4j_version=1.7.36
26 | snakeyaml_version=2.2
27 | junit_jupiter_version=5.11.4
28 | java_websocket_version=1.5.3
29 | maven_repository_url=https://maven.pkg.github.com/17TheWord/QueQiaoTool
--------------------------------------------------------------------------------
/vanilla/origin/src/main/kotlin/com/github/theword/queqiao/handle/HandleApiImpl.kt:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.handle
2 |
3 | import com.github.theword.queqiao.tool.handle.HandleApiService
4 | import com.github.theword.queqiao.tool.response.PrivateMessageResponse
5 | import com.google.gson.JsonElement
6 | import java.util.UUID
7 |
8 |
9 | class HandleApiImpl : HandleApiService {
10 | override fun handleBroadcastMessage(jsonElement: JsonElement) {
11 | }
12 |
13 | override fun handleSendTitleMessage(
14 | titleElement: JsonElement,
15 | subtitleElement: JsonElement,
16 | fadein: Int,
17 | stay: Int,
18 | fadeout: Int,
19 | ) {
20 | }
21 |
22 | override fun handleSendActionBarMessage(jsonElement: JsonElement) {
23 | }
24 |
25 | override fun handleSendPrivateMessage(s: String, uuid: UUID, jsonElement: JsonElement): PrivateMessageResponse {
26 | return PrivateMessageResponse.of(null, "该接口不可用")
27 | }
28 | }
--------------------------------------------------------------------------------
/spigot/origin/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx3G
2 | org.gradle.daemon=false
3 | # Mod Properties
4 | mod_id=queqiao
5 | mod_name=QueQiao
6 | mod_license=MIT
7 | mod_group_id=com.github.theword.queqiao
8 | mod_authors=17TheWord
9 | mod_description=A Minecraft server Mod/Plugin for real-time player event handling and API-based message broadcasting.
10 | # Lib Properties
11 | glavo_rcon_version=3.0
12 | slf4j_version=1.7.25
13 | snakeyaml_version=2.0
14 | junit_jupiter_version=5.11.4
15 | java_websocket_version=1.5.3
16 | jetbrains_annotations_version=24.0.0
17 | maven_repository_url=https://maven.pkg.github.com/17TheWord/QueQiaoTool
18 | # JDK Version
19 | # IF spigot-1.12.2
20 | #java_version=8
21 | # ELSE IF >= spigot-1.20.5
22 | #java_version=21
23 | # ELSE
24 | #java_version=17
25 | # END IF
26 | # Spigot Properties
27 | # IF spigot-1.12.2
28 | #api_version=1.12.2
29 | #spigot_version=1.12.2-R0.1-SNAPSHOT
30 | # ELSE
31 | #api_version=1.13
32 | #spigot_version=1.13-R0.1-SNAPSHOT
33 | # END IF
--------------------------------------------------------------------------------
/fabric/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.FabricSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.ReloadCommandAbstract;
6 | import com.mojang.brigadier.Command;
7 | import com.mojang.brigadier.context.CommandContext;
8 | import net.minecraft.server.command.ServerCommandSource;
9 |
10 |
11 | public class ReloadCommand extends ReloadCommandAbstract implements FabricSubCommand {
12 |
13 |
14 | /**
15 | * @param context ServerCommandSource
16 | * @return int
17 | */
18 | @Override
19 | public int onCommand(CommandContext context) {
20 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(context, getPermissionNode())) return 0;
21 | execute(context, true);
22 | return Command.SINGLE_SUCCESS;
23 | }
24 | }
--------------------------------------------------------------------------------
/fabric/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand.client;
2 |
3 | import com.github.theword.queqiao.command.FabricSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.client.ReconnectCommandAbstract;
6 | import com.mojang.brigadier.Command;
7 | import com.mojang.brigadier.context.CommandContext;
8 | import net.minecraft.server.command.ServerCommandSource;
9 |
10 |
11 | public class ReconnectCommand extends ReconnectCommandAbstract implements FabricSubCommand {
12 |
13 | /**
14 | * @param context context
15 | * @return int
16 | */
17 | @Override
18 | public int onCommand(CommandContext context) {
19 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(context, getPermissionNode())) return 0;
20 | execute(context, false);
21 | return Command.SINGLE_SUCCESS;
22 | }
23 | }
--------------------------------------------------------------------------------
/folia/origin/src/main/java/com/github/theword/queqiao/QueQiao.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao;
2 |
3 | import com.github.theword.queqiao.command.CommandExecutor;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.constant.BaseConstant;
6 | import org.bukkit.Bukkit;
7 | import org.bukkit.command.PluginCommand;
8 | import org.bukkit.plugin.java.JavaPlugin;
9 |
10 |
11 | public final class QueQiao extends JavaPlugin {
12 |
13 | public static JavaPlugin instance;
14 |
15 | @Override
16 | public void onEnable() {
17 | // Folia 中,工具包初始化位于 EventProcessor 的 ServerLoadEvent 事件
18 | instance = this;
19 |
20 | Bukkit.getPluginManager().registerEvents(new EventProcessor(), this);
21 |
22 | PluginCommand command = getCommand(BaseConstant.COMMAND_HEADER);
23 | if (command != null) command.setExecutor(new CommandExecutor());
24 | }
25 |
26 | @Override
27 | public void onDisable() {
28 | GlobalContext.shutdown();
29 | }
30 | }
--------------------------------------------------------------------------------
/forge/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.ForgeSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.ReloadCommandAbstract;
6 | import com.mojang.brigadier.Command;
7 | import com.mojang.brigadier.context.CommandContext;
8 |
9 |
10 | public class ReloadCommand extends ReloadCommandAbstract implements ForgeSubCommand {
11 |
12 | @Override
13 | // IF > forge-1.16.5
14 | // public int onCommand(CommandContext context) {
15 | // ELSE
16 | // public int onCommand(CommandContext context) {
17 | // END IF
18 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(context, getPermissionNode())) return 0;
19 | execute(context, true);
20 | return Command.SINGLE_SUCCESS;
21 | }
22 | }
--------------------------------------------------------------------------------
/fabric/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectAllCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand.client;
2 |
3 | import com.github.theword.queqiao.command.FabricSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.client.ReconnectCommandAbstract;
6 | import com.mojang.brigadier.Command;
7 | import com.mojang.brigadier.context.CommandContext;
8 | import net.minecraft.server.command.ServerCommandSource;
9 |
10 |
11 | public class ReconnectAllCommand extends ReconnectCommandAbstract implements FabricSubCommand {
12 | /**
13 | * @param context CommandContext
14 | * @return int
15 | */
16 | @Override
17 | public int onCommand(CommandContext context) {
18 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(context, getPermissionNode())) return 0;
19 | execute(context, true);
20 | return Command.SINGLE_SUCCESS;
21 |
22 | }
23 | }
--------------------------------------------------------------------------------
/cleanroom/origin/src/main/java/com/github/theword/queqiao/command/CommandTreeQueQiao.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.github.theword.queqiao.command.subCommand.HelpCommand;
4 | import com.github.theword.queqiao.command.subCommand.ReloadCommand;
5 | import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
6 | import com.github.theword.queqiao.tool.constant.BaseConstant;
7 | import net.minecraft.command.ICommandSender;
8 | import net.minecraftforge.server.command.CommandTreeBase;
9 |
10 | public class CommandTreeQueQiao extends CommandTreeBase {
11 |
12 | public CommandTreeQueQiao(){
13 | super();
14 | this.addSubcommand(new HelpCommand(this));
15 | this.addSubcommand(new ReloadCommand());
16 | this.addSubcommand(new ReconnectCommand());
17 | }
18 |
19 | @Override
20 | public String getName() {
21 | return BaseConstant.COMMAND_HEADER;
22 | }
23 |
24 | @Override
25 | public String getUsage(ICommandSender sender) {
26 | return "";
27 | }
28 |
29 | }
--------------------------------------------------------------------------------
/forge/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand.client;
2 |
3 | import com.github.theword.queqiao.command.ForgeSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.client.ReconnectCommandAbstract;
6 | import com.mojang.brigadier.Command;
7 | import com.mojang.brigadier.context.CommandContext;
8 |
9 |
10 | public class ReconnectCommand extends ReconnectCommandAbstract implements ForgeSubCommand {
11 |
12 | @Override
13 | // IF > forge-1.16.5
14 | // public int onCommand(CommandContext context) {
15 | // ELSE
16 | // public int onCommand(CommandContext context) {
17 | // END IF
18 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(context, getPermissionNode())) return 0;
19 | execute(context, false);
20 | return Command.SINGLE_SUCCESS;
21 | }
22 |
23 | }
--------------------------------------------------------------------------------
/forge/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectAllCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand.client;
2 |
3 | import com.github.theword.queqiao.command.ForgeSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.client.ReconnectCommandAbstract;
6 | import com.mojang.brigadier.Command;
7 | import com.mojang.brigadier.context.CommandContext;
8 |
9 |
10 |
11 | public class ReconnectAllCommand extends ReconnectCommandAbstract implements ForgeSubCommand {
12 |
13 | @Override
14 | // IF > forge-1.16.5
15 | // public int onCommand(CommandContext context) {
16 | // ELSE
17 | // public int onCommand(CommandContext context) {
18 | // END IF
19 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(context, getPermissionNode())) return 0;
20 | execute(context, true);
21 | return Command.SINGLE_SUCCESS;
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/folia/origin/src/main/java/com/github/theword/queqiao/command/CommandManager.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 |
4 | import com.github.theword.queqiao.command.subCommand.ClientCommand;
5 | import com.github.theword.queqiao.command.subCommand.HelpCommand;
6 | import com.github.theword.queqiao.command.subCommand.ReloadCommand;
7 | import com.github.theword.queqiao.command.subCommand.ServerCommand;
8 | import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
9 |
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 | public class CommandManager {
14 | List subCommandList = new ArrayList<>();
15 |
16 |
17 | public CommandManager() {
18 | subCommandList.add(new HelpCommand());
19 | subCommandList.add(new ReloadCommand());
20 | subCommandList.add(new ClientCommand());
21 | subCommandList.add(new ServerCommand());
22 |
23 | subCommandList.add(new ReconnectCommand());
24 | }
25 |
26 | public List getSubCommandList() {
27 | return subCommandList;
28 | }
29 | }
--------------------------------------------------------------------------------
/paper/origin/src/main/java/com/github/theword/queqiao/command/CommandManager.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 |
4 | import com.github.theword.queqiao.command.subCommand.ClientCommand;
5 | import com.github.theword.queqiao.command.subCommand.HelpCommand;
6 | import com.github.theword.queqiao.command.subCommand.ReloadCommand;
7 | import com.github.theword.queqiao.command.subCommand.ServerCommand;
8 | import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
9 |
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 | public class CommandManager {
14 | List subCommandList = new ArrayList<>();
15 |
16 |
17 | public CommandManager() {
18 | subCommandList.add(new HelpCommand());
19 | subCommandList.add(new ReloadCommand());
20 | subCommandList.add(new ClientCommand());
21 | subCommandList.add(new ServerCommand());
22 |
23 | subCommandList.add(new ReconnectCommand());
24 | }
25 |
26 | public List getSubCommandList() {
27 | return subCommandList;
28 | }
29 | }
--------------------------------------------------------------------------------
/spigot/origin/src/main/java/com/github/theword/queqiao/command/CommandManager.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 |
4 | import com.github.theword.queqiao.command.subCommand.ClientCommand;
5 | import com.github.theword.queqiao.command.subCommand.HelpCommand;
6 | import com.github.theword.queqiao.command.subCommand.ReloadCommand;
7 | import com.github.theword.queqiao.command.subCommand.ServerCommand;
8 | import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
9 |
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 | public class CommandManager {
14 | List subCommandList = new ArrayList<>();
15 |
16 |
17 | public CommandManager() {
18 | subCommandList.add(new HelpCommand());
19 | subCommandList.add(new ReloadCommand());
20 | subCommandList.add(new ClientCommand());
21 | subCommandList.add(new ServerCommand());
22 |
23 | subCommandList.add(new ReconnectCommand());
24 | }
25 |
26 | public List getSubCommandList() {
27 | return subCommandList;
28 | }
29 | }
--------------------------------------------------------------------------------
/gtnh/origin/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageImpl.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.handle;
2 |
3 | import com.github.theword.queqiao.tool.handle.HandleCommandReturnMessageService;
4 | import net.minecraft.command.ICommandSender;
5 | import net.minecraft.util.ChatComponentText;
6 |
7 | public class HandleCommandReturnMessageImpl extends HandleCommandReturnMessageService {
8 |
9 | @Override
10 | public void handleCommandReturnMessage(Object object, String message) {
11 | ICommandSender sender = (ICommandSender) object;
12 | sender.addChatMessage(new ChatComponentText(message));
13 | }
14 |
15 | @Override
16 | public boolean hasPermission(Object object, String node) {
17 | // CommandContext context =
18 | // (CommandContext) object;
19 | // if (context.getSource().hasPermission(BaseConstant.MOD_PERMISSION_LEVEL)) return true;
20 | // handleCommandReturnMessage(object, "您没有权限执行此命令");
21 | return false;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/folia/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.SpigotSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.ReloadCommandAbstract;
6 | import org.bukkit.command.CommandSender;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 |
12 | public class ReloadCommand extends ReloadCommandAbstract implements SpigotSubCommand {
13 | @Override
14 | public boolean onCommand(CommandSender commandSender, String[] args) {
15 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(commandSender, getPermissionNode())) return false;
16 | execute(commandSender, false);
17 | return true;
18 | }
19 |
20 | @Override
21 | public List getSubCommands(CommandSender commandSender, String[] args) {
22 | return new ArrayList<>();
23 | }
24 |
25 | @Override
26 | public String getPrefix() {
27 | return null;
28 | }
29 | }
--------------------------------------------------------------------------------
/paper/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.PaperSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.ReloadCommandAbstract;
6 | import org.bukkit.command.CommandSender;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 |
12 | public class ReloadCommand extends ReloadCommandAbstract implements PaperSubCommand {
13 | @Override
14 | public boolean onCommand(CommandSender commandSender, String[] args) {
15 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(commandSender, getPermissionNode())) return false;
16 | execute(commandSender, false);
17 | return true;
18 | }
19 |
20 | @Override
21 | public List getSubCommands(CommandSender commandSender, String[] args) {
22 | return new ArrayList<>();
23 | }
24 |
25 | @Override
26 | public String getPrefix() {
27 | return null;
28 | }
29 | }
--------------------------------------------------------------------------------
/spigot/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ReloadCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.SpigotSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.ReloadCommandAbstract;
6 | import org.bukkit.command.CommandSender;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 |
12 | public class ReloadCommand extends ReloadCommandAbstract implements SpigotSubCommand {
13 | @Override
14 | public boolean onCommand(CommandSender commandSender, String[] args) {
15 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(commandSender, getPermissionNode())) return false;
16 | execute(commandSender, false);
17 | return true;
18 | }
19 |
20 | @Override
21 | public List getSubCommands(CommandSender commandSender, String[] args) {
22 | return new ArrayList<>();
23 | }
24 |
25 | @Override
26 | public String getPrefix() {
27 | return null;
28 | }
29 | }
--------------------------------------------------------------------------------
/velocity/origin/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageImpl.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.handle;
2 |
3 | import com.github.theword.queqiao.tool.handle.HandleCommandReturnMessageService;
4 | import com.velocitypowered.api.command.SimpleCommand;
5 | import net.kyori.adventure.text.Component;
6 |
7 | public class HandleCommandReturnMessageImpl extends HandleCommandReturnMessageService {
8 | @Override
9 | public void handleCommandReturnMessage(Object o, String s) {
10 | SimpleCommand.Invocation invocation = (SimpleCommand.Invocation) o;
11 | invocation.source().sendMessage(Component.text(s));
12 | }
13 |
14 | /**
15 | * @param object CommandContext
16 | * @param node 权限节点
17 | * @return 是否有权限
18 | */
19 | @Override
20 | public boolean hasPermission(Object object, String node) {
21 | SimpleCommand.Invocation invocation = (SimpleCommand.Invocation) object;
22 | if (invocation.source().hasPermission(node)) return true;
23 | handleCommandReturnMessage(object, "您没有执行此命令的权限");
24 | return false;
25 | }
26 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2024 17TheWord
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/folia/origin/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageImpl.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.handle;
2 |
3 | import com.github.theword.queqiao.tool.handle.HandleCommandReturnMessageService;
4 | import org.bukkit.command.CommandSender;
5 |
6 | public class HandleCommandReturnMessageImpl extends HandleCommandReturnMessageService {
7 |
8 | /**
9 | * 处理命令返回消息
10 | *
11 | * @param object 命令发送者
12 | * @param message 消息
13 | */
14 | @Override
15 | public void handleCommandReturnMessage(Object object, String message) {
16 | CommandSender commandSender = (CommandSender) object;
17 | commandSender.sendMessage(message);
18 | }
19 |
20 | /**
21 | * 判断命令发送者是否有权限执行命令
22 | *
23 | * @param object 命令发送者
24 | * @param node 权限节点
25 | * @return 是否有权限
26 | */
27 | @Override
28 | public boolean hasPermission(Object object, String node) {
29 | CommandSender commandSender = (CommandSender) object;
30 | if (commandSender.hasPermission(node)) return true;
31 | commandSender.sendMessage("您没有权限执行当前命令");
32 | return false;
33 | }
34 | }
--------------------------------------------------------------------------------
/gtnh/origin/src/main/resources/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2025 17TheWord
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/paper/origin/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageImpl.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.handle;
2 |
3 | import com.github.theword.queqiao.tool.handle.HandleCommandReturnMessageService;
4 | import org.bukkit.command.CommandSender;
5 |
6 | public class HandleCommandReturnMessageImpl extends HandleCommandReturnMessageService {
7 |
8 | /**
9 | * 处理命令返回消息
10 | *
11 | * @param object 命令发送者
12 | * @param message 消息
13 | */
14 | @Override
15 | public void handleCommandReturnMessage(Object object, String message) {
16 | CommandSender commandSender = (CommandSender) object;
17 | commandSender.sendMessage(message);
18 | }
19 |
20 | /**
21 | * 判断命令发送者是否有权限执行命令
22 | *
23 | * @param object 命令发送者
24 | * @param node 权限节点
25 | * @return 是否有权限
26 | */
27 | @Override
28 | public boolean hasPermission(Object object, String node) {
29 | CommandSender commandSender = (CommandSender) object;
30 | if (commandSender.hasPermission(node)) return true;
31 | commandSender.sendMessage("您没有权限执行当前命令");
32 | return false;
33 | }
34 | }
--------------------------------------------------------------------------------
/spigot/origin/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageImpl.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.handle;
2 |
3 | import com.github.theword.queqiao.tool.handle.HandleCommandReturnMessageService;
4 | import org.bukkit.command.CommandSender;
5 |
6 | public class HandleCommandReturnMessageImpl extends HandleCommandReturnMessageService {
7 |
8 | /**
9 | * 处理命令返回消息
10 | *
11 | * @param object 命令发送者
12 | * @param message 消息
13 | */
14 | @Override
15 | public void handleCommandReturnMessage(Object object, String message) {
16 | CommandSender commandSender = (CommandSender) object;
17 | commandSender.sendMessage(message);
18 | }
19 |
20 | /**
21 | * 判断命令发送者是否有权限执行命令
22 | *
23 | * @param object 命令发送者
24 | * @param node 权限节点
25 | * @return 是否有权限
26 | */
27 | @Override
28 | public boolean hasPermission(Object object, String node) {
29 | CommandSender commandSender = (CommandSender) object;
30 | if (commandSender.hasPermission(node)) return true;
31 | commandSender.sendMessage("您没有权限执行当前命令");
32 | return false;
33 | }
34 | }
--------------------------------------------------------------------------------
/vanilla/origin/src/main/kotlin/com/github/theword/queqiao/QueQiao.kt:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao
2 |
3 | import com.github.theword.queqiao.config.Config
4 | import com.github.theword.queqiao.handle.HandleApiImpl
5 | import com.github.theword.queqiao.handle.HandleCommandReturnMessageImpl
6 | import com.github.theword.queqiao.tool.GlobalContext
7 | import com.github.theword.queqiao.tool.constant.BaseConstant
8 | import com.github.theword.queqiao.tool.constant.ServerTypeConstant
9 | import com.github.theword.queqiao.utils.FileWatcher
10 | import com.github.theword.queqiao.utils.LineProcessor
11 |
12 | object QueQiao {
13 | @JvmStatic
14 | fun main(args: Array) {
15 | GlobalContext.init(
16 | true,
17 | BaseConstant.UNKNOWN,
18 | ServerTypeConstant.ORIGIN,
19 | HandleApiImpl(),
20 | HandleCommandReturnMessageImpl()
21 | )
22 | val config = Config(GlobalContext.getLogger())
23 | FileWatcher.fileListen(
24 | config.logPath,
25 | LineProcessor(
26 | config,
27 | GlobalContext.getConfig(),
28 | GlobalContext.getLogger(), EventProcessor()
29 | )
30 | )
31 | }
32 | }
--------------------------------------------------------------------------------
/cleanroom/origin/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageImpl.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.handle;
2 |
3 | import com.github.theword.queqiao.tool.constant.BaseConstant;
4 | import com.github.theword.queqiao.tool.handle.HandleCommandReturnMessageService;
5 | import net.minecraft.command.ICommandSender;
6 | import net.minecraft.util.text.TextComponentString;
7 |
8 | public class HandleCommandReturnMessageImpl extends HandleCommandReturnMessageService {
9 |
10 | @Override
11 | public void handleCommandReturnMessage(Object object, String message) {
12 | ICommandSender sender = (ICommandSender) object;
13 | sender.sendMessage(new TextComponentString(message));
14 | }
15 |
16 | /**
17 | * 判断发送者是否有权执行命令
18 | * MOD端中无权限节点,权限等级为2
19 | *
20 | * @param object 命令返回者
21 | * @param node 权限节点
22 | * @return boolean 是否有权限
23 | */
24 | @Override
25 | public boolean hasPermission(Object object, String node) {
26 | ICommandSender sender = (ICommandSender) object;
27 | if (sender.canUseCommand(BaseConstant.MOD_PERMISSION_LEVEL,"")) return true;
28 | handleCommandReturnMessage(object, "您没有权限执行此命令");
29 | return false;
30 | }
31 | }
--------------------------------------------------------------------------------
/paper/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ServerCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.PaperSubCommand;
4 | import com.github.theword.queqiao.tool.command.subCommand.ServerCommandAbstract;
5 | import org.bukkit.command.CommandSender;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | public class ServerCommand extends ServerCommandAbstract implements PaperSubCommand {
11 | @Override
12 | public boolean onCommand(CommandSender commandSender, String[] args) {
13 | commandSender.sendMessage("Server commands are not implemented yet.");
14 | return false;
15 | }
16 |
17 | @Override
18 | public List getSubCommands(CommandSender commandSender, String[] args) {
19 | return new ArrayList() {
20 | };
21 | }
22 |
23 | @Override
24 | public String getPrefix() {
25 | return null;
26 | }
27 |
28 | @Override
29 | public String getName() {
30 | return "server";
31 | }
32 |
33 | @Override
34 | public String getDescription() {
35 | return "Websocket Client 的命令";
36 | }
37 |
38 | @Override
39 | public String getUsage() {
40 | return "使用:/mcqq client ";
41 | }
42 | }
--------------------------------------------------------------------------------
/folia/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ServerCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.SpigotSubCommand;
4 | import com.github.theword.queqiao.tool.command.subCommand.ServerCommandAbstract;
5 | import org.bukkit.command.CommandSender;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | public class ServerCommand extends ServerCommandAbstract implements SpigotSubCommand {
11 | @Override
12 | public boolean onCommand(CommandSender commandSender, String[] args) {
13 | commandSender.sendMessage("Server commands are not implemented yet.");
14 | return false;
15 | }
16 |
17 | @Override
18 | public List getSubCommands(CommandSender commandSender, String[] args) {
19 | return new ArrayList() {
20 | };
21 | }
22 |
23 | @Override
24 | public String getPrefix() {
25 | return null;
26 | }
27 |
28 | @Override
29 | public String getName() {
30 | return "server";
31 | }
32 |
33 | @Override
34 | public String getDescription() {
35 | return "Websocket Client 的命令";
36 | }
37 |
38 | @Override
39 | public String getUsage() {
40 | return "使用:/mcqq client ";
41 | }
42 | }
--------------------------------------------------------------------------------
/spigot/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ServerCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.SpigotSubCommand;
4 | import com.github.theword.queqiao.tool.command.subCommand.ServerCommandAbstract;
5 | import org.bukkit.command.CommandSender;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | public class ServerCommand extends ServerCommandAbstract implements SpigotSubCommand {
11 | @Override
12 | public boolean onCommand(CommandSender commandSender, String[] args) {
13 | commandSender.sendMessage("Server commands are not implemented yet.");
14 | return false;
15 | }
16 |
17 | @Override
18 | public List getSubCommands(CommandSender commandSender, String[] args) {
19 | return new ArrayList() {
20 | };
21 | }
22 |
23 | @Override
24 | public String getPrefix() {
25 | return null;
26 | }
27 |
28 | @Override
29 | public String getName() {
30 | return "server";
31 | }
32 |
33 | @Override
34 | public String getDescription() {
35 | return "Websocket Client 的命令";
36 | }
37 |
38 | @Override
39 | public String getUsage() {
40 | return "使用:/mcqq client ";
41 | }
42 | }
--------------------------------------------------------------------------------
/fabric/origin/src/main/java/com/github/theword/queqiao/QueQiao.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao;
2 |
3 | import com.github.theword.queqiao.command.CommandExecutor;
4 | import com.github.theword.queqiao.handle.HandleApiImpl;
5 | import com.github.theword.queqiao.handle.HandleCommandReturnMessageImpl;
6 | import com.github.theword.queqiao.tool.GlobalContext;
7 | import com.github.theword.queqiao.tool.constant.ServerTypeConstant;
8 | import net.fabricmc.api.ModInitializer;
9 | import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
10 | import net.minecraft.server.MinecraftServer;
11 |
12 |
13 | public class QueQiao implements ModInitializer {
14 |
15 | public static MinecraftServer minecraftServer;
16 |
17 |
18 | @Override
19 | public void onInitialize() {
20 | ServerLifecycleEvents.SERVER_STARTED.register(server -> {
21 | minecraftServer = server;
22 | GlobalContext.init(
23 | true,
24 | minecraftServer.getVersion(),
25 | ServerTypeConstant.FABRIC,
26 | new HandleApiImpl(),
27 | new HandleCommandReturnMessageImpl()
28 | );
29 | });
30 |
31 | new CommandExecutor();
32 |
33 | ServerLifecycleEvents.SERVER_STOPPING.register(server -> GlobalContext.shutdown());
34 | }
35 | }
--------------------------------------------------------------------------------
/velocity/origin/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.CommandManager;
4 | import com.github.theword.queqiao.command.VelocitySubCommand;
5 | import com.github.theword.queqiao.tool.GlobalContext;
6 | import com.github.theword.queqiao.tool.command.subCommand.HelpCommandAbstract;
7 | import com.mojang.brigadier.Command;
8 | import com.velocitypowered.api.command.SimpleCommand;
9 |
10 |
11 | public class HelpCommand extends HelpCommandAbstract implements VelocitySubCommand {
12 |
13 | @Override
14 | public int onCommand(SimpleCommand.Invocation invocation) {
15 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(invocation, getPermissionNode())) return 0;
16 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(invocation, "-------------------");
17 | for (VelocitySubCommand forgeSubCommand : new CommandManager().getSubCommandList()) {
18 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(invocation, forgeSubCommand.getUsage() + "---" + forgeSubCommand.getDescription());
19 | }
20 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(invocation, "-------------------");
21 | return Command.SINGLE_SUCCESS;
22 | }
23 | }
--------------------------------------------------------------------------------
/neoforge/origin/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.CommandManager;
4 | import com.github.theword.queqiao.command.NeoForgeSubCommand;
5 | import com.github.theword.queqiao.tool.GlobalContext;
6 | import com.github.theword.queqiao.tool.command.subCommand.HelpCommandAbstract;
7 | import com.mojang.brigadier.Command;
8 | import com.mojang.brigadier.context.CommandContext;
9 |
10 |
11 | public class HelpCommand extends HelpCommandAbstract implements NeoForgeSubCommand {
12 |
13 | @Override
14 | public int onCommand(CommandContext context) {
15 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(context, getPermissionNode())) return 0;
16 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(context, "-------------------");
17 | for (NeoForgeSubCommand forgeSubCommand : new CommandManager().getSubCommandList()) {
18 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(context, forgeSubCommand.getUsage() + "---" + forgeSubCommand.getDescription());
19 | }
20 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(context, "-------------------");
21 | return Command.SINGLE_SUCCESS;
22 |
23 | }
24 | }
--------------------------------------------------------------------------------
/paper/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand.client;
2 |
3 | import com.github.theword.queqiao.command.PaperSubCommand;
4 | import com.github.theword.queqiao.tool.command.subCommand.client.ReconnectCommandAbstract;
5 | import org.bukkit.command.CommandSender;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 |
11 | public class ReconnectCommand extends ReconnectCommandAbstract implements PaperSubCommand {
12 |
13 | @Override
14 | public boolean onCommand(CommandSender commandSender, String[] args) {
15 | if (args.length == 2) {
16 | if (args[1].equalsIgnoreCase("reconnect")) {
17 | execute(commandSender, false);
18 | return true;
19 | }
20 | } else if (args.length == 3) {
21 | if (args[2].equalsIgnoreCase("all")) {
22 | execute(commandSender, true);
23 | return true;
24 | }
25 | }
26 | commandSender.sendMessage(getUsage());
27 | return false;
28 | }
29 |
30 | @Override
31 | public List getSubCommands(CommandSender commandSender, String[] args) {
32 | return new ArrayList() {{
33 | add("all");
34 | }};
35 | }
36 |
37 | @Override
38 | public String getPrefix() {
39 | return "client";
40 | }
41 | }
--------------------------------------------------------------------------------
/folia/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand.client;
2 |
3 | import com.github.theword.queqiao.command.SpigotSubCommand;
4 | import com.github.theword.queqiao.tool.command.subCommand.client.ReconnectCommandAbstract;
5 | import org.bukkit.command.CommandSender;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 |
11 | public class ReconnectCommand extends ReconnectCommandAbstract implements SpigotSubCommand {
12 |
13 | @Override
14 | public boolean onCommand(CommandSender commandSender, String[] args) {
15 | if (args.length == 2) {
16 | if (args[1].equalsIgnoreCase("reconnect")) {
17 | execute(commandSender, false);
18 | return true;
19 | }
20 | } else if (args.length == 3) {
21 | if (args[2].equalsIgnoreCase("all")) {
22 | execute(commandSender, true);
23 | return true;
24 | }
25 | }
26 | commandSender.sendMessage(getUsage());
27 | return false;
28 | }
29 |
30 | @Override
31 | public List getSubCommands(CommandSender commandSender, String[] args) {
32 | return new ArrayList() {{
33 | add("all");
34 | }};
35 | }
36 |
37 | @Override
38 | public String getPrefix() {
39 | return "client";
40 | }
41 | }
--------------------------------------------------------------------------------
/spigot/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand.client;
2 |
3 | import com.github.theword.queqiao.command.SpigotSubCommand;
4 | import com.github.theword.queqiao.tool.command.subCommand.client.ReconnectCommandAbstract;
5 | import org.bukkit.command.CommandSender;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 |
11 | public class ReconnectCommand extends ReconnectCommandAbstract implements SpigotSubCommand {
12 |
13 | @Override
14 | public boolean onCommand(CommandSender commandSender, String[] args) {
15 | if (args.length == 2) {
16 | if (args[1].equalsIgnoreCase("reconnect")) {
17 | execute(commandSender, false);
18 | return true;
19 | }
20 | } else if (args.length == 3) {
21 | if (args[2].equalsIgnoreCase("all")) {
22 | execute(commandSender, true);
23 | return true;
24 | }
25 | }
26 | commandSender.sendMessage(getUsage());
27 | return false;
28 | }
29 |
30 | @Override
31 | public List getSubCommands(CommandSender commandSender, String[] args) {
32 | return new ArrayList() {{
33 | add("all");
34 | }};
35 | }
36 |
37 | @Override
38 | public String getPrefix() {
39 | return "client";
40 | }
41 | }
--------------------------------------------------------------------------------
/vanilla/origin/src/main/kotlin/com/github/theword/queqiao/EventProcessor.kt:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao
2 |
3 | import com.github.theword.queqiao.tool.GlobalContext
4 | import com.github.theword.queqiao.tool.event.PlayerChatEvent
5 | import com.github.theword.queqiao.tool.event.PlayerJoinEvent
6 | import com.github.theword.queqiao.tool.event.PlayerQuitEvent
7 | import com.github.theword.queqiao.tool.event.model.PlayerModel
8 |
9 | class EventProcessor {
10 | /**
11 | * 监听玩家聊天
12 | */
13 | fun onPlayerChat(playerName: String, message: String) {
14 | if (!GlobalContext.getConfig().subscribeEvent.isPlayerChat) return
15 | val player = PlayerModel(playerName)
16 | val event = PlayerChatEvent(player, "", message, message)
17 | GlobalContext.sendEvent(event)
18 | }
19 |
20 |
21 | /**
22 | * 监听玩家加入事件
23 | */
24 | fun onPlayerJoin(playerName: String) {
25 | if (!GlobalContext.getConfig().subscribeEvent.isPlayerJoin) return
26 | val player = PlayerModel(playerName)
27 | val event = PlayerJoinEvent(player)
28 | GlobalContext.sendEvent(event)
29 | }
30 |
31 | /**
32 | * 监听玩家离开事件
33 | */
34 | fun onPlayerQuit(playerName: String) {
35 | if (!GlobalContext.getConfig().subscribeEvent.isPlayerQuit) return
36 | val player = PlayerModel(playerName)
37 | val event = PlayerQuitEvent(player)
38 | GlobalContext.sendEvent(event)
39 | }
40 | }
--------------------------------------------------------------------------------
/neoforge/origin/src/main/java/com/github/theword/queqiao/QueQiao.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao;
2 |
3 | import com.github.theword.queqiao.handle.HandleApiImpl;
4 | import com.github.theword.queqiao.handle.HandleCommandReturnMessageImpl;
5 | import com.github.theword.queqiao.tool.GlobalContext;
6 | import com.github.theword.queqiao.tool.constant.BaseConstant;
7 | import com.github.theword.queqiao.tool.constant.ServerTypeConstant;
8 | import net.minecraft.server.MinecraftServer;
9 | import net.neoforged.bus.api.SubscribeEvent;
10 | import net.neoforged.fml.common.Mod;
11 | import net.neoforged.neoforge.common.NeoForge;
12 | import net.neoforged.neoforge.event.server.ServerStartedEvent;
13 | import net.neoforged.neoforge.event.server.ServerStoppingEvent;
14 |
15 |
16 | @Mod(BaseConstant.MOD_ID)
17 | public class QueQiao {
18 | public static MinecraftServer minecraftServer;
19 |
20 | public QueQiao() {
21 | NeoForge.EVENT_BUS.register(this);
22 | NeoForge.EVENT_BUS.register(new EventProcessor());
23 | }
24 |
25 | @SubscribeEvent
26 | public void ServerStarted(ServerStartedEvent event) {
27 | minecraftServer = event.getServer();
28 | GlobalContext.init(true, minecraftServer.getServerVersion(), ServerTypeConstant.NEOFORGE, new HandleApiImpl(), new HandleCommandReturnMessageImpl());
29 | }
30 |
31 | @SubscribeEvent
32 | public void onServerStopping(ServerStoppingEvent event) {
33 | GlobalContext.shutdown();
34 | }
35 | }
--------------------------------------------------------------------------------
/paper/origin/src/main/java/com/github/theword/queqiao/QueQiao.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao;
2 |
3 | import com.github.theword.queqiao.command.CommandExecutor;
4 | import com.github.theword.queqiao.handle.HandleApiImpl;
5 | import com.github.theword.queqiao.handle.HandleCommandReturnMessageImpl;
6 | import com.github.theword.queqiao.tool.GlobalContext;
7 | import com.github.theword.queqiao.tool.constant.BaseConstant;
8 | import com.github.theword.queqiao.tool.constant.ServerTypeConstant;
9 | import org.bukkit.Bukkit;
10 | import org.bukkit.command.PluginCommand;
11 | import org.bukkit.plugin.java.JavaPlugin;
12 |
13 | public final class QueQiao extends JavaPlugin {
14 |
15 | public static JavaPlugin instance;
16 |
17 | @Override
18 | public void onEnable() {
19 | instance = this;
20 | Bukkit.getScheduler().runTask(this, () -> GlobalContext.init(
21 | false,
22 | instance.getServer().getVersion(),
23 | ServerTypeConstant.SPIGOT,
24 | new HandleApiImpl(),
25 | new HandleCommandReturnMessageImpl()
26 | ));
27 | Bukkit.getPluginManager().registerEvents(new EventProcessor(), this);
28 |
29 | PluginCommand command = getCommand(BaseConstant.COMMAND_HEADER);
30 | if (command != null) command.setExecutor(new CommandExecutor());
31 | }
32 |
33 | @Override
34 | public void onDisable() {
35 | // Plugin shutdown logic
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/spigot/origin/src/main/java/com/github/theword/queqiao/QueQiao.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao;
2 |
3 | import com.github.theword.queqiao.command.CommandExecutor;
4 | import com.github.theword.queqiao.handle.HandleApiImpl;
5 | import com.github.theword.queqiao.handle.HandleCommandReturnMessageImpl;
6 | import com.github.theword.queqiao.tool.GlobalContext;
7 | import com.github.theword.queqiao.tool.constant.BaseConstant;
8 | import com.github.theword.queqiao.tool.constant.ServerTypeConstant;
9 | import org.bukkit.Bukkit;
10 | import org.bukkit.command.PluginCommand;
11 | import org.bukkit.plugin.java.JavaPlugin;
12 |
13 |
14 | public final class QueQiao extends JavaPlugin {
15 |
16 | public static JavaPlugin instance;
17 |
18 | @Override
19 | public void onEnable() {
20 | instance = this;
21 | Bukkit.getScheduler().runTask(this, () -> GlobalContext.init(
22 | false,
23 | instance.getServer().getVersion(),
24 | ServerTypeConstant.SPIGOT,
25 | new HandleApiImpl(),
26 | new HandleCommandReturnMessageImpl()
27 | ));
28 | Bukkit.getPluginManager().registerEvents(new EventProcessor(), this);
29 |
30 | PluginCommand command = getCommand(BaseConstant.COMMAND_HEADER);
31 | if (command != null) command.setExecutor(new CommandExecutor());
32 | }
33 |
34 | @Override
35 | public void onDisable() {
36 | GlobalContext.shutdown();
37 | }
38 | }
--------------------------------------------------------------------------------
/fabric/origin/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.CommandManager;
4 | import com.github.theword.queqiao.command.FabricSubCommand;
5 | import com.github.theword.queqiao.tool.GlobalContext;
6 | import com.github.theword.queqiao.tool.command.SubCommand;
7 | import com.github.theword.queqiao.tool.command.subCommand.HelpCommandAbstract;
8 | import com.mojang.brigadier.Command;
9 | import com.mojang.brigadier.context.CommandContext;
10 | import net.minecraft.server.command.ServerCommandSource;
11 |
12 |
13 | public class HelpCommand extends HelpCommandAbstract implements FabricSubCommand {
14 |
15 |
16 | @Override
17 | public int onCommand(CommandContext context) {
18 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(context, getPermissionNode())) return 0;
19 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(context, "-------------------");
20 | for (SubCommand subCommand : new CommandManager().getSubCommandList()) {
21 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(context, subCommand.getUsage() + "---" + subCommand.getDescription());
22 | }
23 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(context, "-------------------");
24 | return Command.SINGLE_SUCCESS;
25 | }
26 | }
--------------------------------------------------------------------------------
/matrix.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | while [[ $# -gt 0 ]]; do
4 | case $1 in
5 | -path)
6 | IFS=',' read -r -a paths <<< "$2"
7 | shift 2
8 | ;;
9 | *)
10 | echo "Unknown option: $1"
11 | exit 1
12 | ;;
13 | esac
14 | done
15 |
16 | # 用于存储所有文件夹的数组
17 | allFolderObjects=()
18 |
19 | # 遍历每个路径
20 | for path in "${paths[@]}"; do
21 | # 获取指定路径下的文件夹
22 | folders=$(find "$path" -mindepth 1 -maxdepth 1 -type d)
23 |
24 | # 过滤掉名为 "origin" 的文件夹
25 | for folder in $folders; do
26 | folderName=$(basename "$folder")
27 | if [[ "$folderName" != "origin" ]]; then
28 | # 提取 mc-version 和 mc-loader 信息
29 | mcVersion="${folderName//$path-/}"
30 | mcLoader="$path"
31 | supportVersionFile="$mcLoader/$mcLoader-$mcVersion/support_version.txt"
32 | if [[ -f "$supportVersionFile" ]]; then
33 | supportVersion=$(cat "$supportVersionFile")
34 | else
35 | supportVersion="$mcVersion"
36 | fi
37 |
38 | if [ "$mcLoader" == "fabric" ]; then
39 | publishLoaders="fabric quilt"
40 | else
41 | publishLoaders="$mcLoader"
42 | fi
43 | allFolderObjects+=("{\"mc-version\": \"$mcVersion\", \"mc-loader\": \"$mcLoader\", \"publish-loaders\": \"$publishLoaders\", \"publish-version\": \"$supportVersion\"}")
44 | fi
45 | done
46 | done
47 |
48 | # 创建 JSON 格式的输出
49 | json=$(printf "{\"config\":[%s]}" "$(IFS=,; echo "${allFolderObjects[*]}")")
50 |
51 | # 输出最终的 JSON 结果
52 | echo "matrix=$json" >> $GITHUB_OUTPUT
53 |
--------------------------------------------------------------------------------
/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/PlayerManagerMixin.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.mixin;
2 |
3 |
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.event.PlayerJoinEvent;
6 | import net.minecraft.network.ClientConnection;
7 | import net.minecraft.server.PlayerManager;
8 |
9 | // IF >= fabric-1.20.4
10 | //import net.minecraft.server.network.ConnectedClientData;
11 | // END IF
12 | import net.minecraft.server.network.ServerPlayerEntity;
13 | import org.spongepowered.asm.mixin.Mixin;
14 | import org.spongepowered.asm.mixin.injection.At;
15 | import org.spongepowered.asm.mixin.injection.Inject;
16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
17 |
18 | import static com.github.theword.queqiao.utils.FabricTool.getFabricPlayer;
19 |
20 | @Mixin(PlayerManager.class)
21 | public class PlayerManagerMixin {
22 |
23 | @Inject(method = "onPlayerConnect", at = @At("TAIL"))
24 | // IF >= fabric-1.20.4
25 | // private void onPlayerConnect(ClientConnection connection, ServerPlayerEntity player, ConnectedClientData clientData, CallbackInfo ci) {
26 | // ELSE
27 | // private void onPlayerJoin(ClientConnection connection, ServerPlayerEntity player, CallbackInfo ci) {
28 | // END IF
29 | if (!GlobalContext.getConfig().getSubscribeEvent().isPlayerJoin()) return;
30 |
31 | PlayerJoinEvent event = new PlayerJoinEvent(getFabricPlayer(player));
32 | GlobalContext.sendEvent(event);
33 | }
34 | }
--------------------------------------------------------------------------------
/paper/origin/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 |
4 | import com.github.theword.queqiao.command.CommandManager;
5 | import com.github.theword.queqiao.command.PaperSubCommand;
6 | import com.github.theword.queqiao.tool.GlobalContext;
7 | import com.github.theword.queqiao.tool.command.SubCommand;
8 | import com.github.theword.queqiao.tool.command.subCommand.HelpCommandAbstract;
9 | import org.bukkit.command.CommandSender;
10 |
11 | import java.util.ArrayList;
12 | import java.util.List;
13 |
14 | public class HelpCommand extends HelpCommandAbstract implements PaperSubCommand {
15 | @Override
16 | public boolean onCommand(CommandSender commandSender, String[] args) {
17 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(commandSender, getPermissionNode())) return false;
18 | commandSender.sendMessage("-------------------");
19 | for (SubCommand subCommand : new CommandManager().getSubCommandList()) {
20 | commandSender.sendMessage(subCommand.getUsage() + "---" + subCommand.getDescription());
21 | }
22 | commandSender.sendMessage("-------------------");
23 | return true;
24 | }
25 |
26 | @Override
27 | public List getSubCommands(CommandSender commandSender, String[] args) {
28 | return new ArrayList<>();
29 | }
30 |
31 | @Override
32 | public String getPrefix() {
33 | return null;
34 | }
35 | }
--------------------------------------------------------------------------------
/cleanroom/origin/src/main/java/com/github/theword/queqiao/command/ForgeSubCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.github.theword.queqiao.tool.command.SubCommand;
4 | import com.github.theword.queqiao.tool.constant.BaseConstant;
5 | import net.minecraft.command.CommandBase;
6 | import net.minecraft.command.CommandException;
7 | import net.minecraft.command.ICommand;
8 | import net.minecraft.command.ICommandSender;
9 | import net.minecraft.server.MinecraftServer;
10 |
11 |
12 | public abstract class ForgeSubCommand extends CommandBase {
13 | public final SubCommand inner;
14 | public ForgeSubCommand(SubCommand inner){
15 | this.inner=inner;
16 | }
17 |
18 | @Override
19 | public String getName(){
20 | return inner.getName();
21 | }
22 |
23 | @Override
24 | public String getUsage(ICommandSender sender){
25 | return inner.getUsage();
26 | }
27 |
28 | public abstract int onCommand(ICommandSender sender);
29 |
30 | @Override
31 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException{
32 | int result = onCommand(sender);
33 | }
34 |
35 | @Override
36 | public boolean checkPermission(MinecraftServer server, ICommandSender sender){
37 | return sender.canUseCommand(BaseConstant.MOD_PERMISSION_LEVEL,"");
38 | };
39 |
40 | @Override
41 | public int compareTo(ICommand o) {
42 | return this.getName().compareTo(o.getName());
43 | }
44 | }
--------------------------------------------------------------------------------
/spigot/origin/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 |
4 | import com.github.theword.queqiao.command.CommandManager;
5 | import com.github.theword.queqiao.command.SpigotSubCommand;
6 | import com.github.theword.queqiao.tool.GlobalContext;
7 | import com.github.theword.queqiao.tool.command.SubCommand;
8 | import com.github.theword.queqiao.tool.command.subCommand.HelpCommandAbstract;
9 | import org.bukkit.command.CommandSender;
10 |
11 | import java.util.ArrayList;
12 | import java.util.List;
13 |
14 | public class HelpCommand extends HelpCommandAbstract implements SpigotSubCommand {
15 | @Override
16 | public boolean onCommand(CommandSender commandSender, String[] args) {
17 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(commandSender, getPermissionNode())) return false;
18 | commandSender.sendMessage("-------------------");
19 | for (SubCommand subCommand : new CommandManager().getSubCommandList()) {
20 | commandSender.sendMessage(subCommand.getUsage() + "---" + subCommand.getDescription());
21 | }
22 | commandSender.sendMessage("-------------------");
23 | return true;
24 | }
25 |
26 | @Override
27 | public List getSubCommands(CommandSender commandSender, String[] args) {
28 | return new ArrayList<>();
29 | }
30 |
31 | @Override
32 | public String getPrefix() {
33 | return null;
34 | }
35 | }
--------------------------------------------------------------------------------
/folia/origin/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 |
4 | import com.github.theword.queqiao.command.CommandManager;
5 | import com.github.theword.queqiao.command.SpigotSubCommand;
6 | import com.github.theword.queqiao.tool.GlobalContext;
7 | import com.github.theword.queqiao.tool.command.SubCommand;
8 | import com.github.theword.queqiao.tool.command.subCommand.HelpCommandAbstract;
9 | import org.bukkit.command.CommandSender;
10 |
11 | import java.util.ArrayList;
12 | import java.util.List;
13 |
14 |
15 | public class HelpCommand extends HelpCommandAbstract implements SpigotSubCommand {
16 | @Override
17 | public boolean onCommand(CommandSender commandSender, String[] args) {
18 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(commandSender, getPermissionNode())) return false;
19 | commandSender.sendMessage("-------------------");
20 | for (SubCommand subCommand : new CommandManager().getSubCommandList()) {
21 | commandSender.sendMessage(subCommand.getUsage() + "---" + subCommand.getDescription());
22 | }
23 | commandSender.sendMessage("-------------------");
24 | return true;
25 | }
26 |
27 | @Override
28 | public List getSubCommands(CommandSender commandSender, String[] args) {
29 | return new ArrayList<>();
30 | }
31 |
32 | @Override
33 | public String getPrefix() {
34 | return null;
35 | }
36 | }
--------------------------------------------------------------------------------
/forge/origin/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx3G
2 | org.gradle.daemon=false
3 | # Mod Properties
4 | mod_id=queqiao
5 | mod_name=QueQiao
6 | mod_license=MIT
7 | mod_group_id=com.github.theword.queqiao
8 | mod_authors=17TheWord
9 | mod_description=Connect to nonebot2.
10 | # Lib Properties
11 | glavo_rcon_version=3.0
12 | snakeyaml_version=2.2
13 | junit_jupiter_version=5.11.4
14 | java_websocket_version=1.5.3
15 | maven_repository_url=https://maven.pkg.github.com/17TheWord/QueQiaoTool
16 | # JDK Version
17 | # IF <= forge-1.16.5
18 | #java_version=8
19 | # ELSE IF >= forge-1.20.5
20 | #java_version=21
21 | # ELSE
22 | #java_version=17
23 | # END IF
24 | # Forge Properties
25 | mapping_channel=official
26 | # IF forge-1.16.5
27 | #minecraft_version=1.16.5
28 | #mapping_version=1.16.5
29 | #forge_version_range=[36,)
30 | #minecraft_version_range=[1.16.5,1.17)
31 | #forge_version=36.2.34
32 | #slf4j_version=1.8.0-beta4
33 | # ELSE IF forge-1.18.2
34 | #minecraft_version=1.18.2
35 | #forge_version=40.2.0
36 | #forge_version_range=[40,)
37 | #minecraft_version_range=[1.18.2,1.19)
38 | # ELSE IF forge-1.19.2
39 | #minecraft_version=1.19.2
40 | #forge_version=43.3.0
41 | #forge_version_range=[43,)
42 | #minecraft_version_range=[1.19.2,1.20)
43 | # ELSE IF forge-1.20.1
44 | #minecraft_version=1.20.1
45 | #forge_version=47.2.20
46 | #forge_version_range=[47,)
47 | #minecraft_version_range=[1.20.1,1.21)
48 | # ELSE IF forge-1.21
49 | #minecraft_version=1.21
50 | #forge_version=51.0.17
51 | #forge_version_range=[51,)
52 | #minecraft_version_range=[1.21,1.22)
53 | # END IF
--------------------------------------------------------------------------------
/forge/origin/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.CommandManager;
4 | import com.github.theword.queqiao.command.ForgeSubCommand;
5 | import com.github.theword.queqiao.tool.GlobalContext;
6 | import com.github.theword.queqiao.tool.command.subCommand.HelpCommandAbstract;
7 | import com.mojang.brigadier.Command;
8 | import com.mojang.brigadier.context.CommandContext;
9 |
10 |
11 | public class HelpCommand extends HelpCommandAbstract implements ForgeSubCommand {
12 |
13 | @Override
14 | // IF > forge-1.16.5
15 | // public int onCommand(CommandContext context) {
16 | // ELSE
17 | // public int onCommand(CommandContext context) {
18 | // END IF
19 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(context, getPermissionNode())) return 0;
20 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(context, "-------------------");
21 | for (ForgeSubCommand forgeSubCommand : new CommandManager().getSubCommandList()) {
22 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(context, forgeSubCommand.getUsage() + "---" + forgeSubCommand.getDescription());
23 | }
24 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(context, "-------------------");
25 | return Command.SINGLE_SUCCESS;
26 |
27 | }
28 | }
--------------------------------------------------------------------------------
/neoforge/origin/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageImpl.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.handle;
2 |
3 | import com.github.theword.queqiao.tool.constant.BaseConstant;
4 | import com.github.theword.queqiao.tool.handle.HandleCommandReturnMessageService;
5 | import com.mojang.brigadier.context.CommandContext;
6 | import net.minecraft.network.chat.contents.PlainTextContents;
7 |
8 | public class HandleCommandReturnMessageImpl extends HandleCommandReturnMessageService {
9 |
10 | @Override
11 | @SuppressWarnings("unchecked")
12 | public void handleCommandReturnMessage(Object object, String message) {
13 | CommandContext context = (CommandContext) object;
14 | context.getSource().sendSystemMessage(net.minecraft.network.chat.MutableComponent.create(new PlainTextContents.LiteralContents(message)));
15 | }
16 |
17 | /**
18 | * 判断发送者是否有权执行命令
19 | * MOD端中无权限节点,权限等级为2
20 | *
21 | * @param object 命令返回者
22 | * @param node 权限节点
23 | * @return boolean 是否有权限
24 | */
25 | @Override
26 | @SuppressWarnings("unchecked")
27 | public boolean hasPermission(Object object, String node) {
28 | CommandContext context = (CommandContext) object;
29 | if (context.getSource().hasPermission(BaseConstant.MOD_PERMISSION_LEVEL)) return true;
30 | handleCommandReturnMessage(object, "您没有权限执行此命令");
31 | return false;
32 | }
33 | }
--------------------------------------------------------------------------------
/cleanroom/origin/src/main/java/com/github/theword/queqiao/command/subCommand/client/ReconnectCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand.client;
2 |
3 | import com.github.theword.queqiao.command.ForgeSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.client.ReconnectCommandAbstract;
6 | import net.minecraft.command.ICommandSender;
7 | import net.minecraft.server.MinecraftServer;
8 | import net.minecraft.util.math.BlockPos;
9 |
10 | import javax.annotation.Nullable;
11 | import java.util.Collections;
12 | import java.util.List;
13 | import java.util.Objects;
14 |
15 |
16 | public class ReconnectCommand extends ForgeSubCommand {
17 |
18 |
19 | public ReconnectCommand() {
20 | super(new InnerReconnectCommand());
21 | }
22 |
23 | public static class InnerReconnectCommand extends ReconnectCommandAbstract{
24 |
25 | }
26 | @Override
27 | public int onCommand(ICommandSender sender) {
28 | return 0;
29 | }
30 | @Override
31 | public List getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos targetPos) {
32 | if(args.length==1) return Collections.singletonList("all");
33 | return Collections.emptyList();
34 | }
35 | @Override
36 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) {
37 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(sender, inner.getPermissionNode())) return;
38 | inner.execute(sender, args.length>0 && Objects.equals(args[0], "all"));
39 | }
40 | }
--------------------------------------------------------------------------------
/cleanroom/origin/src/main/java/com/github/theword/queqiao/command/subCommand/HelpCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.ForgeSubCommand;
4 | import com.github.theword.queqiao.tool.GlobalContext;
5 | import com.github.theword.queqiao.tool.command.subCommand.HelpCommandAbstract;
6 | import net.minecraft.command.ICommand;
7 | import net.minecraft.command.ICommandSender;
8 | import net.minecraftforge.server.command.CommandTreeBase;
9 |
10 |
11 | public class HelpCommand extends ForgeSubCommand {
12 | CommandTreeBase commandTree;
13 |
14 | public HelpCommand(CommandTreeBase tree){
15 | super(new InnerHelpCommand());
16 | this.commandTree=tree;
17 | }
18 |
19 | public static class InnerHelpCommand extends HelpCommandAbstract {
20 |
21 | }
22 |
23 | @Override
24 | public int onCommand(ICommandSender sender) {
25 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(sender, inner.getPermissionNode())) return 0;
26 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(sender, "-------------------");
27 | for (ICommand subCommand : commandTree.getSubCommands()) {
28 | if(!(subCommand instanceof ForgeSubCommand)) continue;
29 | ForgeSubCommand forgeSubCommand = (ForgeSubCommand) subCommand;
30 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(sender, forgeSubCommand.getUsage(sender) + "---" + forgeSubCommand.inner.getDescription());
31 | }
32 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(sender, "-------------------");
33 | return 1;
34 | }
35 | }
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.yml:
--------------------------------------------------------------------------------
1 | name: 错误反馈
2 | description: 在使用过程中遇到问题时,请选择该模板提交反馈
3 | title: "[Bug](在此简述碰到的问题)"
4 | assignees: 17TheWord
5 | labels: [ "bug" ]
6 | body:
7 | - type: markdown
8 | attributes:
9 | value: |
10 | ## 请补全标题并填写下方内容
11 |
12 | - type: input
13 | id: run-env
14 | attributes:
15 | label: 运行环境
16 | description: 系统以及Java版本
17 | placeholder: Ubuntu 20.04 LTS OpenJDK-21
18 | validations:
19 | required: true
20 |
21 | - type: input
22 | id: queqiao-version
23 | attributes:
24 | label: 鹊桥版本号
25 | description: 0.0.1 或 0.0.2 等版本号
26 | placeholder: 0.0.1
27 | validations:
28 | required: true
29 |
30 | - type: input
31 | id: server-info
32 | attributes:
33 | label: 服务端信息
34 | description: 输入你的服务端jar的信息
35 | placeholder: purpur 1.20.1 2058
36 | validations:
37 | required: true
38 |
39 | - type: textarea
40 | id: reproduce-step
41 | attributes:
42 | label: 复现问题的步骤
43 | render: markdown
44 | description: 请提供复现问题的步骤,如果不能,请写明原因
45 | placeholder: |
46 | 干净清晰的复现步骤有助于开发者更快定位问题所在,你所遇到的问题也会获得更高的优先级.
47 |
48 | 示例步骤:
49 | 1. 开启服务器
50 | 3. 建立 正向/反向 Websocket 连接
51 | 4. 接收/解析 ... 消息失败
52 | 5. 发现问题
53 | validations:
54 | required: true
55 |
56 | - type: textarea
57 | id: logs
58 | attributes:
59 | label: 错误日志
60 | render: markdown
61 | description: 请提供完整的错误日志,以便开发者更快定位问题所在
62 | validations:
63 | required: true
64 |
65 | - type: textarea
66 | id: screenshots
67 | attributes:
68 | label: 截图
69 | description: 如果可以,提交截图更有助于我们分析问题
70 |
71 | - type: textarea
72 | id: additional-context
73 | attributes:
74 | label: 备注
75 | description: 添加你认为有必要的信息
76 |
--------------------------------------------------------------------------------
/paper/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ClientCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.PaperSubCommand;
4 | import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
5 | import com.github.theword.queqiao.tool.GlobalContext;
6 | import com.github.theword.queqiao.tool.command.subCommand.ClientCommandAbstract;
7 | import org.bukkit.command.CommandSender;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 |
13 | public class ClientCommand extends ClientCommandAbstract implements PaperSubCommand {
14 | @Override
15 | public boolean onCommand(CommandSender commandSender, String[] args) {
16 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(commandSender, getPermissionNode())) return false;
17 | if (args.length == 0) {
18 | commandSender.sendMessage("§c请输入子命令");
19 | return false;
20 | } else if (args[1].equalsIgnoreCase("reconnect")) {
21 | return new ReconnectCommand().onCommand(commandSender, args);
22 | }
23 | return false;
24 | }
25 |
26 | @Override
27 | public List getSubCommands(CommandSender commandSender, String[] args) {
28 | return new ArrayList() {{
29 | add("reconnect");
30 | add("list");
31 | }};
32 | }
33 |
34 | @Override
35 | public String getPrefix() {
36 | return null;
37 | }
38 |
39 | @Override
40 | public String getName() {
41 | return "client";
42 | }
43 |
44 | @Override
45 | public String getDescription() {
46 | return "Websocket Client 的命令";
47 | }
48 |
49 | @Override
50 | public String getUsage() {
51 | return "使用:/mcqq client ";
52 | }
53 | }
--------------------------------------------------------------------------------
/fabric/origin/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageImpl.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.handle;
2 |
3 | import com.github.theword.queqiao.tool.handle.HandleCommandReturnMessageService;
4 | import com.mojang.brigadier.context.CommandContext;
5 | import net.minecraft.server.command.ServerCommandSource;
6 | import net.minecraft.server.network.ServerPlayerEntity;
7 | import net.minecraft.text.Text;
8 |
9 | import static com.github.theword.queqiao.utils.FabricTool.permissionCheck;
10 |
11 | public class HandleCommandReturnMessageImpl extends HandleCommandReturnMessageService {
12 |
13 | /**
14 | * @param object 命令返回者
15 | * @param message 返回消息
16 | */
17 | @Override
18 | @SuppressWarnings("unchecked")
19 | public void handleCommandReturnMessage(Object object, String message) {
20 | CommandContext context = (CommandContext) object;
21 | if (context.getSource().getEntity() instanceof ServerPlayerEntity)
22 | // IF >= fabric-1.20
23 | // context.getSource().sendFeedback(() -> Text.of(message), false);
24 | // ELSE
25 | // context.getSource().sendFeedback(Text.of(message), false);
26 | // END IF
27 | }
28 |
29 | /**
30 | * 判断发送者是否有权执行命令
31 | * MOD端中无权限节点,权限等级为2
32 | *
33 | * @param object 命令返回者
34 | * @param node 权限节点
35 | * @return boolean 是否有权限
36 | */
37 | @Override
38 | @SuppressWarnings("unchecked")
39 | public boolean hasPermission(Object object, String node) {
40 | CommandContext context = (CommandContext) object;
41 | if (permissionCheck(context.getSource())) return true;
42 | handleCommandReturnMessage(object, "你没有权限执行此命令");
43 | return false;
44 | }
45 | }
--------------------------------------------------------------------------------
/folia/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ClientCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.SpigotSubCommand;
4 | import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
5 | import com.github.theword.queqiao.tool.GlobalContext;
6 | import com.github.theword.queqiao.tool.command.subCommand.ClientCommandAbstract;
7 | import org.bukkit.command.CommandSender;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 |
13 | public class ClientCommand extends ClientCommandAbstract implements SpigotSubCommand {
14 | @Override
15 | public boolean onCommand(CommandSender commandSender, String[] args) {
16 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(commandSender, getPermissionNode())) return false;
17 | if (args.length == 0) {
18 | commandSender.sendMessage("§c请输入子命令");
19 | return false;
20 | } else if (args[1].equalsIgnoreCase("reconnect")) {
21 | return new ReconnectCommand().onCommand(commandSender, args);
22 | }
23 | return false;
24 | }
25 |
26 | @Override
27 | public List getSubCommands(CommandSender commandSender, String[] args) {
28 | return new ArrayList() {{
29 | add("reconnect");
30 | add("list");
31 | }};
32 | }
33 |
34 | @Override
35 | public String getPrefix() {
36 | return null;
37 | }
38 |
39 | @Override
40 | public String getName() {
41 | return "client";
42 | }
43 |
44 | @Override
45 | public String getDescription() {
46 | return "Websocket Client 的命令";
47 | }
48 |
49 | @Override
50 | public String getUsage() {
51 | return "使用:/mcqq client ";
52 | }
53 | }
--------------------------------------------------------------------------------
/spigot/origin/src/main/java/com/github/theword/queqiao/command/subCommand/ClientCommand.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command.subCommand;
2 |
3 | import com.github.theword.queqiao.command.SpigotSubCommand;
4 | import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
5 | import com.github.theword.queqiao.tool.GlobalContext;
6 | import com.github.theword.queqiao.tool.command.subCommand.ClientCommandAbstract;
7 | import org.bukkit.command.CommandSender;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 |
13 | public class ClientCommand extends ClientCommandAbstract implements SpigotSubCommand {
14 | @Override
15 | public boolean onCommand(CommandSender commandSender, String[] args) {
16 | if (!GlobalContext.getHandleCommandReturnMessageService().hasPermission(commandSender, getPermissionNode())) return false;
17 | if (args.length == 0) {
18 | commandSender.sendMessage("§c请输入子命令");
19 | return false;
20 | } else if (args[1].equalsIgnoreCase("reconnect")) {
21 | return new ReconnectCommand().onCommand(commandSender, args);
22 | }
23 | return false;
24 | }
25 |
26 | @Override
27 | public List getSubCommands(CommandSender commandSender, String[] args) {
28 | return new ArrayList() {{
29 | add("reconnect");
30 | add("list");
31 | }};
32 | }
33 |
34 | @Override
35 | public String getPrefix() {
36 | return null;
37 | }
38 |
39 | @Override
40 | public String getName() {
41 | return "client";
42 | }
43 |
44 | @Override
45 | public String getDescription() {
46 | return "Websocket Client 的命令";
47 | }
48 |
49 | @Override
50 | public String getUsage() {
51 | return "使用:/mcqq client ";
52 | }
53 | }
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Create Release
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | permissions:
9 | contents: write
10 |
11 | env:
12 | GH_TOKEN: ${{ github.token }}
13 |
14 | jobs:
15 | create-release:
16 | runs-on: ubuntu-latest
17 | steps:
18 | - uses: actions/checkout@v4
19 | - name: Read version.txt and save to variable
20 | shell: pwsh
21 | run: |
22 | $mod_version = Get-Content version.txt
23 | Write-Host "Version: $mod_version"
24 | echo "MOD_VERSION=$mod_version" | Out-File -Append -Encoding utf8 -FilePath $env:GITHUB_ENV
25 |
26 | - name: Check if Release exists
27 | id: check-release
28 | run: |
29 | # Check if the release exists
30 | RESPONSE=$(gh release view v${{ env.MOD_VERSION }} -R ${{ github.repository }} 2>&1 || true)
31 | if echo "$RESPONSE" | grep -q "Not Found"; then
32 | echo "Release v${{ env.MOD_VERSION }} does not exist. Skipping deletion."
33 | echo "RELEASE_EXISTS=false" >> $GITHUB_ENV
34 | else
35 | echo "Release v${{ env.MOD_VERSION }} exists."
36 | echo "RELEASE_EXISTS=true" >> $GITHUB_ENV
37 | fi
38 |
39 | - name: Delete Release if exists
40 | run: |
41 | # Try to delete the release and handle errors gracefully
42 | set +e
43 | gh release delete v${{ env.MOD_VERSION }} -R ${{ github.repository }} -y --cleanup-tag
44 | if [ $? -eq 0 ]; then
45 | echo "Release v${{ env.MOD_VERSION }} deleted successfully."
46 | else
47 | echo "Failed to delete release v${{ env.MOD_VERSION }}. It might not exist or there might be another issue."
48 | fi
49 |
50 | - name: Create Release with temp note
51 | run: gh release create v${{ env.MOD_VERSION }} --generate-notes
--------------------------------------------------------------------------------
/forge/origin/src/main/java/com/github/theword/queqiao/QueQiao.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao;
2 |
3 | import com.github.theword.queqiao.handle.HandleApiImpl;
4 | import com.github.theword.queqiao.handle.HandleCommandReturnMessageImpl;
5 | import com.github.theword.queqiao.tool.GlobalContext;
6 | import com.github.theword.queqiao.tool.constant.BaseConstant;
7 | import com.github.theword.queqiao.tool.constant.ServerTypeConstant;
8 | import net.minecraft.server.MinecraftServer;
9 | import net.minecraftforge.api.distmarker.Dist;
10 | import net.minecraftforge.api.distmarker.OnlyIn;
11 | import net.minecraftforge.common.MinecraftForge;
12 | import net.minecraftforge.eventbus.api.SubscribeEvent;
13 | import net.minecraftforge.fml.common.Mod;
14 |
15 |
16 | @Mod(BaseConstant.MOD_ID)
17 | public class QueQiao {
18 | public static MinecraftServer minecraftServer;
19 |
20 | public QueQiao() {
21 | MinecraftForge.EVENT_BUS.register(this);
22 | MinecraftForge.EVENT_BUS.register(new EventProcessor());
23 | }
24 |
25 | @OnlyIn(Dist.DEDICATED_SERVER)
26 | @SubscribeEvent
27 | // IF > forge-1.16.5
28 | // public void onServerStarted(net.minecraftforge.event.server.ServerStartedEvent event) {
29 | // ELSE
30 | // public void onServerStarted(net.minecraftforge.fml.event.server.FMLServerStartedEvent event) {
31 | // END IF
32 | minecraftServer = event.getServer();
33 | GlobalContext.init(true, minecraftServer.getServerVersion(), ServerTypeConstant.FORGE, new HandleApiImpl(), new HandleCommandReturnMessageImpl());
34 | }
35 |
36 | @OnlyIn(Dist.DEDICATED_SERVER)
37 | @SubscribeEvent
38 | // IF > forge-1.16.5
39 | // public void onServerStopping(net.minecraftforge.event.server.ServerStoppingEvent event) {
40 | // ELSE
41 | // public void onServerStopping(net.minecraftforge.fml.event.server.FMLServerStoppingEvent event) {
42 | // END IF
43 | GlobalContext.shutdown();
44 | }
45 | }
--------------------------------------------------------------------------------
/folia/origin/src/main/java/com/github/theword/queqiao/utils/FoliaTool.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.utils;
2 |
3 | import com.github.theword.queqiao.tool.event.model.PlayerModel;
4 | import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
5 | import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
6 | import net.kyori.adventure.text.Component;
7 | import org.bukkit.entity.Player;
8 |
9 |
10 | public class FoliaTool {
11 |
12 | public static String getComponentText(Component component) {
13 | return PlainTextComponentSerializer.plainText().serialize(component);
14 | }
15 |
16 | public static String getComponentJson(Component component) {
17 | return GsonComponentSerializer.gson().serialize(component);
18 | }
19 |
20 |
21 | /**
22 | * 获取SpigotPlayer
23 | *
24 | * @param foliaPlayer 玩家
25 | * @return FoliaPlayer
26 | */
27 | public static PlayerModel getFoliaPlayer(Player foliaPlayer) {
28 | PlayerModel playerModel = new PlayerModel();
29 | playerModel.setNickname(foliaPlayer.getName());
30 | playerModel.setUuid(foliaPlayer.getUniqueId());
31 |
32 | if (foliaPlayer.getAddress() != null)
33 | playerModel.setAddress(foliaPlayer.getAddress().getHostString());
34 |
35 | playerModel.setHealth(foliaPlayer.getHealth());
36 | // playerModel.setMaxHealth(foliaPlayer.getMaxHealth()); // Deprecated
37 | playerModel.setExperienceLevel(foliaPlayer.getLevel());
38 | playerModel.setExperienceProgress((double) foliaPlayer.getExp());
39 | playerModel.setTotalExperience(foliaPlayer.getTotalExperience());
40 |
41 | playerModel.setOp(foliaPlayer.isOp());
42 | playerModel.setWalkSpeed((double) foliaPlayer.getWalkSpeed());
43 | playerModel.setX(foliaPlayer.getLocation().getX());
44 | playerModel.setY(foliaPlayer.getLocation().getY());
45 | playerModel.setZ(foliaPlayer.getLocation().getZ());
46 |
47 | return playerModel;
48 | }
49 | }
--------------------------------------------------------------------------------
/vanilla/origin/src/main/kotlin/com/github/theword/queqiao/config/Config.kt:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.config
2 |
3 | import com.github.theword.queqiao.tool.GlobalContext
4 | import com.github.theword.queqiao.tool.config.CommonConfig
5 | import org.slf4j.Logger
6 |
7 |
8 | class Config(logger: Logger) : CommonConfig(logger) {
9 | var logPath: String = ".\\logs\\latest.log"
10 | var chatRegexSet: Set = emptySet()
11 | var joinRegexSet: Set = emptySet()
12 | var quitRegexSet: Set = emptySet()
13 |
14 | init {
15 | readConfigFile("", "regex.yml")
16 | }
17 |
18 | override fun loadConfigValues(configMap: Map) {
19 | logPath = configMap["log_path"] as String? ?: "./logs/latest.log"
20 | chatRegexSet = convertToRegexConfigSet(configMap, "chat_regex")
21 | joinRegexSet = convertToRegexConfigSet(configMap, "join_regex")
22 | quitRegexSet = convertToRegexConfigSet(configMap, "quit_regex")
23 | }
24 |
25 | private fun convertToRegexConfigSet(configMap: Map, key: String): Set {
26 | val value = configMap[key]
27 | if (value !is List<*>) {
28 | GlobalContext.getLogger().warn("配置项 {} 不是列表类型,将使用空集合。", key)
29 | return emptySet()
30 | }
31 | return value.mapNotNull { item ->
32 | if (item is Map<*, *>) {
33 | val regex = item["regex"] as? String
34 | val playerGroup = item["player_group"] as? Int
35 | val messageGroup = item["message_group"] as? Int
36 | if (regex != null && playerGroup != null) {
37 | RegexConfig(regex, playerGroup, messageGroup)
38 | } else {
39 | GlobalContext.getLogger().warn("配置项 {} 中包含无效的 Map,将跳过该值。", key)
40 | null
41 | }
42 | } else {
43 | GlobalContext.getLogger().warn("配置项 {} 中包含非Map类型,将跳过该值。", key)
44 | null
45 | }
46 | }.toSet()
47 | }
48 | }
--------------------------------------------------------------------------------
/velocity/origin/src/main/java/com/github/theword/queqiao/QueQiao.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao;
2 |
3 | import com.github.theword.queqiao.command.CommandExecutor;
4 | import com.github.theword.queqiao.handle.HandleApiImpl;
5 | import com.github.theword.queqiao.handle.HandleCommandReturnMessageImpl;
6 | import com.github.theword.queqiao.tool.GlobalContext;
7 | import com.github.theword.queqiao.tool.constant.BaseConstant;
8 | import com.github.theword.queqiao.tool.constant.ServerTypeConstant;
9 | import com.google.inject.Inject;
10 | import com.velocitypowered.api.command.CommandMeta;
11 | import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
12 | import com.velocitypowered.api.event.Subscribe;
13 | import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
14 | import com.velocitypowered.api.plugin.Plugin;
15 | import com.velocitypowered.api.proxy.ProxyServer;
16 |
17 |
18 | @Plugin(id = BaseConstant.MOD_ID, name = BaseConstant.MODULE_NAME, version = BuildConstants.VERSION)
19 | public class QueQiao {
20 |
21 | public static ProxyServer minecraftServer;
22 |
23 | @Inject
24 | public QueQiao(ProxyServer server) {
25 | minecraftServer = server;
26 | }
27 |
28 | @Subscribe
29 | public void onProxyInitialization(ProxyInitializeEvent event) {
30 | GlobalContext.init(
31 | false,
32 | minecraftServer.getVersion().getVersion(),
33 | ServerTypeConstant.VELOCITY,
34 | new HandleApiImpl(),
35 | new HandleCommandReturnMessageImpl()
36 | );
37 | minecraftServer.getEventManager().register(this, new EventProcessor());
38 | CommandExecutor commandExecutor = new CommandExecutor();
39 | CommandMeta meta = minecraftServer.getCommandManager().metaBuilder(BaseConstant.COMMAND_HEADER)
40 | .aliases("qq")
41 | .build();
42 | minecraftServer.getCommandManager().register(meta, commandExecutor);
43 | }
44 |
45 | @Subscribe
46 | public void onProxyShutdown(ProxyShutdownEvent event) {
47 | GlobalContext.shutdown();
48 | }
49 |
50 | }
--------------------------------------------------------------------------------
/spigot/origin/src/main/java/com/github/theword/queqiao/utils/SpigotTool.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.utils;
2 |
3 | import com.github.theword.queqiao.tool.event.model.PlayerModel;
4 | import com.github.theword.queqiao.tool.event.model.achievement.AchievementModel;
5 | import com.github.theword.queqiao.tool.event.model.achievement.DisplayModel;
6 | import com.google.gson.JsonElement;
7 | import net.md_5.bungee.api.chat.BaseComponent;
8 | import net.md_5.bungee.chat.ComponentSerializer;
9 | import org.bukkit.advancement.Advancement;
10 |
11 | import org.bukkit.entity.Player;
12 |
13 |
14 | public class SpigotTool {
15 | /**
16 | * 获取SpigotPlayer
17 | *
18 | * @param player 玩家
19 | * @return SpigotPlayer
20 | */
21 | public static PlayerModel getSpigotPlayer(Player player) {
22 | PlayerModel playerModel = new PlayerModel();
23 | playerModel.setNickname(player.getName());
24 | playerModel.setUuid(player.getUniqueId());
25 | playerModel.setOp(player.isOp());
26 | playerModel.setHealth(player.getHealth());
27 | // playerModel.setMaxHealth(player.getMaxHealth()); // Deprecated
28 | playerModel.setExperienceLevel(player.getLevel());
29 | playerModel.setExperienceProgress((double) player.getExp());
30 | playerModel.setTotalExperience(player.getTotalExperience());
31 |
32 | playerModel.setWalkSpeed((double) player.getWalkSpeed());
33 | playerModel.setX(player.getLocation().getX());
34 | playerModel.setY(player.getLocation().getY());
35 | playerModel.setZ(player.getLocation().getZ());
36 | return playerModel;
37 | }
38 |
39 |
40 | public static AchievementModel getSpigotAdvancement(Advancement advancement) {
41 | AchievementModel achievementModel = new AchievementModel();
42 | achievementModel.setKey(advancement.getKey().toString());
43 | DisplayModel displayModel = new DisplayModel();
44 | achievementModel.setDisplay(displayModel);
45 | return achievementModel;
46 | }
47 |
48 | public static BaseComponent[] buildComponent(JsonElement jsonElement) {
49 | return ComponentSerializer.parse(jsonElement.toString());
50 | }
51 | }
--------------------------------------------------------------------------------
/vanilla/origin/src/main/kotlin/com/github/theword/queqiao/utils/LineProcessor.kt:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.utils
2 |
3 | import com.github.theword.queqiao.EventProcessor
4 | import com.github.theword.queqiao.config.Config
5 | import org.slf4j.Logger
6 |
7 | class LineProcessor(
8 | private val regexConfig: Config,
9 | private val config: com.github.theword.queqiao.tool.config.Config,
10 | private val logger: Logger,
11 | private val eventProcessor: EventProcessor
12 | ) {
13 |
14 | fun processLine(line: String) {
15 | logger.debug("LogWatcher: $line")
16 | if (config.subscribeEvent.isPlayerChat)
17 | regexConfig.chatRegexSet.forEach { chatConfig ->
18 | val chatMatcher = chatConfig.pattern.matcher(line)
19 | if (chatMatcher.find()) {
20 | val playerName = chatMatcher.group(chatConfig.playerGroup)
21 | val message = chatMatcher.group(chatConfig.messageGroup!!)
22 | if (message != null && message.isNotEmpty()) {
23 | logger.info("[Chat] $playerName: $message")
24 | eventProcessor.onPlayerChat(playerName, message)
25 | }
26 | return
27 | }
28 | }
29 |
30 | if (config.subscribeEvent.isPlayerJoin)
31 | regexConfig.joinRegexSet.forEach { joinConfig ->
32 | val joinMatcher = joinConfig.pattern.matcher(line)
33 | if (joinMatcher.find()) {
34 | logger.info("[Join] $line")
35 | val playerName = joinMatcher.group(joinConfig.playerGroup)
36 | eventProcessor.onPlayerJoin(playerName)
37 | return
38 | }
39 | }
40 |
41 | if (config.subscribeEvent.isPlayerQuit)
42 | regexConfig.quitRegexSet.forEach { quitConfig ->
43 | val quitMatcher = quitConfig.pattern.matcher(line)
44 | if (quitMatcher.find()) {
45 | logger.info("[Quit] $line")
46 | val playerName = quitMatcher.group(quitConfig.playerGroup)
47 | eventProcessor.onPlayerQuit(playerName)
48 | return
49 | }
50 | }
51 | }
52 | }
--------------------------------------------------------------------------------
/cleanroom/origin/src/main/java/com/github/theword/queqiao/QueQiao.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao;
2 |
3 | import com.github.theword.queqiao.command.CommandTreeQueQiao;
4 | import com.github.theword.queqiao.handle.HandleApiImpl;
5 | import com.github.theword.queqiao.handle.HandleCommandReturnMessageImpl;
6 | import com.github.theword.queqiao.tool.GlobalContext;
7 | import com.github.theword.queqiao.tool.constant.BaseConstant;
8 | import com.github.theword.queqiao.tool.constant.ServerTypeConstant;
9 | import net.minecraft.server.MinecraftServer;
10 | import net.minecraftforge.common.MinecraftForge;
11 | import net.minecraftforge.fml.common.Mod;
12 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
13 | import net.minecraftforge.fml.common.event.FMLServerStartedEvent;
14 | import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
15 | import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;
16 |
17 |
18 | @Mod(modid = BaseConstant.MOD_ID, version = QueQiao.VERSION, name = BaseConstant.MODULE_NAME, acceptableRemoteVersions = "*", serverSideOnly = false, clientSideOnly = false)
19 | public class QueQiao {
20 | public static final String VERSION = "@VERSION@";
21 | public static MinecraftServer minecraftServer;
22 |
23 | public QueQiao() {
24 | MinecraftForge.EVENT_BUS.register(this);
25 | MinecraftForge.EVENT_BUS.register(new EventProcessor());
26 | }
27 |
28 |
29 | @Mod.EventHandler
30 | public void preInit(FMLPreInitializationEvent event) {
31 | }
32 |
33 | // @SideOnly(Side.SERVER)
34 | @Mod.EventHandler
35 | public void onServerStarting(FMLServerStartingEvent event) {
36 | minecraftServer = event.getServer();
37 |
38 | CommandTreeQueQiao command = new CommandTreeQueQiao();
39 | event.registerServerCommand(command);
40 | }
41 |
42 |
43 | // @SideOnly(Side.SERVER)
44 | @Mod.EventHandler
45 | public void onServerStarted(FMLServerStartedEvent event) {
46 | GlobalContext.init(true, minecraftServer.getMinecraftVersion(), ServerTypeConstant.FORGE, new HandleApiImpl(), new HandleCommandReturnMessageImpl());
47 | }
48 |
49 | // @SideOnly(Side.SERVER)
50 | @Mod.EventHandler
51 | public void onServerStopping(FMLServerStoppingEvent event) {
52 | GlobalContext.shutdown();
53 | }
54 |
55 | }
--------------------------------------------------------------------------------
/neoforge/origin/src/main/java/com/github/theword/queqiao/utils/NeoForgeTool.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.utils;
2 |
3 | import com.github.theword.queqiao.tool.event.model.PlayerModel;
4 | import com.github.theword.queqiao.tool.event.model.achievement.AchievementModel;
5 | import com.github.theword.queqiao.tool.event.model.achievement.DisplayModel;
6 | import net.minecraft.advancements.Advancement;
7 | import net.minecraft.advancements.DisplayInfo;
8 | import net.minecraft.network.chat.contents.TranslatableContents;
9 | import net.minecraft.server.level.ServerPlayer;
10 |
11 | public class NeoForgeTool {
12 | public static PlayerModel getNeoForgePlayer(ServerPlayer neoForgePlayer) {
13 | PlayerModel player = new PlayerModel();
14 | player.setNickname(neoForgePlayer.getName().getString());
15 | player.setUuid(neoForgePlayer.getUUID());
16 | player.setAddress(neoForgePlayer.getIpAddress());
17 | player.setHealth((double) neoForgePlayer.getHealth());
18 | player.setMaxHealth((double) neoForgePlayer.getMaxHealth());
19 | player.setExperienceLevel(neoForgePlayer.experienceLevel);
20 | player.setExperienceProgress((double) neoForgePlayer.experienceProgress);
21 | player.setTotalExperience(neoForgePlayer.totalExperience);
22 | player.setOp(neoForgePlayer.hasPermissions(2));
23 | player.setWalkSpeed((double) neoForgePlayer.getAbilities().getWalkingSpeed());
24 | player.setX(neoForgePlayer.getX());
25 | player.setY(neoForgePlayer.getY());
26 | player.setZ(neoForgePlayer.getZ());
27 | return player;
28 | }
29 |
30 | public static AchievementModel getNeoForgeAchievement(Advancement advancement) {
31 | AchievementModel achievement = new AchievementModel();
32 | if (advancement.display().isEmpty()) {
33 | return achievement;
34 | }
35 | DisplayInfo displayInfo = advancement.display().get();
36 |
37 | DisplayModel display = new DisplayModel();
38 | display.setTitle(((TranslatableContents)displayInfo.getTitle().getContents()).getKey());
39 | display.setDescription(((TranslatableContents)displayInfo.getDescription().getContents()).getKey());
40 | display.setFrame(displayInfo.getType().toString());
41 | achievement.setDisplay(display);
42 | return achievement;
43 | }
44 | }
--------------------------------------------------------------------------------
/test_messages.json:
--------------------------------------------------------------------------------
1 | [
2 | "{\"api\": \"broadcast\",\"data\": {\"message\": [{\"type\": \"text\",\"data\": {\"text\": \"test\",\"color\": \"aqua\",\"font\": null,\"bold\": false,\"italic\": false,\"underlined\": false,\"strikethrough\": false,\"obfuscated\": false,\"insertion\": null,\"click_event\": {\"action\": \"OPEN_URL\",\"value\": \"https: //www.baidu.com\"},\"hover_event\": {\"action\": \"SHOW_TEXT\",\"text\": [{\"text\": \"testhover\",\"color\": \"aqua\",\"font\": null,\"bold\": true,\"italic\": false,\"underlined\": true,\"strikethrough\": false,\"obfuscated\": false,\"insertion\": null}]}}}]},\"echo\": \"1\"}",
3 | "{\"api\": \"send_title\",\"data\": {\"title\": [{\"type\": \"text\",\"data\": {\"text\": \"Title1\",\"color\": \"aqua\"}},{\"type\": \"text\",\"data\": {\"text\": \"Title2\",\"color\": null,\"font\": null,\"bold\": true,\"italic\": true,\"underlined\": false,\"strikethrough\": false,\"obfuscated\": false,\"insertion\": null}}],\"subtitle\": [{\"type\": \"text\",\"data\": {\"text\": \"SubTitle1\",\"color\": null,\"font\": null,\"bold\": false,\"italic\": false,\"underlined\": true,\"strikethrough\": true,\"obfuscated\": false,\"insertion\": null}},{\"type\": \"text\",\"data\": {\"text\": \"SubTitle2\",\"color\": null,\"font\": null,\"bold\": false,\"italic\": false,\"underlined\": false,\"strikethrough\": false,\"obfuscated\": true,\"insertion\": null}}],\"fadein\": 10,\"stay\": 20,\"fadeout\": 10},\"echo\": \"1\"}",
4 | "{\"api\": \"send_actionbar\",\"data\": {\"message\": [{\"type\": \"text\",\"data\": {\"text\": \"Actionbar1\",\"color\": \"aqua\",\"font\": null,\"bold\": true,\"italic\": false,\"underlined\": true,\"strikethrough\": false,\"obfuscated\": false,\"insertion\": null}}]},\"echo\": \"1\"}",
5 | "{\"api\": \"send_private_msg\",\"data\": {\"uuid\": \"aa96407b-9d4d-44f8-8d79-51d0dcfdedff\",\"nickname\": \"\",\"message\": [{\"type\": \"text\",\"data\": {\"text\": \"test\",\"color\": \"aqua\",\"font\": null,\"bold\": false,\"italic\": false,\"underlined\": false,\"strikethrough\": false,\"obfuscated\": false,\"insertion\": null,\"click_event\": {\"action\": \"open_url\",\"value\": \"https: //www.baidu.com\"},\"hover_event\": {\"action\": \"show_text\",\"text\": [{\"text\": \"testhover\",\"color\": \"aqua\",\"font\": null,\"bold\": true,\"italic\": false,\"underlined\": true,\"strikethrough\": false,\"obfuscated\": false,\"insertion\": null}]}}}]},\"echo\": \"1\"}"
6 | ]
--------------------------------------------------------------------------------
/gtnh/origin/src/main/java/com/github/theword/queqiao/QueQiao.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao;
2 |
3 | import com.github.theword.queqiao.tool.GlobalContext;
4 | import cpw.mods.fml.common.FMLCommonHandler;
5 | import cpw.mods.fml.common.event.FMLServerStartedEvent;
6 | import net.minecraft.server.MinecraftServer;
7 | import net.minecraftforge.common.MinecraftForge;
8 |
9 | import com.github.theword.queqiao.handle.HandleApiImpl;
10 | import com.github.theword.queqiao.handle.HandleCommandReturnMessageImpl;
11 | import com.github.theword.queqiao.tool.constant.BaseConstant;
12 | import com.github.theword.queqiao.tool.constant.ServerTypeConstant;
13 | import cpw.mods.fml.common.Mod;
14 | import cpw.mods.fml.common.event.FMLServerStartingEvent;
15 | import cpw.mods.fml.common.event.FMLServerStoppingEvent;
16 | import cpw.mods.fml.relauncher.Side;
17 | import cpw.mods.fml.relauncher.SideOnly;
18 |
19 | @Mod(
20 | modid = BaseConstant.MOD_ID,
21 | name = BaseConstant.MODULE_NAME,
22 | version = Tags.VERSION,
23 | acceptableRemoteVersions = "*",
24 | acceptedMinecraftVersions = "[1.7.10]",
25 | useMetadata = true
26 | )
27 | public class QueQiao {
28 |
29 | public static MinecraftServer minecraftServer;
30 |
31 | public QueQiao() {
32 | MinecraftForge.EVENT_BUS.register(this);
33 | // MinecraftForge.EVENT_BUS.register(new EventProcessor());
34 | // FMLCommonHandler.instance().bus().register(new EventProcessor());
35 | }
36 |
37 | @Mod.EventHandler
38 | @SideOnly(Side.SERVER)
39 | public void onServerStarting(FMLServerStartingEvent event) {
40 | minecraftServer = event.getServer();
41 | }
42 |
43 | @Mod.EventHandler
44 | @SideOnly(Side.SERVER)
45 | public void onServerStarted(FMLServerStartedEvent event) {
46 | GlobalContext.init(
47 | true,
48 | minecraftServer.getMinecraftVersion(),
49 | ServerTypeConstant.FORGE,
50 | new HandleApiImpl(),
51 | new HandleCommandReturnMessageImpl());
52 | // var eventProcessor = new EventProcessor();
53 | MinecraftForge.EVENT_BUS.register(new EventProcessor());
54 | FMLCommonHandler.instance().bus().register(new EventProcessor());
55 | }
56 |
57 | @Mod.EventHandler
58 | @SideOnly(Side.SERVER)
59 | public void onServerStopping(FMLServerStoppingEvent event) {
60 | GlobalContext.shutdown();
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/gtnh/origin/src/main/java/com/github/theword/queqiao/utils/ForgeTool.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.utils;
2 |
3 | import com.github.theword.queqiao.tool.event.model.achievement.AchievementModel;
4 | import com.github.theword.queqiao.tool.event.model.achievement.DisplayModel;
5 | import com.google.gson.JsonElement;
6 | import net.minecraft.entity.player.EntityPlayerMP;
7 |
8 | import com.github.theword.queqiao.tool.event.model.PlayerModel;
9 | import net.minecraft.stats.Achievement;
10 | import net.minecraft.util.ChatComponentTranslation;
11 | import net.minecraft.util.IChatComponent;
12 |
13 | public class ForgeTool {
14 |
15 | public static PlayerModel getPlayerModel(EntityPlayerMP forgePlayer) {
16 | PlayerModel player = new PlayerModel();
17 | player.setNickname(forgePlayer.getDisplayName());
18 | player.setUuid(forgePlayer.getUniqueID());
19 | // player.setAddress(forgePlayer.getPlayerIP());
20 | player.setHealth((double) forgePlayer.getHealth());
21 | player.setMaxHealth((double) forgePlayer.getMaxHealth());
22 | player.setExperienceLevel(player.getExperienceLevel());
23 | player.setExperienceProgress((double) forgePlayer.experience);
24 | player.setTotalExperience(forgePlayer.experienceTotal);
25 | player.setOp(forgePlayer.mcServer.getConfigurationManager().func_152607_e(forgePlayer.getGameProfile()));
26 | player.setWalkSpeed((double) forgePlayer.capabilities.getWalkSpeed());
27 | player.setX(forgePlayer.posX);
28 | player.setY(forgePlayer.posY);
29 | player.setZ(forgePlayer.posZ);
30 | return player;
31 | }
32 |
33 | public static AchievementModel getForgeAchievement(Achievement achievement) {
34 | AchievementModel achievementModel = new AchievementModel();
35 | DisplayModel displayModel = new DisplayModel();
36 | achievementModel.setKey(achievement.statId);
37 | String frameType = achievement.getSpecial() ? "goal" : "task";
38 | displayModel.setFrame(frameType);
39 | displayModel.setTitle(((ChatComponentTranslation) achievement.func_150951_e()).getKey());
40 | // displayModel.setDescription(achievement.getDescription()); // Client Only
41 | achievementModel.setDisplay(displayModel);
42 | return achievementModel;
43 | }
44 |
45 | public static IChatComponent buildComponent(JsonElement jsonElement) {
46 | return IChatComponent.Serializer.func_150699_a(jsonElement.toString());
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/forge/origin/src/main/java/com/github/theword/queqiao/handle/HandleCommandReturnMessageImpl.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.handle;
2 |
3 | import com.github.theword.queqiao.tool.constant.BaseConstant;
4 | import com.github.theword.queqiao.tool.handle.HandleCommandReturnMessageService;
5 | import com.mojang.brigadier.context.CommandContext;
6 | // IF >= forge-1.21
7 | //import net.minecraft.network.chat.contents.PlainTextContents.LiteralContents;
8 | // ELSE IF >= forge-1.19
9 | //import net.minecraft.network.chat.contents.LiteralContents;
10 | // END IF
11 | // IF >= forge-1.18
12 | // END IF
13 |
14 | public class HandleCommandReturnMessageImpl extends HandleCommandReturnMessageService {
15 |
16 | @Override
17 | @SuppressWarnings("unchecked")
18 | public void handleCommandReturnMessage(Object object, String message) {
19 | // IF > forge-1.16.5
20 | // CommandContext context = (CommandContext) object;
21 | // END IF
22 | // IF >= forge-1.19
23 | // context.getSource().sendSystemMessage(net.minecraft.network.chat.MutableComponent.create(new LiteralContents(message)));
24 | // ELSE IF >= forge-1.18
25 | // context.getSource().sendSuccess(new net.minecraft.network.chat.TextComponent(message), false);
26 | // ELSE
27 | // CommandContext context = (CommandContext) object;
28 | // context.getSource().sendSuccess(new net.minecraft.util.text.StringTextComponent(message), false);
29 | // END IF
30 | }
31 |
32 | /**
33 | * 判断发送者是否有权执行命令
34 | * MOD端中无权限节点,权限等级为2
35 | *
36 | * @param object 命令返回者
37 | * @param node 权限节点
38 | * @return boolean 是否有权限
39 | */
40 | @Override
41 | @SuppressWarnings("unchecked")
42 | public boolean hasPermission(Object object, String node) {
43 | // IF > forge-1.16.5
44 | // CommandContext context = (CommandContext) object;
45 | // ELSE
46 | // CommandContext context = (CommandContext) object;
47 | // END IF
48 | if (context.getSource().hasPermission(BaseConstant.MOD_PERMISSION_LEVEL)) return true;
49 | handleCommandReturnMessage(object, "您没有权限执行此命令");
50 | return false;
51 | }
52 | }
--------------------------------------------------------------------------------
/paper/origin/src/main/java/com/github/theword/queqiao/command/CommandExecutor.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.github.theword.queqiao.command.subCommand.HelpCommand;
4 | import com.github.theword.queqiao.tool.constant.BaseConstant;
5 | import org.bukkit.command.Command;
6 | import org.bukkit.command.CommandSender;
7 | import org.bukkit.command.TabExecutor;
8 | import org.jetbrains.annotations.NotNull;
9 |
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 |
14 | public class CommandExecutor implements TabExecutor {
15 | private final CommandManager commandManager = new CommandManager();
16 |
17 | @Override
18 | public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
19 | if (args.length == 0) {
20 | return new HelpCommand().onCommand(commandSender, args);
21 | } else {
22 | for (PaperSubCommand subCommand : commandManager.getSubCommandList()) {
23 | if (subCommand.getName().equalsIgnoreCase(args[0])) {
24 | return subCommand.onCommand(commandSender, args);
25 | }
26 | }
27 | }
28 | return false;
29 | }
30 |
31 | @Override
32 | public List onTabComplete(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
33 | if (command.getName().equalsIgnoreCase(BaseConstant.COMMAND_HEADER)) {
34 | if (args.length == 1) {
35 | List commandList = new ArrayList<>();
36 | commandManager.getSubCommandList().forEach(subCommand -> {
37 | if (subCommand.getPrefix() == null) {
38 | commandList.add(subCommand.getName());
39 | }
40 | });
41 | return commandList;
42 | } else if (args.length == 2) {
43 | for (PaperSubCommand subCommand : commandManager.getSubCommandList()) {
44 | if (subCommand.getName().equalsIgnoreCase(args[0])) {
45 | return subCommand.getSubCommands(commandSender, args);
46 | }
47 | }
48 | } else if (args.length == 3) {
49 | for (PaperSubCommand subCommand : commandManager.getSubCommandList()) {
50 | if (subCommand.getName().equalsIgnoreCase(args[1])) {
51 | return subCommand.getSubCommands(commandSender, args);
52 | }
53 | }
54 | }
55 | }
56 | return new ArrayList<>();
57 | }
58 | }
--------------------------------------------------------------------------------
/folia/origin/src/main/java/com/github/theword/queqiao/command/CommandExecutor.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.github.theword.queqiao.command.subCommand.HelpCommand;
4 | import com.github.theword.queqiao.tool.constant.BaseConstant;
5 | import org.bukkit.command.Command;
6 | import org.bukkit.command.CommandSender;
7 | import org.bukkit.command.TabExecutor;
8 | import org.jetbrains.annotations.NotNull;
9 |
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 |
14 | public class CommandExecutor implements TabExecutor {
15 | private final CommandManager commandManager = new CommandManager();
16 |
17 | @Override
18 | public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
19 | if (args.length == 0) {
20 | return new HelpCommand().onCommand(commandSender, args);
21 | } else {
22 | for (SpigotSubCommand subCommand : commandManager.getSubCommandList()) {
23 | if (subCommand.getName().equalsIgnoreCase(args[0])) {
24 | return subCommand.onCommand(commandSender, args);
25 | }
26 | }
27 | }
28 | return false;
29 | }
30 |
31 | @Override
32 | public List onTabComplete(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
33 | if (command.getName().equalsIgnoreCase(BaseConstant.COMMAND_HEADER)) {
34 | if (args.length == 1) {
35 | List commandList = new ArrayList<>();
36 | commandManager.getSubCommandList().forEach(subCommand -> {
37 | if (subCommand.getPrefix() == null) {
38 | commandList.add(subCommand.getName());
39 | }
40 | });
41 | return commandList;
42 | } else if (args.length == 2) {
43 | for (SpigotSubCommand subCommand : commandManager.getSubCommandList()) {
44 | if (subCommand.getName().equalsIgnoreCase(args[0])) {
45 | return subCommand.getSubCommands(commandSender, args);
46 | }
47 | }
48 | } else if (args.length == 3) {
49 | for (SpigotSubCommand subCommand : commandManager.getSubCommandList()) {
50 | if (subCommand.getName().equalsIgnoreCase(args[1])) {
51 | return subCommand.getSubCommands(commandSender, args);
52 | }
53 | }
54 | }
55 | }
56 | return new ArrayList<>();
57 | }
58 | }
--------------------------------------------------------------------------------
/spigot/origin/src/main/java/com/github/theword/queqiao/command/CommandExecutor.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.github.theword.queqiao.command.subCommand.HelpCommand;
4 | import com.github.theword.queqiao.tool.constant.BaseConstant;
5 | import org.bukkit.command.Command;
6 | import org.bukkit.command.CommandSender;
7 | import org.bukkit.command.TabExecutor;
8 | import org.jetbrains.annotations.NotNull;
9 |
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 |
14 | public class CommandExecutor implements TabExecutor {
15 | private final CommandManager commandManager = new CommandManager();
16 |
17 | @Override
18 | public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
19 | if (args.length == 0) {
20 | return new HelpCommand().onCommand(commandSender, args);
21 | } else {
22 | for (SpigotSubCommand subCommand : commandManager.getSubCommandList()) {
23 | if (subCommand.getName().equalsIgnoreCase(args[0])) {
24 | return subCommand.onCommand(commandSender, args);
25 | }
26 | }
27 | }
28 | return false;
29 | }
30 |
31 | @Override
32 | public List onTabComplete(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
33 | if (command.getName().equalsIgnoreCase(BaseConstant.COMMAND_HEADER)) {
34 | if (args.length == 1) {
35 | List commandList = new ArrayList<>();
36 | commandManager.getSubCommandList().forEach(subCommand -> {
37 | if (subCommand.getPrefix() == null) {
38 | commandList.add(subCommand.getName());
39 | }
40 | });
41 | return commandList;
42 | } else if (args.length == 2) {
43 | for (SpigotSubCommand subCommand : commandManager.getSubCommandList()) {
44 | if (subCommand.getName().equalsIgnoreCase(args[0])) {
45 | return subCommand.getSubCommands(commandSender, args);
46 | }
47 | }
48 | } else if (args.length == 3) {
49 | for (SpigotSubCommand subCommand : commandManager.getSubCommandList()) {
50 | if (subCommand.getName().equalsIgnoreCase(args[1])) {
51 | return subCommand.getSubCommands(commandSender, args);
52 | }
53 | }
54 | }
55 | }
56 | return new ArrayList<>();
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/cleanroom/origin/gradle/scripts/dependencies.gradle:
--------------------------------------------------------------------------------
1 | apply from: 'gradle/scripts/helpers.gradle'
2 |
3 | def tool_version = getVersionFromFile('../../tool_version.txt')
4 |
5 | repositories {
6 | // Other repositories described by default:
7 | // CleanroomMC: https://maven.cleanroommc.com
8 | exclusiveContent {
9 | forRepository {
10 | maven {
11 | name 'CurseMaven'
12 | url 'https://cursemaven.com'
13 | }
14 | }
15 | filter {
16 | includeGroup 'curse.maven'
17 | }
18 | }
19 | exclusiveContent {
20 | forRepository {
21 | maven {
22 | name 'Modrinth'
23 | url 'https://api.modrinth.com/maven'
24 | }
25 | }
26 | filter {
27 | includeGroup 'maven.modrinth'
28 | }
29 | }
30 | maven {
31 | name 'GitHub Packages'
32 | url 'https://maven.pkg.github.com/17TheWord/QueQiaoTool'
33 | credentials {
34 | username = System.getenv("GH_USERNAME")
35 | password = System.getenv("PACKAGE_READ_ONLY_TOKEN")
36 | }
37 | }
38 | flatDir {
39 | dirs 'libs'
40 | }
41 | mavenLocal() // Must be last for caching to work
42 | }
43 |
44 | dependencies {
45 | // Include StripLatestForgeRequirements by default for the dev env, saves everyone a hassle
46 | runtimeOnly 'com.cleanroommc:strip-latest-forge-requirements:1.0'
47 |
48 | // For easier testing
49 | runtimeOnly rfg.deobf('curse.maven:had-enough-items-557549:4543375')
50 | runtimeOnly rfg.deobf('curse.maven:ftb-library-legacy-forge-237167:2985811')
51 | runtimeOnly rfg.deobf('curse.maven:ftb-utilities-forge-237102:3157548')
52 |
53 | implementation ("com.github.theword.queqiao:queqiao-tool:${tool_version}") {
54 | // implementation embed ("com.github.theword.queqiao:queqiao-tool:${tool_version}") {
55 | exclude group: 'org.slf4j', module: 'slf4j-api'
56 | exclude group: 'org.yaml', module: 'snakeyaml'
57 | exclude group: 'com.google.code.gson', module: 'gson'
58 | exclude group: 'commons-io', module: 'commons-io'
59 | }
60 |
61 | implementation ("org.java-websocket:Java-WebSocket:${java_websocket_version}")
62 | implementation ("org.slf4j:slf4j-simple:${slf4j_version}")
63 | implementation ("org.yaml:snakeyaml:${snakeyaml_version}")
64 | implementation ("org.glavo:rcon-java:${glavoRconVersion}")
65 | // implementation embed("org.java-websocket:Java-WebSocket:${java_websocket_version}")
66 | // implementation embed("org.slf4j:slf4j-simple:${slf4j_version}")
67 | // implementation embed('org.yaml:snakeyaml:1.33')
68 | }
--------------------------------------------------------------------------------
/neoforge/origin/src/main/java/com/github/theword/queqiao/command/CommandExecutor.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 |
4 | import com.github.theword.queqiao.command.subCommand.HelpCommand;
5 | import com.github.theword.queqiao.command.subCommand.ReloadCommand;
6 | import com.github.theword.queqiao.command.subCommand.client.ReconnectAllCommand;
7 | import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
8 | import com.github.theword.queqiao.tool.GlobalContext;
9 | import com.github.theword.queqiao.tool.constant.BaseConstant;
10 | import com.mojang.brigadier.Command;
11 | import net.minecraft.commands.Commands;
12 | import net.neoforged.bus.api.SubscribeEvent;
13 | import net.neoforged.fml.common.EventBusSubscriber;
14 | import net.neoforged.neoforge.event.RegisterCommandsEvent;
15 | import net.neoforged.neoforge.server.command.ConfigCommand;
16 |
17 |
18 | @EventBusSubscriber(modid = BaseConstant.MOD_ID)
19 | public class CommandExecutor {
20 |
21 | @SubscribeEvent
22 | public static void onCommandRegister(RegisterCommandsEvent event) {
23 | event.getDispatcher().register(
24 | Commands.literal(BaseConstant.COMMAND_HEADER)
25 | .requires(source -> source.hasPermission(2))
26 | .executes(context -> new HelpCommand().onCommand(context))
27 | .then(Commands.literal("help")
28 | .executes(context -> new HelpCommand().onCommand(context))
29 | )
30 | .then(Commands.literal("reload")
31 | .executes(context -> new ReloadCommand().onCommand(context))
32 | )
33 | .then(Commands.literal("client")
34 | .then(Commands.literal("reconnect")
35 | .executes(context -> new ReconnectCommand().onCommand(context))
36 | .then(Commands.literal("all")
37 | .executes(context -> new ReconnectAllCommand().onCommand(context)))
38 | )
39 | ).then(Commands.literal("server")
40 | .executes(context -> {
41 | // TODO Websocket Server Command
42 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(context, "Server command is not supported");
43 | return Command.SINGLE_SUCCESS;
44 | })
45 | )
46 | );
47 | ConfigCommand.register(event.getDispatcher());
48 | }
49 |
50 | }
--------------------------------------------------------------------------------
/velocity/origin/src/main/java/com/github/theword/queqiao/EventProcessor.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao;
2 |
3 | import com.github.theword.queqiao.tool.GlobalContext;
4 | import com.github.theword.queqiao.tool.event.PlayerCommandEvent;
5 | import com.github.theword.queqiao.tool.event.PlayerJoinEvent;
6 | import com.github.theword.queqiao.tool.event.PlayerQuitEvent;
7 | import com.github.theword.queqiao.tool.event.model.PlayerModel;
8 | import com.velocitypowered.api.event.Subscribe;
9 | import com.velocitypowered.api.event.command.CommandExecuteEvent;
10 | import com.velocitypowered.api.event.connection.DisconnectEvent;
11 | import com.velocitypowered.api.event.connection.LoginEvent;
12 | import com.velocitypowered.api.event.player.PlayerChatEvent;
13 | import com.velocitypowered.api.proxy.Player;
14 |
15 | import static com.github.theword.queqiao.utils.VelocityTool.getVelocityPlayer;
16 |
17 |
18 | public class EventProcessor {
19 |
20 | @Subscribe
21 | public void onPlayerChat(PlayerChatEvent event) {
22 | if (!GlobalContext.getConfig().getSubscribeEvent().isPlayerChat()) return;
23 |
24 | PlayerModel player = getVelocityPlayer(event.getPlayer());
25 | String message = event.getMessage();
26 | com.github.theword.queqiao.tool.event.PlayerChatEvent velocityPlayerChatEvent = new com.github.theword.queqiao.tool.event.PlayerChatEvent(player, "", message, message);
27 | GlobalContext.sendEvent(velocityPlayerChatEvent);
28 | }
29 |
30 | @Subscribe
31 | public void onPlayerLogin(LoginEvent event) {
32 | if (!GlobalContext.getConfig().getSubscribeEvent().isPlayerJoin()) return;
33 |
34 | PlayerModel player = getVelocityPlayer(event.getPlayer());
35 | PlayerJoinEvent velocityLoginEvent = new PlayerJoinEvent(player);
36 | GlobalContext.sendEvent(velocityLoginEvent);
37 | }
38 |
39 | @Subscribe
40 | public void onDisconnect(DisconnectEvent event) {
41 | if (!GlobalContext.getConfig().getSubscribeEvent().isPlayerQuit()) return;
42 |
43 | PlayerModel player = getVelocityPlayer(event.getPlayer());
44 | PlayerQuitEvent velocityDisconnectEvent = new PlayerQuitEvent(player);
45 | GlobalContext.sendEvent(velocityDisconnectEvent);
46 | }
47 |
48 | @Subscribe
49 | public void onCommandExecute(CommandExecuteEvent event) {
50 | if (!(event.getCommandSource() instanceof Player player) || !GlobalContext.getConfig().getSubscribeEvent().isPlayerCommand())
51 | return;
52 |
53 | String command = event.getCommand();
54 |
55 | PlayerCommandEvent velocityCommandExecuteEvent = new PlayerCommandEvent(getVelocityPlayer(player), "", command, command);
56 | GlobalContext.sendEvent(velocityCommandExecuteEvent);
57 | }
58 | }
--------------------------------------------------------------------------------
/fabric/origin/gradle.properties:
--------------------------------------------------------------------------------
1 | # Done to increase the memory available to gradle.
2 | org.gradle.jvmargs=-Xmx3G
3 | # Mod Properties
4 | mod_name=QueQiao
5 | maven_group=com.github.theword.queqiao
6 | # Library Properties
7 | # IF <=fabric-1.16.5
8 | #java_version=8
9 | # ELSE IF >= fabric-1.20.5
10 | #java_version=21
11 | # ELSE
12 | #java_version=17
13 | # END IF
14 | glavo_rcon_version=3.0
15 | snakeyaml_version=2.2
16 | junit_jupiter_version=5.11.4
17 | java_websocket_version=1.5.3
18 | maven_repository_url=https://maven.pkg.github.com/17TheWord/QueQiaoTool
19 | #
20 | # Fabric Properties
21 | # IF fabric-1.16.5
22 | #minecraft_version=1.16.5
23 | #yarn_mappings=1.16.5+build.10
24 | #fabric_version=0.42.0+1.16
25 | #slf4j_version=1.7.36
26 | #loader_version=0.14.24
27 | # ELSE IF fabric-1.18.2
28 | #minecraft_version=1.18.2
29 | #yarn_mappings=1.18.2+build.4
30 | #fabric_version=0.67.1+1.18.2
31 | #loader_version=0.14.24
32 | # ELSE IF fabric-1.19.2
33 | #minecraft_version=1.19.2
34 | #yarn_mappings=1.19.2+build.28
35 | #fabric_version=0.73.2+1.19.2
36 | #loader_version=0.14.24
37 | # ELSE IF fabric-1.20.1
38 | #minecraft_version=1.20.1
39 | #yarn_mappings=1.20.1+build.10
40 | #fabric_version=0.92.2+1.20.1
41 | #loader_version=0.15.6
42 | # ELSE IF fabric-1.20.4
43 | #minecraft_version=1.20.4
44 | #yarn_mappings=1.20.4+build.3
45 | #fabric_version=0.97.2+1.20.4
46 | #loader_version=0.15.11
47 | # ELSE IF fabric-1.21
48 | #minecraft_version=1.21
49 | #yarn_mappings=1.21+build.2
50 | #fabric_version=0.100.3+1.21
51 | #loader_version=0.16.10
52 | # ELSE IF fabric-1.21.1
53 | #minecraft_version=1.21.1
54 | #yarn_mappings=1.21.1+build.3
55 | #fabric_version=0.110.0+1.21.1
56 | #loader_version=0.16.10
57 | # ELSE IF fabric-1.21.4
58 | #minecraft_version=1.21.4
59 | #yarn_mappings=1.21.4+build.8
60 | #fabric_version=0.119.2+1.21.4
61 | #loader_version=0.16.10
62 | # ELSE IF fabric-1.21.5
63 | #minecraft_version=1.21.5
64 | #yarn_mappings=1.21.5+build.1
65 | #fabric_version=0.126.0+1.21.5
66 | #loader_version=0.16.10
67 | # ELSE IF fabric-1.21.6
68 | #minecraft_version=1.21.6
69 | #yarn_mappings=1.21.6+build.1
70 | #fabric_version=0.128.2+1.21.6
71 | #loader_version=0.16.10
72 | # ELSE IF fabric-1.21.7
73 | #minecraft_version=1.21.7
74 | #yarn_mappings=1.21.7+build.8
75 | #fabric_version=0.129.0+1.21.7
76 | #loader_version=0.16.10
77 | # ELSE IF fabric-1.21.8
78 | #minecraft_version=1.21.8
79 | #yarn_mappings=1.21.8+build.1
80 | #fabric_version=0.133.4+1.21.8
81 | #loader_version=0.16.10
82 | # ELSE IF fabric-1.21.9
83 | #minecraft_version=1.21.9
84 | #yarn_mappings=1.21.9+build.1
85 | #loader_version=0.18.2
86 | #fabric_version=0.134.0+1.21.9
87 | # ELSE IF fabric-1.21.11
88 | #minecraft_version=1.21.11
89 | #yarn_mappings=1.21.11+build.3
90 | #loader_version=0.18.2
91 | #fabric_version=0.139.5+1.21.11
92 | # END IF
--------------------------------------------------------------------------------
/forge/origin/src/main/java/com/github/theword/queqiao/command/CommandExecutor.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.command;
2 |
3 | import com.github.theword.queqiao.command.subCommand.HelpCommand;
4 | import com.github.theword.queqiao.command.subCommand.ReloadCommand;
5 | import com.github.theword.queqiao.command.subCommand.client.ReconnectAllCommand;
6 | import com.github.theword.queqiao.command.subCommand.client.ReconnectCommand;
7 | import com.github.theword.queqiao.tool.GlobalContext;
8 | import com.github.theword.queqiao.tool.constant.BaseConstant;
9 | import com.mojang.brigadier.Command;
10 | // IF > forge-1.16.5
11 | //import net.minecraft.commands.Commands;
12 | // ELSE
13 | //import net.minecraft.command.Commands;
14 | // END IF
15 | import net.minecraftforge.event.RegisterCommandsEvent;
16 | import net.minecraftforge.eventbus.api.SubscribeEvent;
17 | import net.minecraftforge.fml.common.Mod;
18 | import net.minecraftforge.server.command.ConfigCommand;
19 |
20 |
21 | @Mod.EventBusSubscriber(modid = BaseConstant.MOD_ID)
22 | public class CommandExecutor {
23 |
24 | @SubscribeEvent
25 | public static void registerCommands(RegisterCommandsEvent event) {
26 | event.getDispatcher().register(
27 | Commands.literal(BaseConstant.COMMAND_HEADER)
28 | .requires(source -> source.hasPermission(2))
29 | .executes(context -> new HelpCommand().onCommand(context))
30 | .then(Commands.literal("help")
31 | .executes(context -> new HelpCommand().onCommand(context))
32 | )
33 | .then(Commands.literal("reload")
34 | .executes(context -> new ReloadCommand().onCommand(context))
35 | )
36 | .then(Commands.literal("client")
37 | .then(Commands.literal("reconnect")
38 | .executes(context -> new ReconnectCommand().onCommand(context))
39 | .then(Commands.literal("all")
40 | .executes(context -> new ReconnectAllCommand().onCommand(context)))
41 | )
42 | ).then(Commands.literal("server")
43 | .executes(context -> {
44 | // TODO Websocket Server Command
45 | GlobalContext.getHandleCommandReturnMessageService().handleCommandReturnMessage(context, "Server command is not supported");
46 | return Command.SINGLE_SUCCESS;
47 | })
48 | )
49 | );
50 | ConfigCommand.register(event.getDispatcher());
51 | }
52 |
53 | }
--------------------------------------------------------------------------------
/vanilla/origin/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.gradleup.shadow' version '9.3.0'
3 | id 'org.jetbrains.kotlin.jvm' version "${kotlin_version}"
4 | }
5 |
6 | def getVersionFromFile(String fileName) {
7 | def versionFile = file(fileName)
8 | if (versionFile.exists()) {
9 | return versionFile.text.trim()
10 | } else {
11 | throw new Exception("File not found: ${versionFile.absolutePath}") as Throwable
12 | }
13 | }
14 |
15 | def tool_version = getVersionFromFile('../../tool_version.txt')
16 |
17 | def mod_version = getVersionFromFile('../../version.txt')
18 |
19 | group = mod_group_id
20 | version = mod_version
21 |
22 | repositories {
23 | mavenLocal()
24 | mavenCentral()
25 | maven {
26 | url = uri(maven_repository_url)
27 | credentials {
28 | username = System.getenv("GH_USERNAME")
29 | password = System.getenv("PACKAGE_READ_ONLY_TOKEN")
30 | }
31 | }
32 | }
33 |
34 | dependencies {
35 | implementation "com.github.theword.queqiao:queqiao-tool:${tool_version}"
36 | implementation "org.java-websocket:Java-WebSocket:${java_websocket_version}"
37 | implementation "org.yaml:snakeyaml:${snakeyaml_version}"
38 | implementation "org.slf4j:slf4j-api:${slf4j_version}"
39 | implementation "org.slf4j:slf4j-simple:${slf4j_version}"
40 | implementation "com.google.code.gson:gson:${gson_version}"
41 | implementation "commons-io:commons-io:${commons_io_version}"
42 | implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
43 | implementation "org.glavo:rcon-java:${glavo_rcon_version}"
44 |
45 | testImplementation 'org.jetbrains.kotlin:kotlin-test'
46 | }
47 |
48 | test {
49 | useJUnitPlatform()
50 | testLogging {
51 | events "passed", "skipped", "failed"
52 | }
53 | }
54 |
55 | kotlin {
56 | jvmToolchain(8)
57 | }
58 |
59 | shadowJar {
60 | archiveBaseName.set("${mod_name}-vanilla+minecraft")
61 | archiveClassifier.set("")
62 | destinationDirectory.set(file("../../QueQiao-jar/${version}"))
63 | manifest {
64 | attributes(
65 | 'Main-Class': 'com.github.theword.queqiao.QueQiao' // 替换为你的主类路径
66 | )
67 | }
68 | dependencies {
69 | include(dependency("com.github.theword.queqiao:queqiao-tool:${tool_version}"))
70 | include(dependency("org.java-websocket:Java-WebSocket:${java_websocket_version}"))
71 | include(dependency("org.yaml:snakeyaml:${snakeyaml_version}"))
72 | include(dependency("org.slf4j:slf4j-api:${slf4j_version}"))
73 | include(dependency("org.slf4j:slf4j-simple:${slf4j_version}"))
74 | include(dependency("com.google.code.gson:gson:${gson_version}"))
75 | include(dependency("commons-io:commons-io:${commons_io_version}"))
76 | include(dependency("org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"))
77 | }
78 | mergeServiceFiles()
79 | }
80 |
81 | tasks.build {
82 | dependsOn shadowJar
83 | }
--------------------------------------------------------------------------------
/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/ServerPlayNetworkHandlerMixin.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.mixin;
2 |
3 | import com.github.theword.queqiao.tool.GlobalContext;
4 | import com.github.theword.queqiao.tool.event.PlayerChatEvent;
5 | import com.github.theword.queqiao.tool.event.PlayerCommandEvent;
6 | import com.github.theword.queqiao.tool.utils.Tool;
7 | import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
8 | // IF > fabric-1.18.2
9 | //import net.minecraft.network.packet.c2s.play.CommandExecutionC2SPacket;
10 | // END IF
11 | import net.minecraft.server.network.ServerPlayNetworkHandler;
12 | import net.minecraft.server.network.ServerPlayerEntity;
13 | import org.spongepowered.asm.mixin.Mixin;
14 | import org.spongepowered.asm.mixin.Shadow;
15 | import org.spongepowered.asm.mixin.injection.At;
16 | import org.spongepowered.asm.mixin.injection.Inject;
17 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
18 |
19 | import java.util.Objects;
20 |
21 | import static com.github.theword.queqiao.utils.FabricTool.getFabricPlayer;
22 |
23 | @Mixin(ServerPlayNetworkHandler.class)
24 | public class ServerPlayNetworkHandlerMixin {
25 | @Shadow
26 | public ServerPlayerEntity player;
27 |
28 | // IF > fabric-1.16.5
29 | // @Inject(method = "onChatMessage", at = @At("HEAD"))
30 | // ELSE
31 | // @Inject(method = "onGameMessage", at = @At("HEAD"))
32 | // END IF
33 | private void onChatMessage(ChatMessageC2SPacket packet, CallbackInfo info) {
34 | // IF > fabric-1.18.2
35 | // String message = packet.chatMessage();
36 | // ELSE
37 | // String message = packet.getChatMessage();
38 | // END IF
39 |
40 | if (message.startsWith("/")) return;
41 | if (!GlobalContext.getConfig().getSubscribeEvent().isPlayerChat()) return;
42 |
43 | PlayerChatEvent event = new PlayerChatEvent(getFabricPlayer(player), "", message, message);
44 | GlobalContext.sendEvent(event);
45 | }
46 |
47 | // IF > fabric-1.18.2
48 | // @Inject(method = "onCommandExecution", at = @At("HEAD"))
49 | // private void onCommandExecution(CommandExecutionC2SPacket packet, CallbackInfo ci) {
50 | // String input = packet.command();
51 | // ELSE IF fabric-1.18.2
52 | // @Inject(method = "executeCommand", at = @At("HEAD"))
53 | // private void executeCommand(String input, CallbackInfo ci) {
54 | // ELSE
55 | // @Inject(method = "executeCommand", at = @At("HEAD"))
56 | // private void executeCommand(String input, CallbackInfo ci) {
57 | // END IF
58 | if (!GlobalContext.getConfig().getSubscribeEvent().isPlayerCommand()) return;
59 |
60 | String registerOrLoginCommand = Tool.isIgnoredCommand(input);
61 |
62 | if (registerOrLoginCommand.isEmpty()) return;
63 |
64 | PlayerCommandEvent event = new PlayerCommandEvent(getFabricPlayer(Objects.requireNonNull(player)), "", registerOrLoginCommand, registerOrLoginCommand);
65 | GlobalContext.sendEvent(event);
66 | }
67 | }
--------------------------------------------------------------------------------
/cleanroom/origin/src/main/java/com/github/theword/queqiao/utils/ForgeTool.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.utils;
2 |
3 | import com.github.theword.queqiao.tool.GlobalContext;
4 | import com.github.theword.queqiao.tool.event.model.PlayerModel;
5 | import com.github.theword.queqiao.tool.event.model.achievement.AchievementModel;
6 | import com.github.theword.queqiao.tool.event.model.achievement.DisplayModel;
7 | import com.google.gson.JsonElement;
8 | import net.minecraft.advancements.Advancement;
9 | import net.minecraft.advancements.DisplayInfo;
10 | import net.minecraft.entity.player.EntityPlayerMP;
11 | import net.minecraft.util.text.ITextComponent;
12 | import net.minecraft.util.text.TextComponentTranslation;
13 |
14 |
15 | public class ForgeTool {
16 | public static PlayerModel getForgePlayer(EntityPlayerMP forgeServerPlayer) {
17 | PlayerModel playerModel = new PlayerModel();
18 | playerModel.setNickname(forgeServerPlayer.getName());
19 | playerModel.setUuid(forgeServerPlayer.getUniqueID());
20 | playerModel.setAddress(forgeServerPlayer.getPlayerIP());
21 | playerModel.setHealth((double) forgeServerPlayer.getHealth());
22 | playerModel.setMaxHealth((double) forgeServerPlayer.getMaxHealth());
23 | playerModel.setExperienceLevel(forgeServerPlayer.experienceLevel);
24 | playerModel.setExperienceProgress((double) forgeServerPlayer.experience);
25 | playerModel.setTotalExperience(forgeServerPlayer.experienceTotal);
26 | playerModel.setOp(forgeServerPlayer.canUseCommand(4, "op"));
27 | playerModel.setWalkSpeed((double) forgeServerPlayer.getAIMoveSpeed());
28 | playerModel.setX(forgeServerPlayer.posX);
29 | playerModel.setY(forgeServerPlayer.posY);
30 | playerModel.setZ(forgeServerPlayer.posZ);
31 | return playerModel;
32 | }
33 |
34 | public static AchievementModel getForgeAchievement(Advancement advancement) {
35 | AchievementModel achievementModel = new AchievementModel();
36 | DisplayModel displayModel = new DisplayModel();
37 | achievementModel.setKey(advancement.getId().toString());
38 | DisplayInfo displayInfo = advancement.getDisplay();
39 | displayModel.setFrame(displayInfo.getFrame().toString());
40 | displayModel.setTitle(((TextComponentTranslation) displayInfo.getTitle()).getKey());
41 | displayModel.setDescription(((TextComponentTranslation) displayInfo.getDescription()).getKey());
42 | achievementModel.setDisplay(displayModel);
43 | return achievementModel;
44 | }
45 |
46 | /** 调用原版方法反序列化Json文本组件, 并将异常输出到日志
47 | * @param jsonElement 消息体
48 | * @return 文本组件, 或null如果解析出错
49 | */
50 | public static ITextComponent parseJsonToTextWrapped(JsonElement jsonElement) {
51 | try {
52 | return ITextComponent.Serializer.fromJsonLenient(jsonElement.toString());
53 | } catch (Throwable e) {
54 | GlobalContext.getLogger().error("Error handling Broadcast Message {} : ", jsonElement, e);
55 | }
56 | return null;
57 | }
58 | }
--------------------------------------------------------------------------------
/fabric/origin/src/main/java/com/github/theword/queqiao/mixin/ServerPlayerEntityMixin.java:
--------------------------------------------------------------------------------
1 | package com.github.theword.queqiao.mixin;
2 |
3 | import com.github.theword.queqiao.tool.GlobalContext;
4 | import com.github.theword.queqiao.tool.event.PlayerDeathEvent;
5 | import com.github.theword.queqiao.tool.event.PlayerQuitEvent;
6 | import com.github.theword.queqiao.tool.event.model.death.DeathModel;
7 | import net.minecraft.entity.damage.DamageSource;
8 | import net.minecraft.server.network.ServerPlayerEntity;
9 | import net.minecraft.text.Text;
10 | // IF < fabric-1.19.0
11 | //import net.minecraft.text.TranslatableText;
12 | // ELSE
13 | //import net.minecraft.text.TranslatableTextContent;
14 | // END IF
15 | import org.spongepowered.asm.mixin.Mixin;
16 | import org.spongepowered.asm.mixin.injection.At;
17 | import org.spongepowered.asm.mixin.injection.Inject;
18 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
19 |
20 |
21 | import java.util.Arrays;
22 |
23 | import static com.github.theword.queqiao.utils.FabricTool.getFabricPlayer;
24 |
25 | @Mixin(ServerPlayerEntity.class)
26 | public abstract class ServerPlayerEntityMixin {
27 |
28 | @Inject(method = "onDeath", at = @At("HEAD"))
29 | public void onDeath(DamageSource source, CallbackInfo ci) {
30 | if (!GlobalContext.getConfig().getSubscribeEvent().isPlayerDeath()) return;
31 | ServerPlayerEntity player = (ServerPlayerEntity) (Object) this;
32 |
33 | DeathModel deathModel = new DeathModel();
34 |
35 | Text deathMessage = player.getDamageTracker().getDeathMessage();
36 |
37 | // IF < fabric-1.19.0
38 | // if (deathMessage instanceof TranslatableText) {
39 | // TranslatableText translatableText = (TranslatableText) deathMessage;
40 | // ELSE
41 | // if (deathMessage.getContent() instanceof TranslatableTextContent) {
42 | // TranslatableTextContent translatableText = (TranslatableTextContent) deathMessage.getContent();
43 | // END IF
44 | deathModel.setKey(translatableText.getKey());
45 | String[] args = Arrays.stream(translatableText.getArgs()).map(obj -> {
46 | System.out.println(obj.getClass());
47 | if (obj instanceof Text) {
48 | return ((Text) obj).getString();
49 | } else {
50 | return String.valueOf(obj);
51 | }
52 | }).toArray(String[]::new);
53 | deathModel.setArgs(args);
54 | }
55 | deathModel.setText(deathMessage.getString());
56 |
57 | PlayerDeathEvent event = new PlayerDeathEvent(getFabricPlayer(player), deathModel);
58 | GlobalContext.sendEvent(event);
59 | }
60 |
61 | @Inject(method = "onDisconnect", at = @At("HEAD"))
62 | public void onDisconnected(CallbackInfo ci) {
63 | if (!GlobalContext.getConfig().getSubscribeEvent().isPlayerQuit()) return;
64 |
65 | ServerPlayerEntity player = (ServerPlayerEntity) (Object) this;
66 | PlayerQuitEvent event = new PlayerQuitEvent(getFabricPlayer(player));
67 | GlobalContext.sendEvent(event);
68 | }
69 |
70 | }
--------------------------------------------------------------------------------
/vanilla/vanilla-minecraft/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%"=="" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%"=="" set DIRNAME=.
29 | @rem This is normally unused
30 | set APP_BASE_NAME=%~n0
31 | set APP_HOME=%DIRNAME%
32 |
33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
35 |
36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
38 |
39 | @rem Find java.exe
40 | if defined JAVA_HOME goto findJavaFromJavaHome
41 |
42 | set JAVA_EXE=java.exe
43 | %JAVA_EXE% -version >NUL 2>&1
44 | if %ERRORLEVEL% equ 0 goto execute
45 |
46 | echo.
47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48 | echo.
49 | echo Please set the JAVA_HOME variable in your environment to match the
50 | echo location of your Java installation.
51 |
52 | goto fail
53 |
54 | :findJavaFromJavaHome
55 | set JAVA_HOME=%JAVA_HOME:"=%
56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
57 |
58 | if exist "%JAVA_EXE%" goto execute
59 |
60 | echo.
61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62 | echo.
63 | echo Please set the JAVA_HOME variable in your environment to match the
64 | echo location of your Java installation.
65 |
66 | goto fail
67 |
68 | :execute
69 | @rem Setup the command line
70 |
71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
72 |
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if %ERRORLEVEL% equ 0 goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | set EXIT_CODE=%ERRORLEVEL%
85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87 | exit /b %EXIT_CODE%
88 |
89 | :mainEnd
90 | if "%OS%"=="Windows_NT" endlocal
91 |
92 | :omega
93 |
--------------------------------------------------------------------------------
/fabric/fabric-1.21.11/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 | @rem SPDX-License-Identifier: Apache-2.0
17 | @rem
18 |
19 | @if "%DEBUG%"=="" @echo off
20 | @rem ##########################################################################
21 | @rem
22 | @rem Gradle startup script for Windows
23 | @rem
24 | @rem ##########################################################################
25 |
26 | @rem Set local scope for the variables with windows NT shell
27 | if "%OS%"=="Windows_NT" setlocal
28 |
29 | set DIRNAME=%~dp0
30 | if "%DIRNAME%"=="" set DIRNAME=.
31 | @rem This is normally unused
32 | set APP_BASE_NAME=%~n0
33 | set APP_HOME=%DIRNAME%
34 |
35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
37 |
38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
40 |
41 | @rem Find java.exe
42 | if defined JAVA_HOME goto findJavaFromJavaHome
43 |
44 | set JAVA_EXE=java.exe
45 | %JAVA_EXE% -version >NUL 2>&1
46 | if %ERRORLEVEL% equ 0 goto execute
47 |
48 | echo. 1>&2
49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50 | echo. 1>&2
51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52 | echo location of your Java installation. 1>&2
53 |
54 | goto fail
55 |
56 | :findJavaFromJavaHome
57 | set JAVA_HOME=%JAVA_HOME:"=%
58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
59 |
60 | if exist "%JAVA_EXE%" goto execute
61 |
62 | echo. 1>&2
63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64 | echo. 1>&2
65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66 | echo location of your Java installation. 1>&2
67 |
68 | goto fail
69 |
70 | :execute
71 | @rem Setup the command line
72 |
73 |
74 |
75 | @rem Execute Gradle
76 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
77 |
78 | :end
79 | @rem End local scope for the variables with windows NT shell
80 | if %ERRORLEVEL% equ 0 goto mainEnd
81 |
82 | :fail
83 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
84 | rem the _cmd.exe /c_ return code!
85 | set EXIT_CODE=%ERRORLEVEL%
86 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
87 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
88 | exit /b %EXIT_CODE%
89 |
90 | :mainEnd
91 | if "%OS%"=="Windows_NT" endlocal
92 |
93 | :omega
94 |
--------------------------------------------------------------------------------
/fabric/fabric-1.21.9/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 | @rem SPDX-License-Identifier: Apache-2.0
17 | @rem
18 |
19 | @if "%DEBUG%"=="" @echo off
20 | @rem ##########################################################################
21 | @rem
22 | @rem Gradle startup script for Windows
23 | @rem
24 | @rem ##########################################################################
25 |
26 | @rem Set local scope for the variables with windows NT shell
27 | if "%OS%"=="Windows_NT" setlocal
28 |
29 | set DIRNAME=%~dp0
30 | if "%DIRNAME%"=="" set DIRNAME=.
31 | @rem This is normally unused
32 | set APP_BASE_NAME=%~n0
33 | set APP_HOME=%DIRNAME%
34 |
35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
37 |
38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
40 |
41 | @rem Find java.exe
42 | if defined JAVA_HOME goto findJavaFromJavaHome
43 |
44 | set JAVA_EXE=java.exe
45 | %JAVA_EXE% -version >NUL 2>&1
46 | if %ERRORLEVEL% equ 0 goto execute
47 |
48 | echo. 1>&2
49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50 | echo. 1>&2
51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52 | echo location of your Java installation. 1>&2
53 |
54 | goto fail
55 |
56 | :findJavaFromJavaHome
57 | set JAVA_HOME=%JAVA_HOME:"=%
58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
59 |
60 | if exist "%JAVA_EXE%" goto execute
61 |
62 | echo. 1>&2
63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64 | echo. 1>&2
65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66 | echo location of your Java installation. 1>&2
67 |
68 | goto fail
69 |
70 | :execute
71 | @rem Setup the command line
72 |
73 |
74 |
75 | @rem Execute Gradle
76 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
77 |
78 | :end
79 | @rem End local scope for the variables with windows NT shell
80 | if %ERRORLEVEL% equ 0 goto mainEnd
81 |
82 | :fail
83 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
84 | rem the _cmd.exe /c_ return code!
85 | set EXIT_CODE=%ERRORLEVEL%
86 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
87 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
88 | exit /b %EXIT_CODE%
89 |
90 | :mainEnd
91 | if "%OS%"=="Windows_NT" endlocal
92 |
93 | :omega
94 |
--------------------------------------------------------------------------------
/paper/origin/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%"=="" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%"=="" set DIRNAME=.
29 | @rem This is normally unused
30 | set APP_BASE_NAME=%~n0
31 | set APP_HOME=%DIRNAME%
32 |
33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
35 |
36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
38 |
39 | @rem Find java.exe
40 | if defined JAVA_HOME goto findJavaFromJavaHome
41 |
42 | set JAVA_EXE=java.exe
43 | %JAVA_EXE% -version >NUL 2>&1
44 | if %ERRORLEVEL% equ 0 goto execute
45 |
46 | echo. 1>&2
47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48 | echo. 1>&2
49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50 | echo location of your Java installation. 1>&2
51 |
52 | goto fail
53 |
54 | :findJavaFromJavaHome
55 | set JAVA_HOME=%JAVA_HOME:"=%
56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
57 |
58 | if exist "%JAVA_EXE%" goto execute
59 |
60 | echo. 1>&2
61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62 | echo. 1>&2
63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64 | echo location of your Java installation. 1>&2
65 |
66 | goto fail
67 |
68 | :execute
69 | @rem Setup the command line
70 |
71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
72 |
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if %ERRORLEVEL% equ 0 goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | set EXIT_CODE=%ERRORLEVEL%
85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87 | exit /b %EXIT_CODE%
88 |
89 | :mainEnd
90 | if "%OS%"=="Windows_NT" endlocal
91 |
92 | :omega
93 |
--------------------------------------------------------------------------------
/fabric/fabric-1.21/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%"=="" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%"=="" set DIRNAME=.
29 | @rem This is normally unused
30 | set APP_BASE_NAME=%~n0
31 | set APP_HOME=%DIRNAME%
32 |
33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
35 |
36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
38 |
39 | @rem Find java.exe
40 | if defined JAVA_HOME goto findJavaFromJavaHome
41 |
42 | set JAVA_EXE=java.exe
43 | %JAVA_EXE% -version >NUL 2>&1
44 | if %ERRORLEVEL% equ 0 goto execute
45 |
46 | echo. 1>&2
47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48 | echo. 1>&2
49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50 | echo location of your Java installation. 1>&2
51 |
52 | goto fail
53 |
54 | :findJavaFromJavaHome
55 | set JAVA_HOME=%JAVA_HOME:"=%
56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
57 |
58 | if exist "%JAVA_EXE%" goto execute
59 |
60 | echo. 1>&2
61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62 | echo. 1>&2
63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64 | echo location of your Java installation. 1>&2
65 |
66 | goto fail
67 |
68 | :execute
69 | @rem Setup the command line
70 |
71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
72 |
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if %ERRORLEVEL% equ 0 goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | set EXIT_CODE=%ERRORLEVEL%
85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87 | exit /b %EXIT_CODE%
88 |
89 | :mainEnd
90 | if "%OS%"=="Windows_NT" endlocal
91 |
92 | :omega
93 |
--------------------------------------------------------------------------------
/forge/forge-1.16.5/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%"=="" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%"=="" set DIRNAME=.
29 | @rem This is normally unused
30 | set APP_BASE_NAME=%~n0
31 | set APP_HOME=%DIRNAME%
32 |
33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
35 |
36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
38 |
39 | @rem Find java.exe
40 | if defined JAVA_HOME goto findJavaFromJavaHome
41 |
42 | set JAVA_EXE=java.exe
43 | %JAVA_EXE% -version >NUL 2>&1
44 | if %ERRORLEVEL% equ 0 goto execute
45 |
46 | echo. 1>&2
47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48 | echo. 1>&2
49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50 | echo location of your Java installation. 1>&2
51 |
52 | goto fail
53 |
54 | :findJavaFromJavaHome
55 | set JAVA_HOME=%JAVA_HOME:"=%
56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
57 |
58 | if exist "%JAVA_EXE%" goto execute
59 |
60 | echo. 1>&2
61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62 | echo. 1>&2
63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64 | echo location of your Java installation. 1>&2
65 |
66 | goto fail
67 |
68 | :execute
69 | @rem Setup the command line
70 |
71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
72 |
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if %ERRORLEVEL% equ 0 goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | set EXIT_CODE=%ERRORLEVEL%
85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87 | exit /b %EXIT_CODE%
88 |
89 | :mainEnd
90 | if "%OS%"=="Windows_NT" endlocal
91 |
92 | :omega
93 |
--------------------------------------------------------------------------------
/forge/forge-1.18.2/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%"=="" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%"=="" set DIRNAME=.
29 | @rem This is normally unused
30 | set APP_BASE_NAME=%~n0
31 | set APP_HOME=%DIRNAME%
32 |
33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
35 |
36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
38 |
39 | @rem Find java.exe
40 | if defined JAVA_HOME goto findJavaFromJavaHome
41 |
42 | set JAVA_EXE=java.exe
43 | %JAVA_EXE% -version >NUL 2>&1
44 | if %ERRORLEVEL% equ 0 goto execute
45 |
46 | echo. 1>&2
47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48 | echo. 1>&2
49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50 | echo location of your Java installation. 1>&2
51 |
52 | goto fail
53 |
54 | :findJavaFromJavaHome
55 | set JAVA_HOME=%JAVA_HOME:"=%
56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
57 |
58 | if exist "%JAVA_EXE%" goto execute
59 |
60 | echo. 1>&2
61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62 | echo. 1>&2
63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64 | echo location of your Java installation. 1>&2
65 |
66 | goto fail
67 |
68 | :execute
69 | @rem Setup the command line
70 |
71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
72 |
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if %ERRORLEVEL% equ 0 goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | set EXIT_CODE=%ERRORLEVEL%
85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87 | exit /b %EXIT_CODE%
88 |
89 | :mainEnd
90 | if "%OS%"=="Windows_NT" endlocal
91 |
92 | :omega
93 |
--------------------------------------------------------------------------------
/forge/forge-1.19.2/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%"=="" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%"=="" set DIRNAME=.
29 | @rem This is normally unused
30 | set APP_BASE_NAME=%~n0
31 | set APP_HOME=%DIRNAME%
32 |
33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
35 |
36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
38 |
39 | @rem Find java.exe
40 | if defined JAVA_HOME goto findJavaFromJavaHome
41 |
42 | set JAVA_EXE=java.exe
43 | %JAVA_EXE% -version >NUL 2>&1
44 | if %ERRORLEVEL% equ 0 goto execute
45 |
46 | echo. 1>&2
47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48 | echo. 1>&2
49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50 | echo location of your Java installation. 1>&2
51 |
52 | goto fail
53 |
54 | :findJavaFromJavaHome
55 | set JAVA_HOME=%JAVA_HOME:"=%
56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
57 |
58 | if exist "%JAVA_EXE%" goto execute
59 |
60 | echo. 1>&2
61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62 | echo. 1>&2
63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64 | echo location of your Java installation. 1>&2
65 |
66 | goto fail
67 |
68 | :execute
69 | @rem Setup the command line
70 |
71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
72 |
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if %ERRORLEVEL% equ 0 goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | set EXIT_CODE=%ERRORLEVEL%
85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87 | exit /b %EXIT_CODE%
88 |
89 | :mainEnd
90 | if "%OS%"=="Windows_NT" endlocal
91 |
92 | :omega
93 |
--------------------------------------------------------------------------------
/forge/forge-1.20.1/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%"=="" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%"=="" set DIRNAME=.
29 | @rem This is normally unused
30 | set APP_BASE_NAME=%~n0
31 | set APP_HOME=%DIRNAME%
32 |
33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
35 |
36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
38 |
39 | @rem Find java.exe
40 | if defined JAVA_HOME goto findJavaFromJavaHome
41 |
42 | set JAVA_EXE=java.exe
43 | %JAVA_EXE% -version >NUL 2>&1
44 | if %ERRORLEVEL% equ 0 goto execute
45 |
46 | echo. 1>&2
47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48 | echo. 1>&2
49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50 | echo location of your Java installation. 1>&2
51 |
52 | goto fail
53 |
54 | :findJavaFromJavaHome
55 | set JAVA_HOME=%JAVA_HOME:"=%
56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
57 |
58 | if exist "%JAVA_EXE%" goto execute
59 |
60 | echo. 1>&2
61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62 | echo. 1>&2
63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64 | echo location of your Java installation. 1>&2
65 |
66 | goto fail
67 |
68 | :execute
69 | @rem Setup the command line
70 |
71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
72 |
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if %ERRORLEVEL% equ 0 goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | set EXIT_CODE=%ERRORLEVEL%
85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87 | exit /b %EXIT_CODE%
88 |
89 | :mainEnd
90 | if "%OS%"=="Windows_NT" endlocal
91 |
92 | :omega
93 |
--------------------------------------------------------------------------------