├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── BUG_REPORT.yml
│ └── FEATURE_SUGGEST.yml
├── dependabot.yml
└── workflows
│ ├── dev-build.yml
│ ├── main-build.yml
│ └── pr-check.yml
├── .gitignore
├── .gradle
├── 7.4
│ ├── checksums
│ │ ├── checksums.lock
│ │ ├── md5-checksums.bin
│ │ └── sha1-checksums.bin
│ ├── dependencies-accessors
│ │ ├── dependencies-accessors.lock
│ │ └── gc.properties
│ ├── executionHistory
│ │ ├── executionHistory.bin
│ │ └── executionHistory.lock
│ ├── fileChanges
│ │ └── last-build.bin
│ ├── fileHashes
│ │ ├── fileHashes.bin
│ │ ├── fileHashes.lock
│ │ └── resourceHashesCache.bin
│ └── gc.properties
├── buildOutputCleanup
│ ├── buildOutputCleanup.lock
│ ├── cache.properties
│ └── outputFiles.bin
├── file-system.probe
└── vcs-1
│ └── gc.properties
├── .idea
├── .gitignore
├── codeStyles
│ ├── Project.xml
│ └── codeStyleConfig.xml
├── compiler.xml
├── dbnavigator.xml
├── gradle.xml
├── inspectionProfiles
│ └── Project_Default.xml
├── kotlinScripting.xml
├── kotlinc.xml
├── misc.xml
├── shelf
│ ├── _2022_12_18_20_07____.xml
│ ├── _2022_12_19_11_09____.xml
│ ├── 在进行签出之前于_2022_12_18_20_07_取消提交了变更_[变更]
│ │ └── shelved.patch
│ ├── 在进行签出之前于_2022_12_19_11_09_取消提交了变更_[变更]
│ │ └── shelved.patch
│ └── 在进行签出之前于_2022_12_19_11_09_取消提交了变更_[变更]1
│ │ └── shelved.patch
├── uiDesigner.xml
├── vcs.xml
└── workspace.xml
├── .vscode
└── settings.json
├── LICENSE
├── README.md
├── RELEASE_TEMPLE.md
├── build.gradle.kts
├── config.groovy
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── lib
├── groovy-4.0.2-sources.jar
├── groovy-4.0.2.jar
├── groovy-ant-4.0.2-sources.jar
├── groovy-ant-4.0.2.jar
├── groovy-astbuilder-4.0.2-sources.jar
├── groovy-astbuilder-4.0.2.jar
├── groovy-cli-commons-4.0.2-sources.jar
├── groovy-cli-commons-4.0.2.jar
├── groovy-cli-picocli-4.0.2-sources.jar
├── groovy-cli-picocli-4.0.2.jar
├── groovy-console-4.0.2-sources.jar
├── groovy-console-4.0.2.jar
├── groovy-contracts-4.0.2-sources.jar
├── groovy-contracts-4.0.2.jar
├── groovy-datetime-4.0.2-sources.jar
├── groovy-datetime-4.0.2.jar
├── groovy-dateutil-4.0.2-sources.jar
├── groovy-dateutil-4.0.2.jar
├── groovy-docgenerator-4.0.2-sources.jar
├── groovy-docgenerator-4.0.2.jar
├── groovy-ginq-4.0.2-sources.jar
├── groovy-ginq-4.0.2.jar
├── groovy-groovydoc-4.0.2-sources.jar
├── groovy-groovydoc-4.0.2.jar
├── groovy-groovysh-4.0.2-sources.jar
├── groovy-groovysh-4.0.2.jar
├── groovy-jmx-4.0.2-sources.jar
├── groovy-jmx-4.0.2.jar
├── groovy-json-4.0.2-sources.jar
├── groovy-json-4.0.2.jar
├── groovy-jsr223-4.0.2-sources.jar
├── groovy-jsr223-4.0.2.jar
├── groovy-macro-4.0.2-sources.jar
├── groovy-macro-4.0.2.jar
├── groovy-macro-library-4.0.2-sources.jar
├── groovy-macro-library-4.0.2.jar
├── groovy-nio-4.0.2-sources.jar
├── groovy-nio-4.0.2.jar
├── groovy-servlet-4.0.2-sources.jar
├── groovy-servlet-4.0.2.jar
├── groovy-sql-4.0.2-sources.jar
├── groovy-sql-4.0.2.jar
├── groovy-swing-4.0.2-sources.jar
├── groovy-swing-4.0.2.jar
├── groovy-templates-4.0.2-sources.jar
├── groovy-templates-4.0.2.jar
├── groovy-test-4.0.2-sources.jar
├── groovy-test-4.0.2.jar
├── groovy-test-junit5-4.0.2-sources.jar
├── groovy-test-junit5-4.0.2.jar
├── groovy-testng-4.0.2-sources.jar
├── groovy-testng-4.0.2.jar
├── groovy-toml-4.0.2-sources.jar
├── groovy-toml-4.0.2.jar
├── groovy-typecheckers-4.0.2-sources.jar
├── groovy-typecheckers-4.0.2.jar
├── groovy-xml-4.0.2-sources.jar
└── groovy-xml-4.0.2.jar
├── libs
└── TrChat-shaded.jar
├── settings.gradle.kts
└── src
├── main
├── java
│ └── moe
│ │ └── xmcn
│ │ └── catsero
│ │ └── v3
│ │ ├── CatSero.java
│ │ └── util
│ │ ├── Logger.java
│ │ └── Metrics.java
├── kotlin
│ └── moe
│ │ └── xmcn
│ │ └── catsero
│ │ └── v3
│ │ ├── Configuration.kt
│ │ ├── I18n.kt
│ │ ├── UpdateCheck.kt
│ │ ├── core
│ │ ├── CoreRegister.kt
│ │ ├── listener
│ │ │ ├── chatForward
│ │ │ │ ├── OnQQGroupChat.kt
│ │ │ │ ├── OnTrChatChat.kt
│ │ │ │ └── OnVanillaChat.kt
│ │ │ └── joinQuitForward
│ │ │ │ └── OnPlayerJoin.kt
│ │ └── timer
│ │ │ └── chatForward
│ │ │ └── Filter.kt
│ │ └── util
│ │ ├── MessageSender.kt
│ │ ├── PAPI.kt
│ │ └── TomlUtil.kt
└── resources
│ ├── config.toml
│ ├── lang
│ └── zh_CN
│ │ ├── format.json
│ │ └── message.json
│ ├── mirai.toml
│ ├── plugin.yml
│ └── use-config.toml
└── test
└── java
└── moe
└── xmcn
└── catsero
├── ChatExample.java
├── FileReaderTest.java
├── TestGetFileProtocol.java
└── utils
└── HttpClient.java
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # [XiaMoHuaHuo-CN]
4 | patreon: #user?u=84443866 # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: [ 'https://afdian.net/a/HuaHuo-CN', 'https://sponsors.huahuo-cn.tk' ]
13 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/BUG_REPORT.yml:
--------------------------------------------------------------------------------
1 | name: 问题报告
2 | description: "如果你想反馈 Bug,请使用此模板。"
3 | labels: [ "漏洞bug" ]
4 | body:
5 | - type: textarea
6 | id: description
7 | attributes:
8 | label: 问题描述
9 | description: 在下方的编辑框描述你的问题
10 | placeholder: 请尽可能说明你遇到的问题,包括你是如何使用插件的,配置文件有没有调过等等
11 | validations:
12 | required: true
13 | - type: textarea
14 | id: recurrent
15 | attributes:
16 | label: 复现方法
17 | description: 在下方的编辑框描述如何触发这个漏洞(分步需换行请直接回车,会为你添加标号)
18 | placeholder: 能看到这个?说明你没有看描述,请自己加上“1. ”
19 | value: "1. "
20 | validations:
21 | required: true
22 | - type: input
23 | id: serverversion
24 | attributes:
25 | label: 服务端版本
26 | description: 填写你正在使用的服务端版本,例如 Paper-1.12.2
27 | placeholder: 在服务端输入 /ver 查看版本
28 | validations:
29 | required: true
30 | - type: input
31 | id: pluginversion
32 | attributes:
33 | label: CatSero 版本
34 | description: 填写你正在使用的 CatSero 版本
35 | placeholder: 在服务端输入 /catsero 查看版本
36 | validations:
37 | required: true
38 | - type: textarea
39 | id: serverlog
40 | attributes:
41 | label: 服务端日志
42 | description: 在下方复制你的服务端日志
43 | placeholder: 请提供完整的服务端日志。
44 | render: text
45 | validations:
46 | required: true
47 | - type: textarea
48 | id: extra
49 | attributes:
50 | label: 额外说明
51 | description: 还有什么要补充的吗?
52 | placeholder: |
53 | 提示:
54 | 你可以提供系统环境、Java版本、你使用了什么插件、重置插件配置后问题是否仍然存在、你使用的插件列表
55 | 你还可以提供截图和文件(直接拖动文件到编辑框)
56 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/FEATURE_SUGGEST.yml:
--------------------------------------------------------------------------------
1 | name: 功能建议
2 | description: "如果你想建议一些新的功能,请使用此模板。"
3 | labels: [ "功能enhancement" ]
4 | body:
5 | - type: textarea
6 | id: description
7 | attributes:
8 | label: 功能描述
9 | description: 在下方的编辑框描述你想要的功能
10 | placeholder: 请尽可能完整说明你的建议,包括相关功能应该如何正确工作、何时工作等。
11 | validations:
12 | required: true
13 | - type: textarea
14 | id: recurrent
15 | attributes:
16 | label: 使用方法
17 | description: 在下方的编辑框描述你想这个功能如何运作,如服务端启动时这个功能要怎么工作,或是执行某个命令时这个功能要怎么运作(分步需换行请直接回车,会为你添加标号)
18 | placeholder: 能看到这个?说明你没有看描述,请自己加上“1. ”
19 | value: "1. "
20 | validations:
21 | required: false
22 | - type: textarea
23 | id: extra
24 | attributes:
25 | label: 额外说明
26 | description: 还有什么要补充的吗?
27 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "gradle"
9 | directory: "/"
10 | schedule:
11 | interval: "daily"
12 | ignore:
13 | - dependency-name: "HikariCP"
14 | - dependency-name: "spigot-api"
15 | target-branch: "dev"
16 |
--------------------------------------------------------------------------------
/.github/workflows/dev-build.yml:
--------------------------------------------------------------------------------
1 | name: b-dev Gradle - Build
2 |
3 | on:
4 | push:
5 | branches: [ dev ]
6 |
7 | jobs:
8 | build:
9 |
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - name: Checkout Source
14 | uses: actions/checkout@v3
15 |
16 | - name: Set up JDK 11
17 | uses: actions/setup-java@v3.9.0
18 | with:
19 | java-version: '11'
20 | distribution: 'zulu'
21 |
22 | - name: Build with Gradle
23 | run: ./gradlew build
24 |
25 | - name: Upload Build Target
26 | uses: actions/upload-artifact@v3.1.1
27 | with:
28 | name: "CatSero-Test-Artifact"
29 | path: build/
30 |
31 | - name: Upload Build Jar
32 | uses: actions/upload-artifact@v3.1.1
33 | with:
34 | name: "CatSero-Test-Jar"
35 | path: build/libs/CatSero*.jar
36 |
--------------------------------------------------------------------------------
/.github/workflows/main-build.yml:
--------------------------------------------------------------------------------
1 | name: b-main Gradle - Build
2 |
3 | on:
4 | push:
5 | branches: [ v3 ]
6 |
7 | jobs:
8 | build:
9 |
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - name: Checkout Source
14 | uses: actions/checkout@v3
15 |
16 | - name: Set up JDK 11
17 | uses: actions/setup-java@v3.9.0
18 | with:
19 | java-version: '11'
20 | distribution: 'zulu'
21 |
22 | - name: Build with Gradle
23 | run: ./gradlew build
24 |
25 | - name: Upload Build Target
26 | uses: actions/upload-artifact@v3.1.1
27 | with:
28 | name: "CatSero-Artifact"
29 | path: build/
30 |
31 | - name: Upload Build Jar
32 | uses: actions/upload-artifact@v3.1.1
33 | with:
34 | name: "CatSero-Jar"
35 | path: build/libs/CatSero*.jar
36 |
--------------------------------------------------------------------------------
/.github/workflows/pr-check.yml:
--------------------------------------------------------------------------------
1 | name: b-dev Gradle - Pull Request Check
2 |
3 | on:
4 | pull_request:
5 | branches: [ dev ]
6 |
7 | jobs:
8 | build:
9 |
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - name: Checkout Source
14 | uses: actions/checkout@v3
15 |
16 | - name: Set up JDK 11
17 | uses: actions/setup-java@v3.9.0
18 | with:
19 | java-version: '11'
20 | distribution: 'zulu'
21 |
22 | - name: Test Build with Gradle
23 | run: ./gradlew build
24 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle/
2 | build/
3 | !gradle/wrapper/gradle-wrapper.jar
4 | !**/src/main/**/build/
5 | !**/src/test/**/build/
6 |
7 | ### IntelliJ IDEA ###
8 | .idea/
9 | *.iws
10 | *.iml
11 | *.ipr
12 | out/
13 | !**/src/main/**/out/
14 | !**/src/test/**/out/
15 |
16 | ### Eclipse ###
17 | .apt_generated
18 | .classpath
19 | .factorypath
20 | .project
21 | .settings
22 | .springBeans
23 | .sts4-cache
24 | bin/
25 | !**/src/main/**/bin/
26 | !**/src/test/**/bin/
27 |
28 | ### NetBeans ###
29 | /nbproject/private/
30 | /nbbuild/
31 | /dist/
32 | /nbdist/
33 | /.nb-gradle/
34 |
35 | ### VS Code ###
36 | .vscode/
37 |
38 | ### Mac OS ###
39 | .DS_Store
40 |
41 | ### Test Server ###
42 | server-test/
43 |
--------------------------------------------------------------------------------
/.gradle/7.4/checksums/checksums.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/7.4/checksums/checksums.lock
--------------------------------------------------------------------------------
/.gradle/7.4/checksums/md5-checksums.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/7.4/checksums/md5-checksums.bin
--------------------------------------------------------------------------------
/.gradle/7.4/checksums/sha1-checksums.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/7.4/checksums/sha1-checksums.bin
--------------------------------------------------------------------------------
/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock
--------------------------------------------------------------------------------
/.gradle/7.4/dependencies-accessors/gc.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/7.4/dependencies-accessors/gc.properties
--------------------------------------------------------------------------------
/.gradle/7.4/executionHistory/executionHistory.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/7.4/executionHistory/executionHistory.bin
--------------------------------------------------------------------------------
/.gradle/7.4/executionHistory/executionHistory.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/7.4/executionHistory/executionHistory.lock
--------------------------------------------------------------------------------
/.gradle/7.4/fileChanges/last-build.bin:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gradle/7.4/fileHashes/fileHashes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/7.4/fileHashes/fileHashes.bin
--------------------------------------------------------------------------------
/.gradle/7.4/fileHashes/fileHashes.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/7.4/fileHashes/fileHashes.lock
--------------------------------------------------------------------------------
/.gradle/7.4/fileHashes/resourceHashesCache.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/7.4/fileHashes/resourceHashesCache.bin
--------------------------------------------------------------------------------
/.gradle/7.4/gc.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/7.4/gc.properties
--------------------------------------------------------------------------------
/.gradle/buildOutputCleanup/buildOutputCleanup.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/buildOutputCleanup/buildOutputCleanup.lock
--------------------------------------------------------------------------------
/.gradle/buildOutputCleanup/cache.properties:
--------------------------------------------------------------------------------
1 | #Sun Dec 18 18:26:10 CST 2022
2 | gradle.version=7.4
3 |
--------------------------------------------------------------------------------
/.gradle/buildOutputCleanup/outputFiles.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/buildOutputCleanup/outputFiles.bin
--------------------------------------------------------------------------------
/.gradle/file-system.probe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/file-system.probe
--------------------------------------------------------------------------------
/.gradle/vcs-1/gc.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.gradle/vcs-1/gc.properties
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # 默认忽略的文件
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/dbnavigator.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
16 |
17 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/kotlinScripting.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 2147483647
6 | true
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/shelf/_2022_12_18_20_07____.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/shelf/_2022_12_19_11_09____.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/shelf/在进行签出之前于_2022_12_18_20_07_取消提交了变更_[变更]/shelved.patch:
--------------------------------------------------------------------------------
1 | Index: src/main/java/moe/xmcn/catsero/Main.java
2 | IDEA additional info:
3 | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
4 | <+>package moe.xmcn.catsero;\r\n\r\nimport org.bukkit.plugin.java.JavaPlugin;\r\n\r\npublic class Main extends JavaPlugin {\r\n\r\n @Override\r\n public void onLoad() {\r\n\r\n }\r\n\r\n @Override\r\n public void onEnable() {\r\n\r\n }\r\n\r\n @Override\r\n public void onDisable() {\r\n\r\n }\r\n\r\n}
5 | ===================================================================
6 | diff --git a/src/main/java/moe/xmcn/catsero/Main.java b/src/main/java/moe/xmcn/catsero/Main.java
7 | --- a/src/main/java/moe/xmcn/catsero/Main.java
8 | +++ b/src/main/java/moe/xmcn/catsero/Main.java
9 | @@ -1,12 +1,24 @@
10 | package moe.xmcn.catsero;
11 |
12 | +import moe.xmcn.catsero.utils.Logger;
13 | +import org.bukkit.Bukkit;
14 | import org.bukkit.plugin.java.JavaPlugin;
15 |
16 | +import java.util.ArrayList;
17 | +import java.util.Arrays;
18 | +import java.util.List;
19 | +
20 | public class Main extends JavaPlugin {
21 |
22 | @Override
23 | public void onLoad() {
24 | -
25 | + Logger.log("Loader", "Start loading CatSero");
26 | + List env = Arrays.asList(
27 | + "Server Version: " + getServer().getVersion(),
28 | + "Bukkit Version: " + getServer().getBukkitVersion(),
29 | + "CatSero Version: " +
30 | + );
31 | + Logger.log("Loader", env);
32 | }
33 |
34 | @Override
35 | Index: src/main/java/moe/xmcn/catsero/Config.java
36 | IDEA additional info:
37 | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
38 | <+>package moe.xmcn.catsero;\r\n\r\npublic interface Config {\r\n}\r\n
39 | ===================================================================
40 | diff --git a/src/main/java/moe/xmcn/catsero/Config.java b/src/main/java/moe/xmcn/catsero/Config.java
41 | --- a/src/main/java/moe/xmcn/catsero/Config.java
42 | +++ b/src/main/java/moe/xmcn/catsero/Config.java
43 | @@ -1,4 +1,7 @@
44 | package moe.xmcn.catsero;
45 |
46 | public interface Config {
47 | +
48 | + String Version =
49 | +
50 | }
51 | Index: build.gradle.kts
52 | IDEA additional info:
53 | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
54 | <+>plugins {\r\n id(\"java\")\r\n}\r\n\r\ngroup = \"moe.xmcn.catsero\"\r\nversion = \"2.0-beta5\"\r\n\r\nrepositories {\r\n mavenCentral()\r\n maven(\"https://hub.spigotmc.org/nexus/content/repositories/snapshots\")\r\n maven(\"https://repo.extendedclip.com/content/repositories/placeholderapi\")\r\n maven(\"https://lss233.littleservice.cn/repositories/minecraft\")\r\n}\r\n\r\ndependencies {\r\n implementation(fileTree(mapOf(\"dir\" to \"libs\", \"include\" to listOf(\"*.jar\"))))\r\n implementation(\"org.spigotmc:spigot-api:1.13-R0.1-SNAPSHOT\")\r\n implementation(\"org.bstats:bstats-bukkit:3.0.0\")\r\n implementation(\"me.clip:placeholderapi:2.11.2\")\r\n implementation(\"io.github.dreamvoid:MiraiMC-Bukkit:1.7.1\")\r\n testImplementation(\"org.junit.jupiter:junit-jupiter-api:5.8.1\")\r\n testRuntimeOnly(\"org.junit.jupiter:junit-jupiter-engine:5.8.1\")\r\n}\r\n\r\ntasks.getByName(\"test\") {\r\n useJUnitPlatform()\r\n}
55 | ===================================================================
56 | diff --git a/build.gradle.kts b/build.gradle.kts
57 | --- a/build.gradle.kts
58 | +++ b/build.gradle.kts
59 | @@ -24,4 +24,4 @@
60 |
61 | tasks.getByName("test") {
62 | useJUnitPlatform()
63 | -}
64 | \ No newline at end of file
65 | +}
66 | Index: .idea/workspace.xml
67 | IDEA additional info:
68 | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
69 | <+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n "keyToString": {\r\n "RunOnceActivity.OpenProjectViewOnStart": "true",\r\n "RunOnceActivity.ShowReadmeOnStart": "true",\r\n "SHARE_PROJECT_CONFIGURATION_FILES": "true",\r\n "project.structure.last.edited": "模块",\r\n "project.structure.proportion": "0.0",\r\n "project.structure.side.proportion": "0.0",\r\n "settings.editor.selected.configurable": "project.propVCSSupport.DirectoryMappings"\r\n }\r\n}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n true\r\n true\r\n false\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n true\r\n true\r\n false\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n true\r\n true\r\n false\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 1668927643545\r\n \r\n \r\n 1668927643545\r\n \r\n \r\n 1668936326161\r\n \r\n \r\n \r\n 1668936326161\r\n \r\n \r\n 1671360069526\r\n \r\n \r\n \r\n 1671360069526\r\n \r\n \r\n 1671360256606\r\n \r\n \r\n \r\n 1671360256606\r\n \r\n \r\n 1671360893293\r\n \r\n \r\n \r\n 1671360893293\r\n \r\n \r\n 1671361819867\r\n \r\n \r\n \r\n 1671361819867\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
70 | ===================================================================
71 | diff --git a/.idea/workspace.xml b/.idea/workspace.xml
72 | --- a/.idea/workspace.xml
73 | +++ b/.idea/workspace.xml
74 | @@ -5,9 +5,11 @@
75 |
76 |
77 |
78 | +
79 |
80 |
81 |
82 | +
83 |
84 |
85 |
86 | @@ -54,6 +56,13 @@
87 |
88 |
89 |
90 | +
91 | +
92 | +
93 | +
94 | +
95 | +
96 | +
97 |
98 |
99 |
100 | @@ -219,7 +228,14 @@
101 |
102 | 1671361819867
103 |
104 | -
105 | +
106 | + 1671362059083
107 | +
108 | +
109 | +
110 | + 1671362059083
111 | +
112 | +
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/.idea/shelf/在进行签出之前于_2022_12_19_11_09_取消提交了变更_[变更]/shelved.patch:
--------------------------------------------------------------------------------
1 | Index: .idea/workspace.xml
2 | IDEA additional info:
3 | Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
4 | <+>\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n "keyToString": {\r\n "RunOnceActivity.OpenProjectViewOnStart": "true",\r\n "RunOnceActivity.ShowReadmeOnStart": "true",\r\n "SHARE_PROJECT_CONFIGURATION_FILES": "true",\r\n "last_opened_file_path": "D:/Otr/IdeaProjects/CatSero/server-test/plugins",\r\n "project.structure.last.edited": "模块",\r\n "project.structure.proportion": "0.15",\r\n "project.structure.side.proportion": "0.2",\r\n "settings.editor.selected.configurable": "project.propCompiler"\r\n }\r\n}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n true\r\n true\r\n false\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n true\r\n true\r\n false\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n true\r\n true\r\n false\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 1668927643545\r\n \r\n \r\n 1668927643545\r\n \r\n \r\n 1668936326161\r\n \r\n \r\n \r\n 1668936326161\r\n \r\n \r\n 1671360069526\r\n \r\n \r\n \r\n 1671360069526\r\n \r\n \r\n 1671360256606\r\n \r\n \r\n \r\n 1671360256606\r\n \r\n \r\n 1671360893293\r\n \r\n \r\n \r\n 1671360893293\r\n \r\n \r\n 1671361819867\r\n \r\n \r\n \r\n 1671361819867\r\n \r\n \r\n 1671372627652\r\n \r\n \r\n \r\n 1671372627652\r\n \r\n \r\n 1671373326475\r\n \r\n \r\n \r\n 1671373326475\r\n \r\n \r\n 1671377114320\r\n \r\n \r\n \r\n 1671377114320\r\n \r\n \r\n 1671377273961\r\n \r\n \r\n \r\n 1671377273961\r\n \r\n \r\n 1671377757151\r\n \r\n \r\n \r\n 1671377757151\r\n \r\n \r\n 1671386887060\r\n \r\n \r\n \r\n 1671386887060\r\n \r\n \r\n 1671387100927\r\n \r\n \r\n \r\n 1671387100927\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
5 | ===================================================================
6 | diff --git a/.idea/workspace.xml b/.idea/workspace.xml
7 | --- a/.idea/workspace.xml
8 | +++ b/.idea/workspace.xml
9 | @@ -4,13 +4,8 @@
10 |
11 |
12 |
13 | -
14 | -
15 | -
16 | -
17 | -
18 | -
19 | -
20 | +
21 | +
22 |
23 |
24 |
25 | @@ -304,7 +299,28 @@
26 |
27 | 1671387100927
28 |
29 | -
30 | +
31 | + 1671418796471
32 | +
33 | +
34 | +
35 | + 1671418796471
36 | +
37 | +
38 | + 1671418868248
39 | +
40 | +
41 | +
42 | + 1671418868248
43 | +
44 | +
45 | + 1671419215056
46 | +
47 | +
48 | +
49 | + 1671419215056
50 | +
51 | +
52 |
53 |
54 |
55 | @@ -335,11 +351,12 @@
56 |
57 |
58 |
59 | -
60 |
61 |
62 |
63 | -
64 | +
65 | +
66 | +
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/.idea/shelf/在进行签出之前于_2022_12_19_11_09_取消提交了变更_[变更]1/shelved.patch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/.idea/shelf/在进行签出之前于_2022_12_19_11_09_取消提交了变更_[变更]1/shelved.patch
--------------------------------------------------------------------------------
/.idea/uiDesigner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 | -
9 |
10 |
11 | -
12 |
13 |
14 | -
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 | -
24 |
25 |
26 |
27 |
28 |
29 | -
30 |
31 |
32 |
33 |
34 |
35 | -
36 |
37 |
38 |
39 |
40 |
41 | -
42 |
43 |
44 |
45 |
46 | -
47 |
48 |
49 |
50 |
51 | -
52 |
53 |
54 |
55 |
56 | -
57 |
58 |
59 |
60 |
61 | -
62 |
63 |
64 |
65 |
66 | -
67 |
68 |
69 |
70 |
71 | -
72 |
73 |
74 | -
75 |
76 |
77 |
78 |
79 | -
80 |
81 |
82 |
83 |
84 | -
85 |
86 |
87 |
88 |
89 | -
90 |
91 |
92 |
93 |
94 | -
95 |
96 |
97 |
98 |
99 | -
100 |
101 |
102 | -
103 |
104 |
105 | -
106 |
107 |
108 | -
109 |
110 |
111 | -
112 |
113 |
114 |
115 |
116 | -
117 |
118 |
119 | -
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
98 |
99 |
100 |
101 |
104 |
105 |
106 |
107 | {
108 | "lastFilter": {
109 | "state": "OPEN"
110 | }
111 | }
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 | {
135 | "keyToString": {
136 | "ASKED_ADD_EXTERNAL_FILES": "true",
137 | "RunOnceActivity.OpenProjectViewOnStart": "true",
138 | "RunOnceActivity.ShowReadmeOnStart": "true",
139 | "SHARE_PROJECT_CONFIGURATION_FILES": "true",
140 | "git-widget-placeholder": "dev",
141 | "jdk.selected.JAVA_MODULE": "corretto-1.8",
142 | "last_directory_selection": "F:/CatSero/src/main/kotlin/moe/xmcn/catsero/v3",
143 | "last_opened_file_path": "F:/CatSero/server-test/plugins",
144 | "project.structure.last.edited": "工件",
145 | "project.structure.proportion": "0.15",
146 | "project.structure.side.proportion": "0.2",
147 | "run.code.analysis.last.selected.profile": "pProject Default",
148 | "settings.editor.selected.configurable": "CodeWithMe"
149 | }
150 | }
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 | true
227 | true
228 | false
229 | false
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 | true
249 | true
250 | false
251 | false
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 | 1668927643545
281 |
282 |
283 | 1668927643545
284 |
285 |
286 | 1673008269839
287 |
288 |
289 |
290 | 1673008269839
291 |
292 |
293 | 1673092758302
294 |
295 |
296 |
297 | 1673092758302
298 |
299 |
300 | 1673103091328
301 |
302 |
303 |
304 | 1673103091328
305 |
306 |
307 | 1673285567199
308 |
309 |
310 |
311 | 1673285567199
312 |
313 |
314 | 1673516991756
315 |
316 |
317 |
318 | 1673516991757
319 |
320 |
321 | 1673521147550
322 |
323 |
324 |
325 | 1673521147550
326 |
327 |
328 | 1673521664133
329 |
330 |
331 |
332 | 1673521664133
333 |
334 |
335 | 1673521975748
336 |
337 |
338 |
339 | 1673521975748
340 |
341 |
342 | 1673723706460
343 |
344 |
345 |
346 | 1673723706460
347 |
348 |
349 | 1673979049180
350 |
351 |
352 |
353 | 1673979049180
354 |
355 |
356 | 1674915998078
357 |
358 |
359 |
360 | 1674915998078
361 |
362 |
363 | 1675055915512
364 |
365 |
366 |
367 | 1675055915512
368 |
369 |
370 | 1675060726401
371 |
372 |
373 |
374 | 1675060726401
375 |
376 |
377 | 1675138651184
378 |
379 |
380 |
381 | 1675138651184
382 |
383 |
384 | 1675444481154
385 |
386 |
387 |
388 | 1675444481154
389 |
390 |
391 | 1675444519522
392 |
393 |
394 |
395 | 1675444519522
396 |
397 |
398 | 1675444568563
399 |
400 |
401 |
402 | 1675444568563
403 |
404 |
405 | 1675446922404
406 |
407 |
408 |
409 | 1675446922404
410 |
411 |
412 | 1675447353689
413 |
414 |
415 |
416 | 1675447353689
417 |
418 |
419 | 1675447895849
420 |
421 |
422 |
423 | 1675447895849
424 |
425 |
426 | 1675449531953
427 |
428 |
429 |
430 | 1675449531954
431 |
432 |
433 | 1675499060708
434 |
435 |
436 |
437 | 1675499060708
438 |
439 |
440 | 1675500284348
441 |
442 |
443 |
444 | 1675500284348
445 |
446 |
447 | 1675500326689
448 |
449 |
450 |
451 | 1675500326689
452 |
453 |
454 | 1675500931817
455 |
456 |
457 |
458 | 1675500931817
459 |
460 |
461 | 1675501455260
462 |
463 |
464 |
465 | 1675501455260
466 |
467 |
468 | 1675530863853
469 |
470 |
471 |
472 | 1675530863853
473 |
474 |
475 | 1675530869536
476 |
477 |
478 |
479 | 1675530869536
480 |
481 |
482 | 1675536748386
483 |
484 |
485 |
486 | 1675536748387
487 |
488 |
489 | 1678452731847
490 |
491 |
492 |
493 | 1678452731853
494 |
495 |
496 | 1678458887467
497 |
498 |
499 |
500 | 1678458887468
501 |
502 |
503 | 1678459551424
504 |
505 |
506 |
507 | 1678459551424
508 |
509 |
510 | 1678459867811
511 |
512 |
513 |
514 | 1678459867811
515 |
516 |
517 | 1678465857096
518 |
519 |
520 |
521 | 1678465857097
522 |
523 |
524 | 1678466065872
525 |
526 |
527 |
528 | 1678466065873
529 |
530 |
531 | 1678500732660
532 |
533 |
534 |
535 | 1678500732662
536 |
537 |
538 | 1678545253068
539 |
540 |
541 |
542 | 1678545253069
543 |
544 |
545 | 1678553102471
546 |
547 |
548 |
549 | 1678553102471
550 |
551 |
552 | 1678555863313
553 |
554 |
555 |
556 | 1678555863314
557 |
558 |
559 | 1678556420446
560 |
561 |
562 |
563 | 1678556420446
564 |
565 |
566 | 1678587372934
567 |
568 |
569 |
570 | 1678587372934
571 |
572 |
573 | 1678604018764
574 |
575 |
576 |
577 | 1678604018765
578 |
579 |
580 | 1678604049731
581 |
582 |
583 |
584 | 1678604049731
585 |
586 |
587 | 1678604357935
588 |
589 |
590 |
591 | 1678604357935
592 |
593 |
594 | 1678607318945
595 |
596 |
597 |
598 | 1678607318947
599 |
600 |
601 | 1679118516436
602 |
603 |
604 |
605 | 1679118516436
606 |
607 |
608 | 1680964923418
609 |
610 |
611 |
612 | 1680964923419
613 |
614 |
615 | 1680969011754
616 |
617 |
618 |
619 | 1680969011755
620 |
621 |
622 | 1681018523197
623 |
624 |
625 |
626 | 1681018523198
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "githubPullRequests.ignoredPullRequestBranches": [
3 | "main"
4 | ]
5 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | > Notice:
2 | > This plugin is no longer maintained.
3 |
4 |
5 |
6 | # CatSero `v3`
7 |
8 | **Unfinished,请勿使用**
9 |
10 | [](https://www.codacy.com/gh/XiaMoHuaHuo-CN/CatSero/dashboard?utm_source=github.com&utm_medium=referral&utm_content=XiaMoHuaHuo-CN/CatSero&utm_campaign=Badge_Grade)[](https://github.com/XiaMoHuaHuo-CN/CatSero/actions/workflows/main-build.yml)
11 |
12 | ## 使用文档
13 |
14 | 参见:[https://docs.ovome.icu/CatSero](https://docs.ovome.icu/CatSero)
15 |
16 | ### QQ频道
17 |
18 |
19 |
20 | ## 仓库统计
21 |
22 |
23 |
24 | ## bStats
25 |
26 | 
27 |
--------------------------------------------------------------------------------
/RELEASE_TEMPLE.md:
--------------------------------------------------------------------------------
1 | ## 更新说明
2 |
3 | Updates
4 |
5 | ## 更新指南
6 |
7 | Guides
8 |
9 | ## 更新日志
10 |
11 | - Changes
12 |
13 | Full change log: [@version@...@version@](https://github.com/XiaMoHuaHuo-CN/CatSero/compare/@version@...@version@)
14 |
15 | ## Assets说明
16 |
17 | - `Source code (zip, tar.gz)` 源代码
18 | - `CatSero-Artifact.zip` 完整构建输出
19 | - `CatSero-@version@.jar` 适用于 CraftBukkit 及其衍生服务端的 JAR 文件
20 |
--------------------------------------------------------------------------------
/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import org.apache.tools.ant.filters.FixCrLfFilter
2 | import org.apache.tools.ant.filters.ReplaceTokens
3 |
4 | plugins {
5 | id("java")
6 | kotlin("jvm") version "1.9.0"
7 | }
8 |
9 | group = "moe.xmcn.catsero"
10 | version = "3.0.1"
11 |
12 | repositories {
13 | maven("https://maven.fastmirror.net/repositories/minecraft")
14 | maven("https://repo.opencollab.dev/maven-snapshots/")
15 | maven("https://crystal.app.lss233.com/repositories/minecraft")
16 | mavenCentral()
17 | }
18 |
19 | dependencies {
20 | // 本地
21 | implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
22 |
23 | // 远程
24 | implementation("org.spigotmc:spigot-api:1.13-R0.1-SNAPSHOT")
25 | implementation("org.tomlj:tomlj:1.1.0")
26 | implementation("org.bstats:bstats-bukkit:3.0.2")
27 | implementation("me.clip:placeholderapi:2.11.2")
28 | implementation("io.github.dreamvoid:MiraiMC-Bukkit:1.8-pre2")
29 | implementation("com.alibaba:fastjson:2.0.34")
30 | implementation("com.squareup.okhttp3:okhttp:4.11.0")
31 | //implementation("com.github.CroaBeast:AdvancementInfo:2.0.2")
32 | //implementation("com.zaxxer:HikariCP:4.0.3")
33 | //implementation("org.geysermc.floodgate:api:2.2.0-SNAPSHOT")
34 | implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.0")
35 |
36 | testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
37 | testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.3")
38 | testImplementation(kotlin("test"))
39 | }
40 | java {
41 | sourceCompatibility = JavaVersion.VERSION_11
42 | targetCompatibility = JavaVersion.VERSION_11
43 | }
44 |
45 | tasks.getByName("test") {
46 | useJUnitPlatform()
47 | }
48 |
49 | tasks.compileJava {
50 | options.encoding = "UTF-8"
51 | sourceCompatibility = JavaVersion.VERSION_11.toString()
52 | targetCompatibility = JavaVersion.VERSION_11.toString()
53 | }
54 | tasks.compileTestJava {
55 | options.encoding = "UTF-8"
56 | sourceCompatibility = JavaVersion.VERSION_11.toString()
57 | targetCompatibility = JavaVersion.VERSION_11.toString()
58 | }
59 | tasks.compileKotlin {
60 | kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()
61 | }
62 | tasks.compileTestKotlin {
63 | kotlinOptions.jvmTarget = JavaVersion.VERSION_11.toString()
64 | }
65 |
66 | // 替换资源文件的Tokens`config.groovy`
67 | fun loadEnv(): Any {
68 | val configFile = file("config.groovy")
69 | val env = "prod"
70 | val confProp = groovy.util.ConfigSlurper(env).parse(configFile.toURL())
71 | //config.groovy配置文件,配置占位符 (@key@)
72 | val tokens = confProp.toProperties()
73 | logger.lifecycle("Tokens: $tokens")
74 | return tokens;
75 | }
76 |
77 | fun delFiles(dir: String) {
78 | val configs = fileTree(dir)
79 | for (f in configs) {
80 | f.delete()
81 | }
82 | }
83 |
84 | tasks.processResources {
85 | delFiles("$buildDir/resources")
86 | filteringCharset = "UTF-8"
87 | filter(ReplaceTokens::class, "tokens" to loadEnv())
88 | filter(
89 | FixCrLfFilter::class,
90 | "eol" to FixCrLfFilter.CrLf.newInstance("lf"),
91 | "tab" to FixCrLfFilter.AddAsisRemove.newInstance("asis"),
92 | "tablength" to 4,
93 | "eof" to FixCrLfFilter.AddAsisRemove.newInstance("remove"),
94 | "fixlast" to true
95 | )
96 |
97 | }
98 |
99 | tasks.create("fatJar") {
100 | duplicatesStrategy = DuplicatesStrategy.FAIL
101 | val sourceMain = java.sourceSets["main"]
102 | from(sourceMain.output)
103 |
104 | configurations.runtimeClasspath.get().filter {
105 | it.name.startsWith("AdvancementInfo") || it.name.startsWith("HikariCP")
106 | }.forEach { jar ->
107 | from(zipTree(jar))
108 | }
109 | }
110 |
111 | //build命令依赖的其他命令
112 | tasks.build {
113 | dependsOn(
114 | tasks.processResources,
115 | "fatJar"
116 | )
117 | }
--------------------------------------------------------------------------------
/config.groovy:
--------------------------------------------------------------------------------
1 | environments {
2 | prod {
3 | plugin {
4 | version = "3.0.1"
5 | }
6 | }
7 | }
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=http://lss233.littleservice.cn/repositories/gradle-dist/gradle-7.4-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS --illegal-access=permit $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/lib/groovy-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-ant-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-ant-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-ant-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-ant-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-astbuilder-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-astbuilder-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-astbuilder-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-astbuilder-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-cli-commons-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-cli-commons-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-cli-commons-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-cli-commons-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-cli-picocli-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-cli-picocli-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-cli-picocli-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-cli-picocli-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-console-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-console-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-console-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-console-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-contracts-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-contracts-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-contracts-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-contracts-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-datetime-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-datetime-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-datetime-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-datetime-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-dateutil-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-dateutil-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-dateutil-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-dateutil-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-docgenerator-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-docgenerator-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-docgenerator-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-docgenerator-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-ginq-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-ginq-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-ginq-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-ginq-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-groovydoc-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-groovydoc-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-groovydoc-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-groovydoc-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-groovysh-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-groovysh-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-groovysh-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-groovysh-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-jmx-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-jmx-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-jmx-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-jmx-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-json-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-json-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-json-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-json-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-jsr223-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-jsr223-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-jsr223-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-jsr223-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-macro-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-macro-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-macro-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-macro-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-macro-library-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-macro-library-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-macro-library-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-macro-library-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-nio-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-nio-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-nio-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-nio-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-servlet-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-servlet-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-servlet-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-servlet-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-sql-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-sql-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-sql-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-sql-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-swing-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-swing-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-swing-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-swing-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-templates-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-templates-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-templates-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-templates-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-test-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-test-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-test-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-test-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-test-junit5-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-test-junit5-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-test-junit5-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-test-junit5-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-testng-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-testng-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-testng-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-testng-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-toml-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-toml-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-toml-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-toml-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-typecheckers-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-typecheckers-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-typecheckers-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-typecheckers-4.0.2.jar
--------------------------------------------------------------------------------
/lib/groovy-xml-4.0.2-sources.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-xml-4.0.2-sources.jar
--------------------------------------------------------------------------------
/lib/groovy-xml-4.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/lib/groovy-xml-4.0.2.jar
--------------------------------------------------------------------------------
/libs/TrChat-shaded.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Muska-Ami/CatSero/37db5372936b38444f90e9deeed098fa151187d9/libs/TrChat-shaded.jar
--------------------------------------------------------------------------------
/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | rootProject.name = "CatSero"
2 |
--------------------------------------------------------------------------------
/src/main/java/moe/xmcn/catsero/v3/CatSero.java:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.v3;
2 |
3 | import moe.xmcn.catsero.v3.core.CoreRegister;
4 | import moe.xmcn.catsero.v3.util.Logger;
5 | import moe.xmcn.catsero.v3.util.Metrics;
6 | import org.bukkit.plugin.java.JavaPlugin;
7 | import org.tomlj.TomlParseResult;
8 |
9 | import java.util.Objects;
10 |
11 | public class CatSero extends JavaPlugin {
12 |
13 | public static CatSero INSTANCE;
14 |
15 | @Override
16 | public void onLoad() {
17 | super.onLoad();
18 | }
19 |
20 | @Override
21 | public void onEnable() {
22 | INSTANCE = this;
23 | Logger.info("初始化 CatSero");
24 | Configuration.Companion.saveConfig();
25 | Configuration.Companion.loadEnv();
26 | TomlParseResult config = Configuration.Companion.getPluginConfig();
27 |
28 | // 检测是否安装必要依赖
29 | if (Configuration.Depend.Companion.getMiraiMC()) {
30 |
31 | try {
32 | // bStats
33 | if (Objects.requireNonNullElse(config.getBoolean("plugin . allow-bstats"), false)) {
34 | Logger.info("启动 bStats 统计");
35 | new Metrics(this, 14767);
36 | }
37 |
38 | // 核心事件注册
39 | CoreRegister.Companion.registerListener();
40 | CoreRegister.Companion.registerTimer();
41 | } catch (Exception e) {
42 | Logger.catchEx(e);
43 | }
44 |
45 | Logger.info("CatSero 加载完毕");
46 |
47 | } else {
48 | if (Objects.requireNonNullElse(config.getBoolean("plugin . birdge-mode"), false)) {
49 | Logger.info("CatSero 桥接模式加载完毕");
50 | } else {
51 | Logger.error("未安装 MiraiMC ,且桥接模式处于禁用状态, CatSero 将自动禁用");
52 | getPluginLoader().disablePlugin(this);
53 | }
54 | }
55 |
56 | }
57 |
58 | @Override
59 | public void onDisable() {
60 | super.onDisable();
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/main/java/moe/xmcn/catsero/v3/util/Logger.java:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.v3.util;
2 |
3 | import moe.xmcn.catsero.v3.CatSero;
4 | import moe.xmcn.catsero.v3.Configuration;
5 |
6 | import java.util.*;
7 |
8 | public interface Logger {
9 |
10 | java.util.logging.Logger pluginLogger = CatSero.INSTANCE.getLogger();
11 |
12 | /**
13 | * 输出INFO类型的日志
14 | * @param message 消息
15 | */
16 | static void info(String message) {
17 | pluginLogger.info(message);
18 | }
19 |
20 | /**
21 | * 输出INFO类型的日志
22 | * @param message 消息组
23 | */
24 | static void info(String[] message) {
25 | for (int i = 1; i <= message.length; i++) {
26 | info(message[i - 1]);
27 | }
28 | }
29 |
30 | /**
31 | * 输出INFO类型的日志
32 | * @param message 消息组
33 | */
34 | static void info(List message) {
35 | for (int i = 1; i <= message.toArray().length; i++) {
36 | info(message.toArray()[i - 1].toString());
37 | }
38 | }
39 |
40 | /**
41 | * 输出WARN类型的日志
42 | * @param message 消息组
43 | */
44 | static void warn(String message) {
45 | pluginLogger.warning(message);
46 | }
47 |
48 | /**
49 | * 输出WARN类型的日志
50 | * @param message 消息组
51 | */
52 | static void warn(String[] message) {
53 | for (int i = 1; i <= message.length; i++) {
54 | warn(message[i - 1]);
55 | }
56 | }
57 |
58 | /**
59 | * 输出WARN类型的日志
60 | * @param message 消息组
61 | */
62 | static void warn(List message) {
63 | for (int i = 1; i <= message.toArray().length; i++) {
64 | warn(message.toArray()[i - 1].toString());
65 | }
66 | }
67 |
68 | /**
69 | * 输出ERROR类型的日志
70 | * @param message 消息组
71 | */
72 | static void error(String message) {
73 | pluginLogger.severe(message);
74 | }
75 |
76 | /**
77 | * 输出ERROR类型的日志
78 | * @param message 消息组
79 | */
80 | static void error(String[] message) {
81 | for (int i = 1; i <= message.length; i++) {
82 | error(message[i - 1]);
83 | }
84 | }
85 |
86 | /**
87 | * 输出ERROR类型的日志
88 | * @param message 消息组
89 | */
90 | static void error(List message) {
91 | for (int i = 1; i <= message.toArray().length; i++) {
92 | error(message.toArray()[i - 1].toString());
93 | }
94 | }
95 |
96 | static void catchEx(Exception e) {
97 |
98 | StringBuilder stackT = new StringBuilder();
99 | List list = new ArrayList<>();
100 | Collections.addAll(list, e.getStackTrace());
101 | list.forEach(stackT::append);
102 |
103 | String[] message = Arrays.asList(
104 | "CatSero运行时发生错误:" + e.getMessage(),
105 | "堆栈追踪:",
106 | stackT.toString()
107 | ).toArray(new String[0]);
108 |
109 | error(message);
110 | }
111 |
112 | /**
113 | * 输出DEBUG类型的日志
114 | * @param message 消息
115 | */
116 | static void debug(String message) {
117 | if (Objects.requireNonNullElse(Configuration.Companion.getPluginConfig().getBoolean("plugin . debug-log"), false))
118 | info("[DEBUG] " + message);
119 | }
120 | /**
121 | * 输出DEBUG类型的日志
122 | * @param message 消息组
123 | */
124 | static void debug(List message) {
125 | for (int i = 1; i <= message.toArray().length; i++) {
126 | debug(message.toArray()[i - 1].toString());
127 | }
128 | }
129 |
130 | }
131 |
--------------------------------------------------------------------------------
/src/main/kotlin/moe/xmcn/catsero/v3/Configuration.kt:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.v3
2 |
3 | import me.arasple.mc.trchat.TrChat
4 | import moe.xmcn.catsero.v3.util.Logger
5 | import moe.xmcn.catsero.v3.util.TomlUtil
6 | import org.bukkit.Bukkit
7 | import org.tomlj.TomlParseResult
8 | import java.io.File
9 |
10 | interface Configuration {
11 |
12 | // 定义依赖项目是否存在
13 | class Depend {
14 |
15 | companion object {
16 |
17 | var MiraiMC = false
18 | var PlaceholderAPI = false
19 | var TrChat = false
20 |
21 | }
22 | }
23 |
24 | companion object {
25 |
26 | /**
27 | * 获取插件配置文件
28 | */
29 | var pluginConfig: TomlParseResult? = null
30 |
31 |
32 | /**
33 | * 获取功能配置文件
34 | */
35 | var usesConfig: TomlParseResult? = null
36 |
37 | /**
38 | * 获取Bot
39 | * @param id BotID
40 | * @return BotCode
41 | */
42 | fun getBot(id: String): Long? {
43 | return TomlUtil.getTomlResult("mirai.toml").getLong("bot . $id")
44 | }
45 |
46 | /**
47 | * 获取Group
48 | * @param id GroupID
49 | * @return GroupCode
50 | */
51 | fun getGroup(id: String): Long? {
52 | return TomlUtil.getTomlResult("mirai.toml").getLong("group . $id")
53 | }
54 |
55 | /**
56 | * 保存文件
57 | */
58 | fun saveConfig() {
59 | val file = listOf(
60 | "config.toml",
61 | "mirai.toml",
62 | "use-config.toml",
63 | "lang/zh_CN/message.json",
64 | "lang/zh_CN/format.json"
65 | )
66 | file.forEach {
67 | if (!File("${CatSero.INSTANCE.dataFolder}/$it").exists()) {
68 | Logger.info("保存文件: $it")
69 | CatSero.INSTANCE.saveResource(it, false)
70 | }
71 | }
72 | }
73 |
74 | /**
75 | * 初始化环境变量
76 | */
77 | fun loadEnv() {
78 |
79 | pluginConfig = TomlUtil.getTomlResult("config.toml")
80 | usesConfig = TomlUtil.getTomlResult("use-config.toml")
81 |
82 | if (isPluginInstall("MiraiMC")) {
83 | Depend.MiraiMC = true
84 | }
85 | if (isPluginInstall("PlaceholderAPI")) {
86 | Depend.PlaceholderAPI = true
87 | }
88 | if (isPluginInstall("TrChat")) {
89 | Depend.TrChat = true
90 | }
91 |
92 | val authorsbr = StringBuilder()
93 | CatSero.INSTANCE.description.authors.forEach {
94 | authorsbr.append("$it, ")
95 | }
96 | val authors = authorsbr.substring(0, authorsbr.length - 2)
97 |
98 | val info = listOf(
99 | "------ CatSero v3 ------",
100 | "版本: ${CatSero.INSTANCE.description.version}",
101 | "服务器: ${Bukkit.getBukkitVersion()} - ${Bukkit.getVersion()}",
102 | "",
103 | "CatSero v${CatSero.INSTANCE.description.version}",
104 | "由 $authors 制作",
105 | "----------------------------"
106 | )
107 | Logger.info(info)
108 | }
109 |
110 | private fun isPluginInstall(n: String): Boolean {
111 | return Bukkit.getPluginManager().getPlugin(n) != null
112 | }
113 |
114 | }
115 |
116 | }
--------------------------------------------------------------------------------
/src/main/kotlin/moe/xmcn/catsero/v3/I18n.kt:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.v3
2 |
3 | import com.alibaba.fastjson.JSON
4 | import com.alibaba.fastjson.JSONObject
5 | import moe.xmcn.catsero.v3.util.Logger
6 | import java.nio.file.Files
7 | import java.nio.file.Paths
8 |
9 | interface I18n {
10 |
11 | companion object {
12 |
13 | private val lang: String?
14 | get() = Configuration.pluginConfig!!.getString("plugin . lang")
15 |
16 | private val messageJSON: JSONObject
17 | get() = JSON.parseObject(Files.readString(Paths.get("${CatSero.INSTANCE.dataFolder}/lang/$lang/message.json")))
18 | private val formatJSON: JSONObject
19 | get() = JSON.parseObject(Files.readString(Paths.get("${CatSero.INSTANCE.dataFolder}/lang/$lang/format.json")))
20 |
21 | /**
22 | * 获取消息
23 | * @param s 节点
24 | * @return 消息
25 | */
26 | fun getMessage(s: String): String {
27 | return read(s, messageJSON)
28 | }
29 |
30 | /**
31 | * 获取格式
32 | * @param s 节点
33 | * @return 消息
34 | */
35 | fun getFormat(s: String): String {
36 | return read(s, formatJSON)
37 | }
38 |
39 | private fun read(node: String, data: JSONObject): String {
40 | return try {
41 | val nodes = node.split(".")
42 | var resx = JSONObject()
43 | for (i in 1 until nodes.size) {
44 | resx = data.getJSONObject(nodes[i - 1])
45 | }
46 | resx.getString(nodes[nodes.size - 1]) ?: "undefined"
47 | } catch (e: Exception) {
48 | Logger.catchEx(e)
49 | "undefined"
50 | }
51 | }
52 |
53 | }
54 |
55 | }
--------------------------------------------------------------------------------
/src/main/kotlin/moe/xmcn/catsero/v3/UpdateCheck.kt:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.v3
2 |
3 | class UpdateCheck {
4 | // TODO: 检查插件版本更新
5 | }
--------------------------------------------------------------------------------
/src/main/kotlin/moe/xmcn/catsero/v3/core/CoreRegister.kt:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.v3.core
2 |
3 | import moe.xmcn.catsero.v3.CatSero
4 | import moe.xmcn.catsero.v3.Configuration
5 | import moe.xmcn.catsero.v3.core.listener.chatForward.OnQQGroupChat
6 | import moe.xmcn.catsero.v3.core.listener.chatForward.OnTrChatChat
7 | import moe.xmcn.catsero.v3.core.listener.chatForward.OnVanillaChat
8 | import moe.xmcn.catsero.v3.core.listener.joinQuitForward.OnPlayerJoin
9 | import moe.xmcn.catsero.v3.core.timer.chatForward.Filter
10 | import moe.xmcn.catsero.v3.util.Logger
11 | import org.bukkit.event.Listener
12 |
13 | class CoreRegister {
14 |
15 | companion object {
16 |
17 | private val config = Configuration.usesConfig!!
18 |
19 | fun registerListener() {
20 |
21 | Logger.info("开始注册 Listener")
22 |
23 | /*
24 | 定义要注册的监听器列表
25 | 格式:
26 | - 监听器
27 | - 条件
28 | - 追加兼容监听器(Optional)
29 | - 追加兼容条件(Optional)
30 | */
31 | val list = listOf(
32 | // chatForward
33 | listOf(
34 | OnVanillaChat(),
35 | "chatForward . enable",
36 | OnTrChatChat(),
37 | Configuration.Depend.TrChat,
38 | ),
39 | listOf(
40 | OnQQGroupChat(),
41 | "chatForward . enable",
42 | ),
43 | // joinQuitForward
44 | listOf(
45 | OnPlayerJoin(),
46 | "joinQuitForward . enable",
47 | )
48 | )
49 |
50 | list.forEach {
51 | if (it.size == 4) {
52 | // 当追加监听时
53 | if (
54 | config.getBoolean("extra . autoCompatibilityMode") == true
55 | && config.getBoolean(it[1] as String) == true
56 | ) {
57 | if (it[3] as Boolean) {
58 | Logger.info("注册:${it[2].javaClass}")
59 | CatSero.INSTANCE.server.pluginManager.registerEvents(
60 | it[2] as Listener,
61 | CatSero.INSTANCE
62 | )
63 | } else {
64 | Logger.info("注册:${it[0].javaClass}")
65 | CatSero.INSTANCE.server.pluginManager.registerEvents(
66 | it[0] as Listener,
67 | CatSero.INSTANCE
68 | )
69 | }
70 | }
71 | } else if (it.size == 2) {
72 | // 当不追加监听时
73 | if (config.getBoolean(it[1] as String) == true) {
74 | Logger.info("注册:${it[0].javaClass}")
75 | CatSero.INSTANCE.server.pluginManager.registerEvents(
76 | it[0] as Listener,
77 | CatSero.INSTANCE
78 | )
79 | }
80 | } else {
81 | Logger.warn("警告:内部监听注册逻辑不正确,请报告此问题!| $it")
82 | }
83 | }
84 |
85 | /*
86 | if (config.getBoolean("chatForward . enable")!!) {
87 | CatSero.INSTANCE.server.pluginManager.registerEvents(OnVanillaChat(), CatSero.INSTANCE)
88 | }
89 | */
90 |
91 | }
92 |
93 | fun registerTimer() {
94 |
95 | Logger.info("开始注册 Timer")
96 |
97 | val list = listOf(
98 | listOf(
99 | Filter.startUpdate(),
100 | "chatForward . enable",
101 | ),
102 | )
103 |
104 | list.forEach {
105 | if (config.getBoolean(it[1] as String) == true) {
106 | Logger.info("注册:${it[0].javaClass}")
107 | it[0]
108 | }
109 | }
110 | }
111 |
112 | }
113 |
114 |
115 | }
--------------------------------------------------------------------------------
/src/main/kotlin/moe/xmcn/catsero/v3/core/listener/chatForward/OnQQGroupChat.kt:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.v3.core.listener.chatForward
2 |
3 | import me.dreamvoid.miraimc.bukkit.event.message.passive.MiraiGroupMessageEvent
4 | import moe.xmcn.catsero.v3.CatSero
5 | import moe.xmcn.catsero.v3.Configuration
6 | import moe.xmcn.catsero.v3.I18n
7 | import moe.xmcn.catsero.v3.core.timer.chatForward.Filter
8 | import moe.xmcn.catsero.v3.util.Logger
9 | import org.bukkit.ChatColor
10 | import org.bukkit.event.EventHandler
11 | import org.bukkit.event.Listener
12 | import java.text.SimpleDateFormat
13 | import java.util.*
14 |
15 | class OnQQGroupChat: Listener {
16 |
17 | private val config = Configuration.usesConfig!!
18 | private val bot = Configuration.getBot(config.getArray("chatForward . mirai")?.get(0).toString())
19 | private val group = Configuration.getGroup(config.getArray("chatForward . mirai")?.get(1).toString())
20 |
21 |
22 | @EventHandler
23 | fun onMiraiGroupMessageEvent(event: MiraiGroupMessageEvent) {
24 | try {
25 | if (
26 | event.botID == bot
27 | && event.groupID == group
28 | ) {
29 | val groupName = event.groupName
30 | val groupId = event.groupID
31 | val senderName = if (event.senderNameCard != "")
32 | event.senderNameCard
33 | else
34 | event.senderName
35 | val senderId = event.senderID
36 | val message = event.message
37 |
38 | val formatter = SimpleDateFormat(
39 | config.getString("general . timeFormat")
40 | ?: "HH:mm:ss, yyyy-MM-dd"
41 | )
42 | val date = Date(System.currentTimeMillis())
43 |
44 | val format = I18n.getFormat("chatForward.to-mc")
45 |
46 | var res = format.replace("%sender_name%", senderName)
47 | .replace("%sender_id%", senderId.toString())
48 | .replace("%group_name%", groupName)
49 | .replace("%group_id%", groupId.toString())
50 | .replace("%message%", message)
51 | .replace("%time%", formatter.format(date))
52 |
53 | Filter.fullWords.forEach {
54 | res = res.replace(it, config.getString("chatForward.filter . replace") ?: "**")
55 | }
56 | if (CatSero.INSTANCE.server.onlinePlayers.isNotEmpty())
57 | CatSero.INSTANCE.server.broadcastMessage(ChatColor.translateAlternateColorCodes('&', res))
58 | }
59 | } catch (e: Exception) {
60 | Logger.catchEx(e)
61 | }
62 | }
63 |
64 | }
--------------------------------------------------------------------------------
/src/main/kotlin/moe/xmcn/catsero/v3/core/listener/chatForward/OnTrChatChat.kt:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.v3.core.listener.chatForward
2 |
3 | import me.arasple.mc.trchat.api.event.TrChatEvent
4 | import moe.xmcn.catsero.v3.CatSero
5 | import moe.xmcn.catsero.v3.Configuration
6 | import moe.xmcn.catsero.v3.I18n
7 | import moe.xmcn.catsero.v3.core.timer.chatForward.Filter
8 | import moe.xmcn.catsero.v3.util.Logger
9 | import moe.xmcn.catsero.v3.util.MessageSender
10 | import moe.xmcn.catsero.v3.util.PAPI
11 | import org.bukkit.event.EventHandler
12 | import org.bukkit.event.Listener
13 | import org.bukkit.scheduler.BukkitRunnable
14 | import java.text.SimpleDateFormat
15 | import java.util.*
16 |
17 | class OnTrChatChat: Listener {
18 |
19 | private val config = Configuration.usesConfig!!
20 | private val bot = Configuration.getBot(config.getArray("chatForward . mirai")?.get(0).toString())
21 | private val group = Configuration.getGroup(config.getArray("chatForward . mirai")?.get(1).toString())
22 |
23 | @EventHandler
24 | fun onTrChatEvent(event: TrChatEvent) {
25 | try {
26 | if (!event.isCancelled) {
27 | val player = event.session.player
28 | val message = event.message
29 | val channel = event.channel
30 |
31 | config.getArray("extra.trchat . channel")
32 | val formatter = SimpleDateFormat(
33 | config.getString("general . timeFormat")
34 | ?: "HH:mm:ss, yyyy-MM-dd"
35 | )
36 | val date = Date(System.currentTimeMillis())
37 |
38 | val format = I18n.getFormat("chatForward.to-qq")
39 |
40 | var res = format.replace("%name%", player.name)
41 | .replace("%message%", message)
42 | .replace("%time%", formatter.format(date))
43 | res = PAPI.transPlaceholders(res, player)
44 |
45 | Filter.fullWords.forEach {
46 | res = res.replace(it, config.getString("chatForward.filter . replace") ?: "**")
47 | }
48 |
49 | object : BukkitRunnable() {
50 | override fun run() {
51 | MessageSender.sendGroupMessage(res, bot ?: 0, group ?: 0)
52 | }
53 | }.runTaskAsynchronously(CatSero.INSTANCE)
54 | }
55 | } catch (e: Exception) {
56 | Logger.catchEx(e)
57 | }
58 | }
59 |
60 | }
--------------------------------------------------------------------------------
/src/main/kotlin/moe/xmcn/catsero/v3/core/listener/chatForward/OnVanillaChat.kt:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.v3.core.listener.chatForward
2 |
3 | import moe.xmcn.catsero.v3.CatSero
4 | import moe.xmcn.catsero.v3.Configuration
5 | import moe.xmcn.catsero.v3.I18n
6 | import moe.xmcn.catsero.v3.core.timer.chatForward.Filter
7 | import moe.xmcn.catsero.v3.util.Logger
8 | import moe.xmcn.catsero.v3.util.MessageSender
9 | import moe.xmcn.catsero.v3.util.PAPI
10 | import org.bukkit.event.EventHandler
11 | import org.bukkit.event.Listener
12 | import org.bukkit.event.player.AsyncPlayerChatEvent
13 | import org.bukkit.scheduler.BukkitRunnable
14 | import java.text.SimpleDateFormat
15 | import java.util.*
16 |
17 | class OnVanillaChat : Listener {
18 |
19 | private val config = Configuration.usesConfig!!
20 | private val bot = Configuration.getBot(config.getArray("chatForward . mirai")?.get(0).toString())
21 | private val group = Configuration.getGroup(config.getArray("chatForward . mirai")?.get(1).toString())
22 |
23 | @EventHandler
24 | fun onAsyncChatEvent(event: AsyncPlayerChatEvent) {
25 | try {
26 | if (!event.isCancelled) {
27 | val player = event.player
28 | val message = event.message
29 |
30 | val formatter = SimpleDateFormat(
31 | config.getString("general . timeFormat")
32 | ?: "HH:mm:ss, yyyy-MM-dd"
33 | )
34 | val date = Date(System.currentTimeMillis())
35 |
36 | val format = I18n.getFormat("chatForward.to-qq")
37 |
38 | var res = format.replace("%name%", player.name)
39 | .replace("%message%", message)
40 | .replace("%time%", formatter.format(date))
41 | res = PAPI.transPlaceholders(res, player)
42 |
43 | Filter.fullWords.forEach {
44 | res = res.replace(it, config.getString("chatForward.filter . replace ") ?: "**")
45 | }
46 |
47 | object : BukkitRunnable() {
48 | override fun run() {
49 | MessageSender.sendGroupMessage(res, bot ?: 0, group ?: 0)
50 | }
51 | }.runTaskAsynchronously(CatSero.INSTANCE)
52 | }
53 | } catch (e: Exception) {
54 | Logger.catchEx(e)
55 | }
56 | }
57 |
58 | }
--------------------------------------------------------------------------------
/src/main/kotlin/moe/xmcn/catsero/v3/core/listener/joinQuitForward/OnPlayerJoin.kt:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.v3.core.listener.joinQuitForward
2 |
3 | import moe.xmcn.catsero.v3.Configuration
4 | import moe.xmcn.catsero.v3.I18n
5 | import moe.xmcn.catsero.v3.util.Logger
6 | import moe.xmcn.catsero.v3.util.MessageSender
7 | import moe.xmcn.catsero.v3.util.PAPI
8 | import org.bukkit.ChatColor
9 | import org.bukkit.event.EventHandler
10 | import org.bukkit.event.Listener
11 | import org.bukkit.event.player.PlayerJoinEvent
12 | import org.bukkit.scheduler.BukkitRunnable
13 |
14 | class OnPlayerJoin: Listener {
15 |
16 | private val config = Configuration.usesConfig!!
17 | private val bot = Configuration.getBot(config.getArray("joinQuitForward . mirai")?.get(0).toString())
18 | private val group = Configuration.getGroup(config.getArray("joinQuitForward . mirai")?.get(1).toString())
19 |
20 | @EventHandler
21 | fun onPlayerJoin(event: PlayerJoinEvent) {
22 | Logger.debug("joinQuitForward 有反应就吱一声吧")
23 | try {
24 | val player = event.player
25 |
26 | var res: String? = null
27 | // Copy from event.joinMessage()
28 | if (config.getBoolean("joinQuitForward . copyMessage") != true) {
29 | Logger.debug("不从事件中复制加入消息")
30 | val format = I18n.getFormat("joinQuitForward.join")
31 | res = format.replace("%name%", player.name)
32 | res = PAPI.transPlaceholders(res, player)
33 | } else {
34 | Logger.debug("从事件中复制加入消息")
35 | if (event.joinMessage != null)
36 | res = ChatColor.stripColor(event.joinMessage)
37 | }
38 |
39 | object : BukkitRunnable() {
40 | override fun run() {
41 | if (res != null)
42 | MessageSender.sendGroupMessage(res, bot ?: 0, group ?: 0)
43 | }
44 | }
45 | } catch (e: Exception) {
46 | Logger.catchEx(e)
47 | }
48 | }
49 |
50 | }
--------------------------------------------------------------------------------
/src/main/kotlin/moe/xmcn/catsero/v3/core/timer/chatForward/Filter.kt:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.v3.core.timer.chatForward
2 |
3 | import com.alibaba.fastjson.JSON
4 | import com.alibaba.fastjson.JSONArray
5 | import moe.xmcn.catsero.v3.CatSero
6 | import moe.xmcn.catsero.v3.Configuration
7 | import moe.xmcn.catsero.v3.util.Logger
8 | import okhttp3.OkHttpClient
9 | import okhttp3.Request
10 | import java.nio.file.Files
11 | import java.nio.file.Paths
12 |
13 | class Filter: Runnable {
14 |
15 | companion object {
16 | @JvmStatic
17 | private var lastImportLength: Int = 0
18 | @JvmStatic
19 | val fullWords = ArrayList()
20 |
21 | fun startUpdate() {
22 | // 聊天转发屏蔽词
23 | if (Configuration.usesConfig!!.getBoolean("chatForward.filter . enable") == true) {
24 | if (Configuration.usesConfig!!.getBoolean("chatForward.filter.autoUpdate . enable") == true) {
25 | Logger.info("Start chatForward filter auto-update.")
26 | CatSero.INSTANCE.server.scheduler.runTaskTimerAsynchronously(
27 | CatSero.INSTANCE,
28 | Filter(),
29 | 0L,
30 | (Configuration.usesConfig!!.getLong("chatForward.filter.autoUpdate . interval") ?: 300) * 20L
31 | )
32 | } else {
33 | Logger.info("Update chatForward filter words.")
34 | Filter().updateList()
35 | }
36 | }
37 | }
38 | }
39 |
40 | private fun updateList() {
41 | val remoteUrls = Configuration.usesConfig!!.getArray("chatForward.filter.remote . remoteUrls")
42 | val localFiles = Configuration.usesConfig!!.getArray("chatForward.filter.local . localFiles")
43 | val publicWords = ArrayList()
44 |
45 | val client = OkHttpClient()
46 |
47 | var jsonData: JSONArray? = null
48 |
49 | if (Configuration.usesConfig!!.getBoolean("chatForward.filter.local . enable") == true) {
50 | Logger.debug("更新本地屏蔽词")
51 | localFiles!!.toList().forEach { path ->
52 | run {
53 | Logger.debug("运行了一次更新:$path")
54 | //读取文件
55 | val lines = Files.readAllLines(Paths.get(path as String))
56 | val data = StringBuilder()
57 | lines.forEach(
58 | data::append
59 | )
60 |
61 | try {
62 | jsonData = JSON.parseObject(data.toString()).getJSONArray("words")
63 | } catch (e: Exception) {
64 | Logger.warn("无法解析本地源屏蔽词数据: " + e.message + " | 源: " + path)
65 | }
66 |
67 | if (jsonData != null) {
68 | Logger.debug("LOCAL: $jsonData")
69 | // 遍历并添加屏蔽词
70 | val wordsLength = jsonData!!.toArray().size
71 | for (i in 0 until wordsLength) {
72 | publicWords.add(jsonData!![i].toString())
73 | }
74 | jsonData = null
75 | }
76 | }
77 | }
78 | }
79 |
80 | if (Configuration.usesConfig!!.getBoolean("chatForward.filter.remote . enable") == true) {
81 | Logger.debug("更新远程屏蔽词")
82 | remoteUrls!!.toList().forEach { url ->
83 | run {
84 | Logger.debug("运行了一次更新:$url")
85 | val res: String?
86 | try {
87 | val getRequest = Request.Builder()
88 | .url(url as String)
89 | .build()
90 | val response = client.newCall(getRequest).execute()
91 | if (response.isSuccessful) {
92 | res = response.body?.string()
93 | } else {
94 | Logger.warn("无法请求远程源屏蔽词: " + response.code + " | 源: " + url)
95 | return
96 | }
97 | } catch (e: Exception) {
98 | Logger.warn("无法请求远程源屏蔽词: " + e.message + " | 源: " + url)
99 | return
100 | }
101 |
102 | if (res != null) {
103 | try {
104 | jsonData = JSON.parseObject(res).getJSONArray("words")
105 | } catch (e: Exception) {
106 | Logger.warn("无法解析远程源屏蔽词数据: " + e.message + " | 源: " + url)
107 | return
108 | }
109 |
110 | if (jsonData != null) {
111 | Logger.debug("REMOTE: $jsonData")
112 | // 遍历并添加屏蔽词
113 | val wordsLength = jsonData!!.toArray().size
114 | for (i in 0 until wordsLength) {
115 | publicWords.add(jsonData!![i].toString())
116 | }
117 | jsonData = null
118 | }
119 | }
120 | }
121 | }
122 | }
123 |
124 | fullWords.addAll(publicWords)
125 | Logger.debug("当前屏蔽词列表:$fullWords")
126 |
127 | if (lastImportLength != publicWords.size) {
128 | Logger.info("成功更新了 " + (publicWords.size - lastImportLength) + " 个屏蔽词,当前屏蔽词数量: " + publicWords.size)
129 | lastImportLength = publicWords.size
130 | Logger.debug("屏蔽词计数:$lastImportLength")
131 | }
132 | }
133 |
134 | override fun run() {
135 | Filter().updateList()
136 | }
137 | }
--------------------------------------------------------------------------------
/src/main/kotlin/moe/xmcn/catsero/v3/util/MessageSender.kt:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.v3.util
2 |
3 | import me.dreamvoid.miraimc.api.MiraiBot
4 | import me.dreamvoid.miraimc.httpapi.MiraiHttpAPI
5 | import moe.xmcn.catsero.v3.Configuration
6 |
7 | interface MessageSender {
8 |
9 | companion object {
10 |
11 | /**
12 | * 发消息到QQ群
13 | * @param message 消息
14 | * @param bot 机器人
15 | * @param group 群
16 | */
17 | fun sendGroupMessage(message: String, bot: Long, group: Long) {
18 | // miraiCode支持
19 | if (Configuration.pluginConfig!!.getBoolean("mirai . enable-miraicode-support") == true)
20 | MiraiBot.getBot(bot).getGroup(group).sendMessageMirai(message)
21 | else
22 | MiraiBot.getBot(bot).getGroup(group).sendMessage(message)
23 | }
24 |
25 | }
26 |
27 | }
--------------------------------------------------------------------------------
/src/main/kotlin/moe/xmcn/catsero/v3/util/PAPI.kt:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.v3.util
2 |
3 | import me.clip.placeholderapi.PlaceholderAPI
4 | import moe.xmcn.catsero.v3.Configuration
5 | import org.bukkit.command.CommandSender
6 | import org.bukkit.entity.Player
7 |
8 | interface PAPI {
9 |
10 | companion object {
11 |
12 | /**
13 | * 转换Placeholders
14 | *
15 | * @param s 需要转换的文本
16 | * @param player 玩家
17 | *
18 | * @return 已转换的文本
19 | */
20 | fun transPlaceholders(s: String, player: Player): String {
21 | return if (Configuration.Depend.PlaceholderAPI)
22 | PlaceholderAPI.setBracketPlaceholders(player, s)
23 | else s
24 | }
25 |
26 | /**
27 | * 转换Placeholders
28 | *
29 | * @param s 需要转换的文本
30 | * @param player 玩家
31 | *
32 | * @return 已转换的文本
33 | */
34 | fun transPlaceholders(s: String, player: CommandSender): String {
35 | return if (Configuration.Depend.PlaceholderAPI)
36 | PlaceholderAPI.setBracketPlaceholders(player as Player, s)
37 | else s
38 | }
39 |
40 | }
41 |
42 | }
--------------------------------------------------------------------------------
/src/main/kotlin/moe/xmcn/catsero/v3/util/TomlUtil.kt:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.v3.util
2 |
3 | import moe.xmcn.catsero.v3.CatSero
4 | import org.tomlj.Toml
5 | import org.tomlj.TomlParseResult
6 | import java.nio.file.Paths
7 |
8 |
9 | interface TomlUtil {
10 |
11 | companion object {
12 |
13 | /**
14 | * 获取Toml
15 | * @param file 文件
16 | */
17 | fun getTomlResult(file: String): TomlParseResult {
18 | val result: TomlParseResult = Toml.parse(Paths.get("${CatSero.INSTANCE.dataFolder}/$file"))
19 | result.errors().forEach { Logger.catchEx(it) }
20 | return result
21 | }
22 |
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/src/main/resources/config.toml:
--------------------------------------------------------------------------------
1 | # CatSero v3 配置文件
2 | ## 配置文件文档请参阅:
3 | ## https://docs.ovome.icu/CatSero/config/
4 |
5 | # 插件本体配置
6 | [plugin]
7 | # 接受bStats统计
8 | allow-bstats = true
9 | # 启用PlaceholderAPI支持
10 | # 前置: PlaceholderAPI
11 | enable-papi-support = true
12 | # 语言模式
13 | # 自动读取 `lang/${lang}` 目录下的语言
14 | lang = "zh_CN"
15 | # 输出DEBUG日志
16 | debug-log = false
17 |
18 | # mirai扩展配置
19 | [mirai]
20 | # 启用miraiCode
21 | enable-miraicode-support = false
22 |
23 | # 插件更新设置
24 | [update]
25 | # 是否启用
26 | enable = true
27 | # 要从哪里拉取版本信息
28 | # 一般情况下无需修改
29 | update-server = "https://api.huahuo-cn.tk/mcplugins/CatSero/version"
--------------------------------------------------------------------------------
/src/main/resources/lang/zh_CN/format.json:
--------------------------------------------------------------------------------
1 | {
2 | "chatForward": {
3 | "to-mc": "[&aQQ&r]&b%sender_name%&r(&e%group_name%/%group_id%&r): %message%",
4 | "to-qq": "[MC]%name%:\n%message%"
5 | },
6 | "joinQuitForward": {
7 | "join": "%name% 加入了游戏",
8 | "quit": "%name% 退出了游戏"
9 | }
10 | }
--------------------------------------------------------------------------------
/src/main/resources/lang/zh_CN/message.json:
--------------------------------------------------------------------------------
1 | {
2 | "minecraft": {},
3 | "qq": {}
4 | }
--------------------------------------------------------------------------------
/src/main/resources/mirai.toml:
--------------------------------------------------------------------------------
1 | # CatSero v3 mirai配置文件
2 | ## 配置文件文档请参阅:
3 | ## https://docs.ovome.icu/CatSero/config/
4 |
5 | # 可用Bot列表
6 | [bot]
7 | geKo = 123456
8 | sama = 114514
9 |
10 | # 可用Group列表
11 | [group]
12 | hikari = 987654321
13 | homo = 123456789
--------------------------------------------------------------------------------
/src/main/resources/plugin.yml:
--------------------------------------------------------------------------------
1 | name: CatSero
2 | main: moe.xmcn.catsero.v3.CatSero
3 | description: 基于MiraiMC的Minecraft功能插件
4 | version: @plugin.version@
5 | api-version: 1.13
6 | authors:
7 | - XiaMoHuaHuo_CN
8 | - The Love ❤
9 | softdepend:
10 | - MiraiMC
11 | - PlaceholderAPI
12 | - TrChat
13 | libraries:
14 | - "org.jetbrains.kotlin:kotlin-stdlib:1.9.0"
15 | - "com.alibaba:fastjson:2.0.34"
16 | - "org.tomlj:tomlj:1.1.0"
17 | - "com.squareup.okhttp3:okhttp:4.11.0"
18 | commands:
19 | catsero:
20 | description: "CatSero 基础方法"
21 | usage: "/catsero "
22 | subcommands:
23 | version:
24 | description: "插件版本以及信息"
25 |
26 | permissions:
27 | catsero.*:
28 | description: "CatSero所有权限组"
29 | default: false
30 | children:
31 | catsero.admin:
32 | description: "CatSero OP权限组"
33 | default: op
34 |
--------------------------------------------------------------------------------
/src/main/resources/use-config.toml:
--------------------------------------------------------------------------------
1 | # CatSero v3 功能配置文件
2 | ## 配置文件文档请参阅:
3 | ## https://docs.ovome.icu/CatSero/config/
4 |
5 | [general]
6 | timeFormat = "HH:mm:ss, yyyy-MM-dd"
7 |
8 | # 聊天转发
9 | [chatForward]
10 | # 是否启用该功能
11 | enable = false
12 | # Bot定义
13 | mirai = ["geKo", "hikari"]
14 | # 屏蔽词
15 | [chatForward.filter]
16 | # 是否启用该功能
17 | enable = false
18 | # 替换成的字符
19 | replace = "**"
20 | # 本地屏蔽词
21 | [chatForward.filter.local]
22 | # 启用该功能
23 | enable = false
24 | # 本地屏蔽词文件列表
25 | # 请填写文件绝对路径
26 | localFiles = []
27 | # 远程屏蔽词
28 | [chatForward.filter.remote]
29 | # 是否启用该功能
30 | enable = false
31 | # 远程屏蔽词列表
32 | # 此处使用的是TrChat的默认远程源
33 | # 感谢 @南城 提供的词库(已改为Jsdelivr CDN)
34 | remoteUrls = [
35 | "https://fastly.jsdelivr.net/gh/Yurinann/Filter-Thesaurus-Cloud@main/database.json"
36 | ]
37 | # 自动更新源
38 | [chatForward.filter.autoUpdate]
39 | # 是否启用该功能
40 | enable = true
41 | # 更新间隔
42 | interval = 300
43 |
44 | # 加入退出转发
45 | [joinQuitForward]
46 | # 是否启用该功能
47 | enable = false
48 | # Bot定义
49 | mirai = ["geKo", "hikari"]
50 | # 从接收的事件中同步消息
51 | copyMessage = false
52 |
53 | # 附加设置
54 | [extra]
55 | # 启用自动兼容模式
56 | autoCompatibilityMode = true
57 | # TrChat
58 | [extra.trchat]
59 | channels = ["Global", "Normal"]
--------------------------------------------------------------------------------
/src/test/java/moe/xmcn/catsero/ChatExample.java:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero;
2 |
3 | import org.bukkit.event.EventHandler;
4 | import org.bukkit.event.Listener;
5 | import org.bukkit.event.player.AsyncPlayerChatEvent;
6 |
7 | public class ChatExample implements Listener {
8 |
9 | /**
10 | * 事件监听
11 | * AsyncPlayerChatEvent
12 | */
13 | @EventHandler
14 | public void onChat(AsyncPlayerChatEvent apce) {
15 | // 取消事件
16 | apce.setCancelled(true);
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/src/test/java/moe/xmcn/catsero/FileReaderTest.java:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero;
2 |
3 | import java.io.File;
4 | import java.io.FileReader;
5 | import java.io.FileWriter;
6 | import java.io.IOException;
7 |
8 | public class FileReaderTest {
9 | public static void main(String[] args) throws IOException {
10 | File file = new File("E:/Temp/Hello1.txt");
11 | // 创建文件
12 | file.createNewFile();
13 | // creates a FileWriter Object
14 | FileWriter writer = new FileWriter(file);
15 | // 向文件写入内容
16 | writer.write("This\n is\n an\n example\n");
17 | writer.flush();
18 | writer.close();
19 | // 创建 FileReader 对象
20 | FileReader fr = new FileReader(file);
21 | char[] a = new char[50];
22 | fr.read(a); // 读取数组中的内容
23 | for (char c : a)
24 | System.out.print(c); // 一个一个打印字符
25 | fr.close();
26 | }
27 | }
--------------------------------------------------------------------------------
/src/test/java/moe/xmcn/catsero/TestGetFileProtocol.java:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero;
2 |
3 | import moe.xmcn.catsero.utils.HttpClient;
4 |
5 | public class TestGetFileProtocol {
6 | public static void main(String[] args) {
7 | new HttpClient().getRequest("file://E:/Downloads/database.json");
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/test/java/moe/xmcn/catsero/utils/HttpClient.java:
--------------------------------------------------------------------------------
1 | package moe.xmcn.catsero.utils;/*
2 | * CatSero v2
3 | * 此文件为 Minecraft服务器 插件 CatSero 的一部分
4 | * 请在符合开源许可证的情况下修改/发布
5 | * This file is part of the Minecraft Server plugin CatSero
6 | * Please modify/publish subject to open source license
7 | *
8 | * Copyright 2022 XiaMoHuaHuo_CN.
9 | *
10 | * GitHub: https://github.com/XiaMoHuaHuo-CN/CatSero
11 | * License: GNU Affero General Public License v3.0
12 | * https://github.com/XiaMoHuaHuo-CN/CatSero/blob/main/LICENSE
13 | *
14 | * Permissions of this strongest copyleft license are
15 | * conditioned on making available complete source code
16 | * of licensed works and modifications, which include
17 | * larger works using a licensed work, under the same
18 | * license. Copyright and license notices must be preserved.
19 | * Contributors provide an express grant of patent rights.
20 | * When a modified version is used to provide a service over
21 | * a network, the complete source code of the modified
22 | * version must be made available.
23 | */
24 |
25 | import java.io.BufferedReader;
26 | import java.io.InputStreamReader;
27 | import java.net.URL;
28 | import java.net.URLConnection;
29 |
30 | public class HttpClient {
31 |
32 | public String getRequest(String url) {
33 | StringBuilder result = new StringBuilder();
34 | BufferedReader in = null;
35 | try {
36 | URL realUrl = new URL(url);
37 | //打开和URL之间的连接
38 | URLConnection conn = realUrl.openConnection();
39 | //设置通用的请求属性
40 | conn.setRequestProperty("accept", "charset=UTF-8");
41 | conn.setRequestProperty("connection", "Keep-Alive");
42 | conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
43 | //建立实际的连接
44 | conn.connect();
45 | //定义BufferedReader输入流来读取URL的响应
46 | in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
47 | String line;
48 | while ((line = in.readLine()) != null) {
49 | result.append(line);
50 | }
51 | } catch (Exception e) {
52 | e.printStackTrace();
53 | }
54 | //使用finally块来关闭输入流
55 | finally {
56 | try {
57 | if (in != null) {
58 | in.close();
59 | }
60 | } catch (Exception ex) {
61 | ex.printStackTrace();
62 | }
63 | }
64 | return result.toString();
65 | }
66 |
67 | public String getRequest(String url, String param) {
68 | StringBuilder result = new StringBuilder();
69 | BufferedReader in = null;
70 | try {
71 | String urlName = url + "?" + param;
72 | URL realUrl = new URL(urlName);
73 | //打开和URL之间的连接
74 | URLConnection conn = realUrl.openConnection();
75 | //设置通用的请求属性
76 | conn.setRequestProperty("accept", "charset=UTF-8");
77 | conn.setRequestProperty("connection", "Keep-Alive");
78 | conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
79 | //建立实际的连接
80 | conn.connect();
81 | //定义BufferedReader输入流来读取URL的响应
82 | in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
83 | String line;
84 | while ((line = in.readLine()) != null) {
85 | result.append(line);
86 | }
87 | } catch (Exception e) {
88 | e.printStackTrace();
89 | }
90 | //使用finally块来关闭输入流
91 | finally {
92 | try {
93 | if (in != null) {
94 | in.close();
95 | }
96 | } catch (Exception ex) {
97 | ex.printStackTrace();
98 | }
99 | }
100 | return result.toString();
101 | }
102 |
103 | }
104 |
--------------------------------------------------------------------------------