Skip to content

Commit 54a48fd

Browse files
committed
Made big pypi publish
1 parent a1681f4 commit 54a48fd

12 files changed

+105
-47
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Tmaster055
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ and nearly all Versions out there!
88
- ### Installation
99
Run this command in your command prompt!
1010
```shell
11-
pip install mc-server-tool
11+
pip install mc_server_tool
1212
```
1313
To update:
1414
```shell
15-
pip install -U mc-server-tool
15+
pip install -U mc_server_tool
1616
```
1717
- ### Documentation
1818
```shell
19-
mc-server-tool --help
19+
mc_server_tool --help
2020
```
2121
```
2222
usage: execute.py [-h] [--install] [--start] [--settings] [--install_java_21] [--version VERSION]
@@ -42,35 +42,35 @@ options:
4242
- ### Examples
4343
Installs a server with version 1.20.4:
4444
```shell
45-
mc-server-tool --install --version 1.20.4
45+
mc_server_tool --install --version 1.20.4
4646
```
4747
Installs a server with version 1.20.4 on Paper:
4848
```shell
49-
mc-server-tool --install --version 1.20.4 --package Paper
49+
mc_server_tool --install --version 1.20.4 --package Paper
5050
```
5151
Installs and starts the server with 5G max ram usage:
5252
```shell
53-
mc-server-tool --install --version 1.20.4 --ram 5
53+
mc_server_tool --install --version 1.20.4 --ram 5
5454
```
5555
Installs with the port 27767:
5656
```shell
57-
mc-server-tool --install --version 1.20.4 --port 27767
57+
mc_server_tool --install --version 1.20.4 --port 27767
5858
```
5959
Starts your server again:
6060
```shell
61-
mc-server-tool --start
61+
mc_server_tool --start
6262
```
6363
Starts your Forge server if you have multiple servers in one folder:
6464
```shell
65-
mc-server-tool --start --package Forge
65+
mc_server_tool --start --package Forge
6666
```
6767
You can also specify the path on start and installation:
6868
```shell
69-
mc-server-tool --start --path /home/user/downloads
69+
mc_server_tool --start --path /home/user/downloads
7070
```
7171
You also let install java 21:
7272
```shell
73-
mc-server-tool --install_java_21
73+
mc_server_tool --install_java_21
7474
```
7575
### Package Support
7676
| Supported Packages | Status | Supported Packages | Status |

mc server tool/__init__.py

Whitespace-only changes.

mc server tool/src/__init__.py

Whitespace-only changes.

mc server tool/src/execute.py

-36
This file was deleted.

mc_server_tool/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .src.execute import main

mc_server_tool/src/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .arguments import args
2+
from .common import configure_server, clear, start_server, open_settings
3+
from .downloads import download_minecraft_jar, install_java_21
File renamed without changes.
File renamed without changes.
File renamed without changes.

mc_server_tool/src/execute.py

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import sys
2+
3+
from mc_server_tool.src import (
4+
args,
5+
configure_server,
6+
clear, start_server,
7+
open_settings,
8+
download_minecraft_jar,
9+
install_java_21
10+
)
11+
12+
13+
def main():
14+
if args.install_java_21:
15+
install_java_21()
16+
17+
if args.install:
18+
if not args.version:
19+
raise ValueError("You have to choose a version!")
20+
while True:
21+
print("Your server settings:")
22+
print("Version: ", args.version)
23+
print("Package: ", args.package)
24+
print("Path: ", args.path)
25+
print(f"RAM: {args.ram}G")
26+
print("Port: ", args.port)
27+
Answer = input("Continue? (Y|N) ").lower()
28+
if Answer == "y":
29+
break
30+
if Answer == "n":
31+
sys.exit()
32+
else:
33+
clear()
34+
35+
download_minecraft_jar(args.version, args.package, args.path)
36+
configure_server(args.version, args.package, args.path, args.port, args.ram)
37+
38+
if args.start:
39+
start_server(args.path, args.ram)
40+
41+
if args.settings:
42+
open_settings(args.path)

pyproject.toml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
[project]
5+
name = "mc-server-tool"
6+
version = "0.0.5"
7+
authors = [
8+
{ name="Tmaster055" },
9+
]
10+
description = "A minecraft server installer!"
11+
readme = "README.md"
12+
requires-python = ">=3.8"
13+
dependencies = [
14+
'requests',
15+
'bs4'
16+
]
17+
classifiers = [
18+
"Programming Language :: Python :: 3",
19+
"License :: OSI Approved :: MIT License",
20+
"Operating System :: OS Independent",
21+
]
22+
23+
[project.urls]
24+
Homepage = "https://github.com/Tmaster055/Minecraft-Server-Installer"
25+
Issues = "https://github.com/Tmaster055/Minecraft-Server-Installer/issues"
26+
[project.scripts]
27+
mc-server-tool = "mc_server_tool.src.execute:main"

0 commit comments

Comments
 (0)