mcserver-cli 3.0.0__tar.gz → 4.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/CHANGELOG.md +34 -4
  2. mcserver_cli-4.0.0/CONTRIBUTING.md +16 -0
  3. mcserver_cli-4.0.0/LICENSE +9 -0
  4. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/NOTES.txt +148 -30
  5. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/PKG-INFO +25 -16
  6. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/README.md +23 -13
  7. mcserver_cli-4.0.0/legacy/mcserver_v2.0.0.py +1119 -0
  8. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/pyproject.toml +7 -5
  9. mcserver_cli-4.0.0/src/mcserver/__init__.py +1 -0
  10. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/app.py +13 -9
  11. mcserver_cli-4.0.0/src/mcserver/caching.py +16 -0
  12. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/cli.py +117 -111
  13. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/commands/__init__.py +12 -12
  14. mcserver_cli-4.0.0/src/mcserver/commands/add.py +232 -0
  15. mcserver_cli-4.0.0/src/mcserver/commands/import_setup.py +9 -0
  16. mcserver_cli-3.0.0/src/mcserver/commands/initialize_server.py → mcserver_cli-4.0.0/src/mcserver/commands/init.py +53 -16
  17. mcserver_cli-4.0.0/src/mcserver/commands/list_projects.py +8 -0
  18. mcserver_cli-4.0.0/src/mcserver/commands/op_grant.py +9 -0
  19. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/commands/op_list.py +4 -4
  20. mcserver_cli-4.0.0/src/mcserver/commands/op_revoke.py +9 -0
  21. mcserver_cli-4.0.0/src/mcserver/commands/remove_projects.py +8 -0
  22. mcserver_cli-4.0.0/src/mcserver/commands/search.py +187 -0
  23. mcserver_cli-4.0.0/src/mcserver/commands/server_status.py +8 -0
  24. mcserver_cli-4.0.0/src/mcserver/commands/show.py +105 -0
  25. mcserver_cli-3.0.0/src/mcserver/commands/start_server.py → mcserver_cli-4.0.0/src/mcserver/commands/start.py +45 -20
  26. mcserver_cli-4.0.0/src/mcserver/commands/stop.py +22 -0
  27. mcserver_cli-4.0.0/src/mcserver/commands/update_projects.py +8 -0
  28. mcserver_cli-4.0.0/src/mcserver/commands/whitelist_add.py +9 -0
  29. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/commands/whitelist_list.py +4 -3
  30. mcserver_cli-4.0.0/src/mcserver/commands/whitelist_remove.py +33 -0
  31. mcserver_cli-4.0.0/src/mcserver/config.py +71 -0
  32. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/constants.py +0 -2
  33. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/fabricmc/meta.py +1 -1
  34. mcserver_cli-4.0.0/src/mcserver/metadata.py +35 -0
  35. mcserver_cli-4.0.0/src/mcserver/modrinth/apis/__init__.py +9 -0
  36. mcserver_cli-4.0.0/src/mcserver/modrinth/apis/get_project_informations.py +214 -0
  37. mcserver_cli-4.0.0/src/mcserver/modrinth/apis/get_project_versions.py +173 -0
  38. mcserver_cli-4.0.0/src/mcserver/modrinth/apis/search_projects.py +159 -0
  39. mcserver_cli-4.0.0/src/mcserver/modrinth/constants.py +1 -0
  40. mcserver_cli-4.0.0/src/mcserver/modrinth/paths.py +3 -0
  41. mcserver_cli-4.0.0/src/mcserver/modrinth/project_records.py +115 -0
  42. mcserver_cli-4.0.0/src/mcserver/modrinth/shared.py +95 -0
  43. mcserver_cli-4.0.0/src/mcserver/modrinth/slug_index.py +128 -0
  44. mcserver_cli-4.0.0/src/mcserver/modrinth/typings/__init__.py +50 -0
  45. mcserver_cli-4.0.0/src/mcserver/modrinth/typings/project_information.py +139 -0
  46. mcserver_cli-4.0.0/src/mcserver/modrinth/typings/project_version.py +90 -0
  47. mcserver_cli-4.0.0/src/mcserver/modrinth/typings/search_projects.py +94 -0
  48. mcserver_cli-4.0.0/src/mcserver/modrinth/typings/shared.py +17 -0
  49. mcserver_cli-4.0.0/src/mcserver/mysterious.py +25 -0
  50. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/networking.py +17 -7
  51. mcserver_cli-4.0.0/src/mcserver/paths.py +19 -0
  52. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/resolver.py +94 -26
  53. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/server_files/properties.py +8 -7
  54. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/server_files/whitelist.py +60 -39
  55. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/shared.py +86 -22
  56. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/state.py +22 -14
  57. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/zip_app.py +14 -7
  58. mcserver_cli-3.0.0/LICENSE +0 -9
  59. mcserver_cli-3.0.0/mcserver_search.txt +0 -20
  60. mcserver_cli-3.0.0/mcserver_test.py +0 -23
  61. mcserver_cli-3.0.0/src/mcserver/__init__.py +0 -1
  62. mcserver_cli-3.0.0/src/mcserver/caching.py +0 -0
  63. mcserver_cli-3.0.0/src/mcserver/commands/add_projects.py +0 -7
  64. mcserver_cli-3.0.0/src/mcserver/commands/import_setup.py +0 -6
  65. mcserver_cli-3.0.0/src/mcserver/commands/list_projects.py +0 -6
  66. mcserver_cli-3.0.0/src/mcserver/commands/op_grant.py +0 -7
  67. mcserver_cli-3.0.0/src/mcserver/commands/op_revoke.py +0 -7
  68. mcserver_cli-3.0.0/src/mcserver/commands/remove_projects.py +0 -6
  69. mcserver_cli-3.0.0/src/mcserver/commands/search_projects.py +0 -7
  70. mcserver_cli-3.0.0/src/mcserver/commands/server_status.py +0 -6
  71. mcserver_cli-3.0.0/src/mcserver/commands/show_projects.py +0 -26
  72. mcserver_cli-3.0.0/src/mcserver/commands/stop_server.py +0 -46
  73. mcserver_cli-3.0.0/src/mcserver/commands/update_projects.py +0 -6
  74. mcserver_cli-3.0.0/src/mcserver/commands/whitelist_add.py +0 -7
  75. mcserver_cli-3.0.0/src/mcserver/commands/whitelist_remove.py +0 -31
  76. mcserver_cli-3.0.0/src/mcserver/commandsa.py +0 -1297
  77. mcserver_cli-3.0.0/src/mcserver/config.py +0 -37
  78. mcserver_cli-3.0.0/src/mcserver/metadata.py +0 -33
  79. mcserver_cli-3.0.0/src/mcserver/modrinth/api.py +0 -657
  80. mcserver_cli-3.0.0/src/mcserver/modrinth/project_records/metadata.py +0 -0
  81. mcserver_cli-3.0.0/src/mcserver/modrinth/project_records/relationships.py +0 -203
  82. mcserver_cli-3.0.0/src/mcserver/modrinth/project_records/shared.py +0 -9
  83. mcserver_cli-3.0.0/src/mcserver/modrinth/shared.py +0 -13
  84. mcserver_cli-3.0.0/src/mcserver/modrinth/slug_index.py +0 -36
  85. mcserver_cli-3.0.0/src/mcserver/mysterious.py +0 -5
  86. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/.gitignore +0 -0
  87. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/__main__.py +0 -0
  88. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/__main__.py +0 -0
  89. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/commands/print_help.py +0 -0
  90. {mcserver_cli-3.0.0/src/mcserver/legacyfabric → mcserver_cli-4.0.0/src/mcserver/legacy_fabric}/meta.py +0 -0
  91. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/minecraft/api.py +0 -0
  92. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/minecraft/player_identity.py +0 -0
  93. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/modrinth/modpack.py +0 -0
  94. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/modrinth/projects.py +0 -0
  95. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/mojang/eula.py +0 -0
  96. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/mojang/manifest.py +0 -0
  97. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/papermc/api.py +0 -0
  98. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/purpurmc/api.py +0 -0
  99. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/quiltmc/meta.py +0 -0
  100. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/server_files/banned_ips.py +0 -0
  101. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/server_files/banned_players.py +0 -0
  102. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/server_files/ops.py +0 -0
  103. {mcserver_cli-3.0.0 → mcserver_cli-4.0.0}/src/mcserver/server_files/usercaches.py +0 -0
@@ -5,13 +5,41 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [Unreleased]
8
+ ## [4.0.0] - 2026-10-31
9
9
 
10
10
  ### Added
11
11
 
12
- - Paper and Purpur as server software
12
+ - Working `show` command
13
+ - Working `search` command
14
+ - New `--game-version` and `--loader` options to the `search` command
15
+ - New `--search-sort` and `--search-limit` options to the `init` command
16
+
17
+ ### Changed
18
+
19
+ - Moved `slug_index.json` to global `.mcserver` cache
20
+ - More information that the `show` command output
21
+ - Better `search` info message
22
+ - slug_index.json is now a global cache
23
+
24
+ ### Fixes
25
+
26
+ - Typo in the `add` command help
27
+
28
+ ## [3.0.0] - 2026-08-18
29
+
30
+ ### Added
31
+
32
+ - Command to stop the Minecraft server
33
+ - Paper and Purpur server software
13
34
  - Metadata to keep information of what version of MCServer is used
14
- - State to keep information of a running MCServer to avoid conflict
35
+ - State to keep information of a running MCServer to avoid conflicting command
36
+ - Listing whitelisted players
37
+ - Listing operator players
38
+
39
+ ### Changed
40
+
41
+ - Uh... add, search, and show, are being worked on (they're not available for now)
42
+ - The codebase is now bigger with small gain (for the user)
15
43
 
16
44
  ## [2.0.0] - 2026-06-14
17
45
 
@@ -187,7 +215,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
187
215
  - Better mod conflict error
188
216
  - Faster mod resolving
189
217
 
190
- [unreleased]: https://github.com/Othecat35/MCServer/compare/v2.0.0...HEAD
218
+ [unreleased]: https://github.com/Othecat35/MCServer/compare/v4.0.0...HEAD
219
+ [4.0.0]: https://github.com/Othecat35/MCServer/compare/v3.0.0...v4.0.0
220
+ [3.0.0]: https://github.com/Othecat35/MCServer/compare/v2.0.0...v3.0.0
191
221
  [2.0.0]: https://github.com/Othecat35/MCServer/compare/v1.13.16...v2.0.0
192
222
  [1.13.16]: https://github.com/Othecat35/MCServer/compare/v1.13.15...v1.13.16
193
223
  [1.13.15]: https://github.com/Othecat35/MCServer/compare/v1.13.14...v1.13.15
@@ -0,0 +1,16 @@
1
+ # License
2
+
3
+ By submitting a pull request, you agree that your contribution is licensed under the MIT License.
4
+
5
+ # Development
6
+
7
+ - Python >= 3.12 (3.14 is recommended)
8
+ - Install with `pip install -e .`
9
+ - Use `ruff format` to reformat code
10
+
11
+ # Release
12
+
13
+ 1. Bump version in `src/mcserver/__init__.py`
14
+ 2. `python zip_app.py`
15
+ 3. Tag: `git tag vX.Y.Z && git push --tags`
16
+ 4. Create GitHub release, attach `dist/mcserver`
@@ -0,0 +1,9 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Othecat35
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -119,22 +119,27 @@ mod indexing, don't forget! don't remind me the... 3rd time?
119
119
  Gemini suggest adding "status" command and get ram usage info, sure but not now. oh good idea I guess
120
120
 
121
121
  Things that MCServer can touch (In theory):
122
+
123
+ XDG Cache
124
+ - mcserver
125
+ - slug_index.json
126
+
127
+
128
+ Home Directory
129
+ - .cache # Failback if XDG Cache is not set
130
+ - mcserver
131
+ - slug_index.json
132
+
133
+
122
134
  Server Root
123
135
  - .mcserver/
124
- - caches/
125
- - modrinth/
126
- - versions/
127
- - <project_id>.json
128
136
  - configs/
129
137
  - launcher.json
130
138
  - modrinth.json
131
139
  - server.json
132
140
  - modrinth/
133
- - slug_index.json
134
- - projects/
135
- - <project_id>
136
- - metadata.json
137
- - relationships.json
141
+ - projects_records/
142
+ - <project_id>.json
138
143
  - tempfiles/
139
144
  - <file_hash>
140
145
  - <url_hash> #if file hash does not exist, use hash from digesting the URL
@@ -178,7 +183,9 @@ check_dependency_conflicts: no
178
183
  resolve_dependencies: ok... what are dependencies of mod b?
179
184
  (some dialogue later)
180
185
  resolve_dependencies: ok, there's no more dependency. here you go "return the list of dependencies"
181
- user: why are there 29 mods including dependencies 0_0
186
+ user: why are there 29 mods including dependencies 0_0 (basucally the resolver works)
187
+
188
+ on second thought, the caller is the one that handle conflict.
182
189
 
183
190
  thx chatgpt but I can't prove it yet
184
191
 
@@ -194,7 +201,15 @@ thx chatgpt but I can't prove it yet
194
201
  - Review codes, especially TypedDict, because why not
195
202
  - Avoid making myself suffer in this project, potentially abandoning this cool project
196
203
  - I hate CurseForge personally.
204
+
205
+
206
+
197
207
  - And yet I still have no friend (to talk about my weird hobby of computer, including this)
208
+
209
+ - Oh hi Finjer! idk if you are reading this, cool. so uh... idk I added stuff I guess, or remove stuff.
210
+
211
+
212
+
198
213
  - Add command such as 'whitelist add/remove/list', 'ban/unban/ban-list', and probably 'op/deop <player> <level>'
199
214
 
200
215
  MCServer™ Naming Convention: (the Trademark is just a joke)
@@ -239,32 +254,135 @@ I definitely broke my promise. (oops)
239
254
  - init command could take some sort of "target dir"
240
255
  - make src/mcserver/modrinth/projects.py into a dir, ans inside it we have metadata.py and relationship.py
241
256
  - flowchart TD
242
- A[Did you fix a bug?]
243
- A -- Yes --> B[It's fix]
244
- A -- No --> C[Did you change functionality or affect UI?]
257
+ A[Did you fix a bug?]
258
+ A -- Yes --> B[It's fix]
259
+
260
+ A -- No --> C[Did you change functionality or affect UI?]
261
+ C -- Yes --> D[It's feat]
245
262
 
246
- C -- Yes --> D[It's feat]
247
- C -- No --> E[Did you add or change tests?]
263
+ C -- No --> E[Did you add or change tests?]
264
+ E -- Yes --> F[It's test]
248
265
 
249
- E -- Yes --> F[It's test]
250
- E -- No --> G[Did you change code style or formatting?]
266
+ E -- No --> G[Did you change code style or formatting?]
267
+ G -- Yes --> H[It's style]
251
268
 
252
- G -- Yes --> H[It's style]
253
- G -- No --> I[Did you make changes to documentation?]
269
+ G -- No --> I[Did you make changes to documentation?]
270
+ I -- Yes --> J[It's docs]
254
271
 
255
- I -- Yes --> J[It's docs]
256
- I -- No --> K[Did you change things related to build or deploy operations?]
272
+ I -- No --> K[Did you change things related to build or deploy operations?]
273
+ K -- Yes --> L[It's build]
257
274
 
258
- K -- Yes --> L[It's build]
259
- K -- No --> M[Did you change something related to devops, infrastructure or backups?]
275
+ K -- No --> M[Did you change something related to devops, infrastructure or backups?]
276
+ M -- Yes --> N[It's ops]
260
277
 
261
- M -- Yes --> N[It's ops]
262
- M -- No --> O[Did you complete a maintenance task or other non-code task?]
278
+ M -- No --> O[Did you complete a maintenance task or other non-code task?]
279
+ O -- Yes --> P[It's chore]
263
280
 
264
- O -- Yes --> P[It's chore]
265
- O -- No --> Q[Did you rewrite or restructure code specifically for performance?]
281
+ O -- No --> Q[Did you rewrite or restructure code specifically for performance?]
282
+ Q -- Yes --> R[It's perf]
283
+
284
+ Q -- No --> S[It's refactor]
266
285
 
267
- Q -- Yes --> R[It's perf]
268
- Q -- No --> S[It's refactor]
269
286
  - commit convention reference: https://gist.github.com/qoomon/5dfcdf8eec66a051ecd85625518cfd13
270
- - or more "official" looking: https://www.conventionalcommits.org/en/v1.0.0/
287
+ - or more "official" looking: https://www.conventionalcommits.org/en/v1.0.0/
288
+
289
+ Othecat35's Development Setup (For anyone if wondering):
290
+ - VSCodium
291
+ - Extensions:
292
+ Pyright
293
+ Python
294
+
295
+ that's all lol
296
+
297
+
298
+ so, Modrinth has new way to represent which mod go to which environment right?
299
+ so it make the older 'server_side' and 'client_side' obselete.
300
+ but, most of my code rely on them.
301
+ what if, I make a 'translator' between the new 'environment' and the old '*_side'?
302
+ "How can you do that?" said Othecat35.
303
+ well, just convert one value into two values. like if the environment is 'client_and_server',
304
+ then the server_side is required and server_side is required
305
+ required = you need this mod on this side
306
+ recommended = this mod is recommended to be installed on this side
307
+ optional = you can have this mod in this side, or not
308
+ unsupported = basically this side is a side effect (it works but uh...)
309
+ incompatible = this mod may crash on this side
310
+ unknown = the dev doesn't even know their mod, wth
311
+ the mapping table (as for 2026-09-05, basically the time I wrote this):
312
+ | environment | server side | client side |
313
+ |-------------------------------|---------------|---------------|
314
+ | client_and_server | required | required |
315
+ | client_only | unsupported | required |
316
+ | client_only_server_optional | optional | required |
317
+ | singleplayer_only | incompactible | required |
318
+ | server_only | required | unsupported |
319
+ | server_only_client_optional | required | optional |
320
+ | dedicated_server_only | required | incompactible |
321
+ | client_or_server | optional | optional |
322
+ | client_or_server_prefers_both | recommended | recommended |
323
+ | unknown | unknown | unknown |
324
+
325
+ todo: move src/mcserver/server to src/mcserver/minecraft/server
326
+ because it make more sense I think
327
+
328
+ the export command... ".mcserver" and ".mrpack" format.
329
+ .mrpack is Modrinth Modpack format, I already know that.
330
+ .mcserver? what's this? a custom format? why?
331
+ idk, maybe it can store the actual configs of the server
332
+ the mod relationships, the metadata, etc
333
+ the pros is can contain more metadata of the server.
334
+ okay. but why? idk, maybe it looks cool? yea sure.
335
+
336
+ warning for those who want to interact with .properties,
337
+ consider bring your own module and don't use my parser.
338
+ why? its not perfect, and, basically don't. I only make it
339
+ to work with Minecraft, properties files like server.properties
340
+ and eula.txt.
341
+
342
+ 4.0.0:
343
+ no add/remove for whitelist yet
344
+ no grant/revoke for op yet
345
+ no update command yet
346
+ and actually, no import command
347
+
348
+ for the remove command, I would use the resolver I already had. But it would be more complicated once we're dealing with mod that shared dependencies with other. I don't know ;-; I haven't even finished the add commad yet, but it is in incremental so don't rush me >:c
349
+ make a visualize command to visualize installed projects that output to graphviz format seems really cool
350
+ we should merge the metadata.json and relationships.json back into one file :o
351
+
352
+ look at myterious.py, idk why yiu thought it would be a good idea to make it more fun, and dynamic even.
353
+ mcserver export --client-setup seems nice
354
+ mcserver add thdilos-fox-origin -y is better
355
+ mcserver add jade --include-optional make sense, but for specifically requested mod that is client_only_server_optional, include them. otherwise, put them into "suggested" mods.
356
+
357
+ yo the get_project_informations() is broken because moderator_message can be null
358
+ as for every API interface/client, we can instead return parsed (for those who we already know the structure), and then another, extra (just a dict[str, Any]). call the new typeddict, *Data.
359
+
360
+ About lazy loading imports... what if I make it so that imports that are required regardless, just
361
+ import it on the module instead? because if you do import it, you must have a reason to do so. Like,
362
+ you don't import a module and not use it at all, right? so just move the imports outside the function.
363
+ init.py:
364
+ import argparse
365
+
366
+ def init(args: argparse.Namespace):
367
+ import logging
368
+ ...
369
+
370
+
371
+ init.py:
372
+ import argparse
373
+ import logging
374
+
375
+ def init(args: argparse.Namespace):
376
+ ...
377
+
378
+ so, if you import init, you of course want to run init() right? so lazy-laoding it is not just useless,
379
+ it also make the code a bit more unreadable.
380
+ When do we lazy-loading stuff? imports that aren't always needed. Like command invocation in cli.py
381
+ with match case, because you don't need any to print the help message (except the help command itself),
382
+ or if you did, like init, you don't neccesearily need to import the stop command right? and also other
383
+ case is in init.py and start.pt. it import the appropriate loader and not other.
384
+
385
+ hmmm yes, global .mcserver config, just like cache.
386
+ it can be the default config of all your new Minecraft server derived from
387
+ and yea
388
+
@@ -1,15 +1,14 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: mcserver-cli
3
- Version: 3.0.0
3
+ Version: 4.0.0
4
4
  Summary: A CLI tool to manage Minecraft: Java Edition servers.
5
5
  Project-URL: Homepage, https://github.com/Othecat35/MCServer
6
6
  Project-URL: Repository, https://github.com/Othecat35/MCServer.git
7
7
  Project-URL: Changelog, https://github.com/Othecat35/MCServer/blob/main/CHANGELOG.md
8
8
  Author-email: Othecat35 <othecat35@gmail.com>
9
- Maintainer-email: Othecat35 <othecat35@gmail.com>
10
9
  License-Expression: MIT
11
10
  License-File: LICENSE
12
- Requires-Python: >=3.14
11
+ Requires-Python: >=3.12
13
12
  Description-Content-Type: text/markdown
14
13
 
15
14
  # MCServer
@@ -22,10 +21,13 @@ Supported platforms:
22
21
  - and Termux.
23
22
 
24
23
  ## Requirements
25
- - Python 3.14 or newer
24
+ - Python 3.12 or newer (Python 3.14 is recommended)
26
25
  - JRE (depends on Minecraft version)
27
26
 
28
27
  ## How to install
28
+ - Using pip:
29
+ 1. Run `pip install mcserver-cli`
30
+
29
31
  - System-wide (Requires root):
30
32
  1. Download the `mcserver` script file from GitHub releases
31
33
  2. Move the file to `/usr/local/bin`
@@ -40,24 +42,31 @@ Supported platforms:
40
42
  - Run `fish_add_path ~/bin` if you're using FISH
41
43
 
42
44
  ## Usage
43
- - Add mods (and its dependencies): `mcserver add <mods>`
44
- - Import a modpack: `mcserver import [file]`
45
- - Initialize the server: `mcserver init [options]`
46
- - Manage operator status: `mcserver op`
47
- - Search mods from Modrinth: `mcserver search [<query>] [options]`
48
- - Show mod information from Modrinth: `mcserver show <mods>`
45
+ - Initialize a server: `mcserver init [options]`
46
+ - List operator players: `mcserver op list`
47
+ - Show information about projects: `mcserver show <projects>`
49
48
  - Start the server: `mcserver start`
50
- - Stop the server: `mcserver stop`
51
- - Manage the whitelist: `mcserver whitelist`
49
+ - Stop the server: `mcserver stop [--force-stop]`
50
+ - List whitelisted players: `mcserver whitelist list`
52
51
 
53
52
  ### Example
53
+ - Create and start a Fabric 1.20.1 server on current directory
54
54
  ```bash
55
- mcserver init --mc-version=1.20.1 --loader=fabric --loader-version=0.19.3
56
- mcserver search --no-filter thdilos
57
- mcserver show thdilos-fox-origin thdilos-fox-origin-expanded
58
- mcserver add thdilos-fox-origin-expanded lithium tick-stasis ferrite-core krypton
55
+ mcserver init --game-version=1.20.1 --loader=fabric
59
56
  mcserver start
60
57
  ```
61
58
 
59
+ - List all operator and whitelisted players on current directory
60
+ ```bash
61
+ mcserver op list
62
+ mcserver whitelist list
63
+ ```
64
+
65
+ - Stop (sigterm) a server on current directory
66
+ ```bash
67
+ mcserver stop
68
+ ```
69
+
62
70
  ## Note
63
71
  This is a **Personal Project**, things may be unstable.
72
+ Please do not feed my creation into AI :>
@@ -8,10 +8,13 @@ Supported platforms:
8
8
  - and Termux.
9
9
 
10
10
  ## Requirements
11
- - Python 3.14 or newer
11
+ - Python 3.12 or newer (Python 3.14 is recommended)
12
12
  - JRE (depends on Minecraft version)
13
13
 
14
14
  ## How to install
15
+ - Using pip:
16
+ 1. Run `pip install mcserver-cli`
17
+
15
18
  - System-wide (Requires root):
16
19
  1. Download the `mcserver` script file from GitHub releases
17
20
  2. Move the file to `/usr/local/bin`
@@ -26,24 +29,31 @@ Supported platforms:
26
29
  - Run `fish_add_path ~/bin` if you're using FISH
27
30
 
28
31
  ## Usage
29
- - Add mods (and its dependencies): `mcserver add <mods>`
30
- - Import a modpack: `mcserver import [file]`
31
- - Initialize the server: `mcserver init [options]`
32
- - Manage operator status: `mcserver op`
33
- - Search mods from Modrinth: `mcserver search [<query>] [options]`
34
- - Show mod information from Modrinth: `mcserver show <mods>`
32
+ - Initialize a server: `mcserver init [options]`
33
+ - List operator players: `mcserver op list`
34
+ - Show information about projects: `mcserver show <projects>`
35
35
  - Start the server: `mcserver start`
36
- - Stop the server: `mcserver stop`
37
- - Manage the whitelist: `mcserver whitelist`
36
+ - Stop the server: `mcserver stop [--force-stop]`
37
+ - List whitelisted players: `mcserver whitelist list`
38
38
 
39
39
  ### Example
40
+ - Create and start a Fabric 1.20.1 server on current directory
40
41
  ```bash
41
- mcserver init --mc-version=1.20.1 --loader=fabric --loader-version=0.19.3
42
- mcserver search --no-filter thdilos
43
- mcserver show thdilos-fox-origin thdilos-fox-origin-expanded
44
- mcserver add thdilos-fox-origin-expanded lithium tick-stasis ferrite-core krypton
42
+ mcserver init --game-version=1.20.1 --loader=fabric
45
43
  mcserver start
46
44
  ```
47
45
 
46
+ - List all operator and whitelisted players on current directory
47
+ ```bash
48
+ mcserver op list
49
+ mcserver whitelist list
50
+ ```
51
+
52
+ - Stop (sigterm) a server on current directory
53
+ ```bash
54
+ mcserver stop
55
+ ```
56
+
48
57
  ## Note
49
58
  This is a **Personal Project**, things may be unstable.
59
+ Please do not feed my creation into AI :>