* Delete planet directory

* Delete scripts/package directory

* Delete .gitignore

* Delete requirements.txt

* Delete screenshot.png

* changed to website description

* Create index.html

* Create .gitignore

* Add files via upload

* Add files via upload

* Delete .gitignore

* Update index.html

Co-authored-by: Grimet <97934952+Grimet14@users.noreply.github.com>
This commit is contained in:
Alexey "LEHAtupointow" Pavlov 2022-04-21 21:08:12 -04:00 committed by GitHub
parent 9a7be48a19
commit c1b3316537
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 39 additions and 2973 deletions

6
.gitignore vendored
View file

@ -1,6 +0,0 @@
**/__pycache__
__pycache__
*.pyc
**/build
*.deb
build

156
README.md
View file

@ -4,158 +4,6 @@
<img src="https://github.com/mcpiscript/planet/raw/master/planet/assets/img/full/logo512.png" alt="Logo" width="80" height="80">
</a>
<h3 align="center">Planet Launcher</h3>
<h3 align="center">Planet Launcher Website</h3>
<p align="center">
An interactive launcher for MCPi-Reborn
<br/>
<br/>
<a href="https://github.com/mcpiscript/Planet#installation"><strong>Try Planet now »</strong></a>
<br/>
<br/>
<a href="https://github.com/mcpiscript/Planet/issues">Report Bug</a>
|
<a href="https://github.com/mcpiscript/Planet/issues">Request Feature</a>
</p>
</p>
![Downloads](https://img.shields.io/github/downloads/mcpiscript/Planet/total) ![Contributors](https://img.shields.io/github/contributors/mcpiscript/Planet?color=dark-green) ![Issues](https://img.shields.io/github/issues/mcpiscript/Planet) ![License](https://img.shields.io/github/license/mcpiscript/Planet) [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fmcpiscript%2FPlanet&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com) ![Discord](https://img.shields.io/discord/936428193521487953?color=blue&label=Discord%20server&logo=Discord&logoColor=blue) ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/mcpiscript/planet?label=Commits) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/mcpiscript/planet/latest/master) ![GitHub last commit](https://img.shields.io/github/last-commit/mcpiscript/planet) ![GitHub Release Date](https://img.shields.io/github/release-date/mcpiscript/planet?label=Latest%20release%20date) ![GitHub repo size](https://img.shields.io/github/repo-size/mcpiscript/planet) [![Crowdin](https://badges.crowdin.net/planet-launcher/localized.svg)](https://crowdin.com/project/planet-launcher)![Lines of code](https://img.shields.io/tokei/lines/github/mcpiscript/planet)
## Table Of Contents
* [About the Project](#about-the-project)
* [Built With](#built-with)
* [Getting Started](#installation)
* [Roadmap](#roadmap)
* [Contributing](#contributing)
* [License](#license)
* [Acknowledgements](#acknowledgements)
## About The Project
![Screen Shot](https://github.com/mcpiscript/Planet/raw/master/screenshot.png)
The Minecraft Pi: Reborn mod is a great addition to the game. However, as fun as it can be, there is a big problem. The built-in launcher is too annoying. You have to type in every single field to just remember that you forgot to turn on a teeny little flag. **Planet fixes that.**
Instead of making you type in every single field, Planet lets you write it one time, auto-save, and forget for the rest of your life. With Planet you can even edit the world names and it supports the newly-introduced Reborn AppImages. It is also maintained unlike the other launchers.
## Built With
* The GUI is made using the PyQt5 Qt binding for Python, and additional widgets from qtwidgets.
* Big thanks to `pypresence` developers, for making such a good interface to Discord RPC.
* Thanks to `pyqtdarktheme` and `darkdetect` for awesome Qt theming tools.
* Pillow was used for skin manipulation
* PyNBT is used for the built-in MCPIedit
* `click` is an awesome interface, unfortunately, not to handle autoclickers, but for CLI interfaces used in the texture pack tool.
## Installation
#### Prerequisites
* [Minecraft Pi: Reborn](https://jenkins.thebrokenrail.com) AppImage or DEB install
* PyQt5
* Python 3
* `pypresence`
* `qtdarktheme`
* Pillow
* `qtwidgets`
* `darkdetect`
* PyNBT
* `click`
If you're installing a DEB, all of them with the exception of Minecraft: Pi Edition: Reborn will be automatically installed. Please install an AppImage for the latest build. If you want a DEB, please consider checking out [MCPI++](https://github.com/mobilegmyt/mcpi-reborn-extended).
#### Installation
###### Option A (Raspberry Pi Only)
[![badge](https://github.com/Botspot/pi-apps/blob/master/icons/badge.png?raw=true)](https://github.com/Botspot/pi-apps)
###### Option B (Raspberry Pi Only)
[<img src="https://cdn.discordapp.com/attachments/717494538205397052/957080742293295134/addonsmini.png" alt="Logo" width="160" height="80">](https://raspbian-addons.org)
Install the `planet-launcher` package through APT.
###### Option C (Any Debian-Based)
Use [our PPA](https://github.com/mcpiscript/ppa)
###### Option D (Manual Installation)
1. Download the DEB from the releases section.
2. Install the DEB using `apt`
3. Follow the on-screen instructions
## Alternatives
### gMCPIL vs jMCPIL vs pipan vs Planet
| Feature | Planet | [gMCPIL](https://github.com/mcpi-revival/gmcpil) | [jMCPIL](https://github.com/mcpi-revival/jmcpil) | [pipan](https://github.com/randomsoup/pipan) | Built-in launcher |
|---------|--------|--------|--------|-------|------|
| Profile & feature saving | Yes | Bullseye only | Yes | No | No |
| AppImage support | Yes | No | No | No | Yes |
| Legacy DEB support | Yes | Yes | Yes | Yes | Yes |
| Official MCPi-Revival | No | Yes | Yes | No | Yes |
| Tab icons | Yes | No | No | No | No |
| Maintained | Yes | No | No | No | Yes |
| Supported on Debian Buster | Yes, some bugs exist | No | Yes | Yes | Yes |
| Discord RPC | Yes | No | No | No | No |
| External server support | Yes | Yes | Yes | No | No |
| Flatpak support | Not tested | No | No | No | Yes |
| Pre-made profiles | Yes | Yes | Yes | Yes | No |
| Easy GUI navigation | Yes | Yes | Yes | No | Yes |
| Skin support | Yes | No | No | No | No |
| Built-in NBT editor | Yes | No | No | No | No |
###### Conclusion
- Use Planet if you want a maintained and a feature-rich launcher.
- Use gMCPIL if you are on Debian Bullseye, using a DEB install OR want a basic experience
- Use jMCPIL if you're using a DEB install on a distro other than Debian Bullseye
- Use the built-in launcher if you like to fill in things constantly
- Don't use pipan, it's a dirty prototype, not a working launcher
## Roadmap
- [x] AppImage support
- [x] Skin support
- [x] NBT editor
- [x] Localization system [![Crowdin](https://badges.crowdin.net/planet-launcher/localized.svg)](https://crowdin.com/project/planet-launcher)
- [ ] Texture packs (In progress)
- [ ] Mods
- [ ] Chat logging
- [ ] MarketPi
- [ ] World generation from seed
## Contributing
### Creating A Pull Request
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
### Adding a translation
[![Crowdin](https://badges.crowdin.net/planet-launcher/localized.svg)](https://crowdin.com/project/planet-launcher)
1. Register an account on [Crowdin](https://crowdin.com)
2. Go to our [project page](https://crowdin.com/project/planet-launcher)
3. Start translating. If the desired langauge is not available, start a new thread.
4. Patiently wait until your translation is reviewed and added.
Please don't add fake translations, invalid or rude translations.
## License
Planet is licensed under the [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html)
![Logo](https://www.gnu.org/graphics/agplv3-with-text-162x68.png)
## Acknowledgements
- [Leha-code](https://github.com/leha-code) - Creator and maintainer
- [Red-exe-engineer](https://github.com/red-exe-engineer) - Active contributor
- [Bigjango13](https://github.com/bigjango13) - Multiple fixes
### Translations
- Spanish translation by [BasedSkeleton](https://github.com/basedskeleton)
- Russian translation by [Leha-code](https://github.com/leha-code)
### Additional Credits
- Heart, Planet, Pi, Steve and Portal icons by LEHAtupointow.
- Wrench by [Santoniche on OpenGameArt.org](https://opengameart.org/content/wrench-0).
<p align="center">The website for the planet launcher project. (Under development)</p>

BIN
img/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View file

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

22
index.html Normal file
View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Hebrew:wght@600&display=swap" rel="stylesheet">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/png" href="./img/favicon.ico"/>
<link rel="stylesheet" href="styles.css">
<title>Planet Launcher</title>
</head>
<body>
<div class="mainimage">
<img src="./img/planet-logo.png" height="200" width=auto alt="Planet Launcher Logo">
</div>
<div class="mainheader">
<h1>Coming Soon!</h1>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

View file

@ -1,48 +0,0 @@
@import url('https://fonts.googleapis.com/css?family=Droid+Sans+Mono');
body .gist .gist-file {
margin-bottom: 0;
border: 1px dashed #adb5bd;
border-radius: 0;
}
body .gist .gist-data {
border-bottom: none;
border-radius: 0;
background-color: #f1f3f5;
}
body .gist .blob-wrapper {
border-radius: 0;
}
body .gist .highlight {
background-color: transparent;
font-family: 'Droid Sans Mono', monospace;
font-size: 14px;
}
body .gist .highlight td {
padding: 5px 15px !important;
line-height: 1;
font-family: inherit;
font-size: inherit;
}
body .gist tr:first-child td {
padding-top: 15px !important;
}
body .gist tr:last-child td {
padding-bottom: 15px !important;
}
body .gist .blob-num {
color: #ced4da;
background-color: #495057;
pointer-events: none;
}
body .gist .gist-meta {
display: none;

View file

@ -1,3 +0,0 @@
<link rel="stylesheet" type="text/css" href="changelog.css" media="screen" />
<center><script src="https://gist.github.com/leha-code/3e8fea40346536b451e45fc1728ed250.js?file=Planet_changelog.md"></script><script src="https://gist.github.com/leha-code/3e8fea40346536b451e45fc1728ed250.js?file=Reborn_changelog.md"></script></center>

View file

@ -1,9 +0,0 @@
[Desktop Entry]
Name=Planet Launcher
Exec=/usr/bin/planet-launcher
Icon=/usr/lib/planet-launcher/assets/img/full/logo512.png
Type=Application
Comment=A better launcher
GenericName=Minecraft Pi Launcher
Categories=games, minecraft
Keywords=Minecraft, MCPIL, gMCPIL, jMCPIL, Minecraft Pi, Minecraft launcher, MCPI, MCPI-Revival, mcpiscript

View file

@ -1,163 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2022-04-15 19:08-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
#: main.py:134
msgid ""
"Please select the executable you downloaded.\n"
"If you installed a DEB, please select the \"Link\" option"
msgstr ""
#: main.py:138 main.py:182
msgid "Select executable"
msgstr ""
#: main.py:143
msgid "Link /usr/bin/minecraft-pi-reborn-client"
msgstr ""
#: main.py:148
msgid "Link flatpak"
msgstr ""
#: main.py:227
msgid "Launched with Planet Launcher"
msgstr ""
#: main.py:228
msgid "Minecraft Pi Edition: Reborn"
msgstr ""
#: main.py:238
msgid "Unable to initalize Discord RPC. Skipping."
msgstr ""
#: main.py:269
msgid "Planet"
msgstr ""
#: main.py:283
msgid "Play"
msgstr ""
#: main.py:288
msgid "Features"
msgstr ""
#: main.py:293
msgid "Servers"
msgstr ""
#: main.py:299
msgid "Settings"
msgstr ""
#: main.py:359
msgid "Banana Launcher"
msgstr ""
#: main.py:363
msgid "Pluto Launcher"
msgstr ""
#: main.py:365
msgid "Planet Launcher"
msgstr ""
#: main.py:378
msgid "Username"
msgstr ""
#: main.py:381
msgid "StevePi"
msgstr ""
#: main.py:384
msgid "Render Distance"
msgstr ""
#: main.py:391
msgid "Profile"
msgstr ""
#: main.py:406
msgid "Hide Launcher"
msgstr ""
#: main.py:535
msgid "Servers are stored in the format of <font color=\"gold\">IP: </font><font color=\"blue\">Port</font>"
msgstr ""
#: main.py:588
msgid "Set the skin"
msgstr ""
#: main.py:590
msgid "Select Skin"
msgstr ""
#: main.py:593
msgid "Reset config"
msgstr ""
#: main.py:595
msgid "Delete config"
msgstr ""
#: main.py:598
msgid "Delete executable"
msgstr ""
#: main.py:600
msgid "Delete"
msgstr ""
#: main.py:603
msgid "Import settings"
msgstr ""
#: main.py:623
msgid "General"
msgstr ""
#: main.py:624
msgid "Changelog"
msgstr ""
#: main.py:625
msgid "MCPIEdit"
msgstr ""
#: main.py:705
msgid "Select skin file"
msgstr ""
#: main.py:719 main.py:736
msgid "Are you sure you want to reset?"
msgstr ""
#: main.py:721
msgid "Are you sure you want to delete the config? This action is unrecoverable."
msgstr ""
#: main.py:738
msgid "Are you sure you want to delete the AppImage? This action is unrecoverable."
msgstr ""
#: main.py:812
msgid "Using /usr/bin as an executable."
msgstr ""

View file

@ -1,124 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2022-04-15 19:08-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
#: mcpiedit.py:74
msgid ""
"The default built-in NBT editor for Planet.\n"
"\n"
"MCPIedit makes use of Pi-NBT\n"
" from the original MCPIedit project\n"
"by TheBrokenRail, which is\n"
"licensed under the MIT license."
msgstr ""
#: mcpiedit.py:91
msgid ""
"NBT editors allow you to edit your world\n"
"files to change game modes, time,\n"
"and even the world name. Select an NBT\n"
"file to edit using the button below."
msgstr ""
#: mcpiedit.py:95
msgid "Select NBT File"
msgstr ""
#: mcpiedit.py:97
msgid "About"
msgstr ""
#: mcpiedit.py:125
msgid "General"
msgstr ""
#: mcpiedit.py:126
msgid "World"
msgstr ""
#: mcpiedit.py:155
msgid "World name"
msgstr ""
#: mcpiedit.py:158
msgid "OneChunk"
msgstr ""
#: mcpiedit.py:166
msgid "Last Played Timestamp"
msgstr ""
#: mcpiedit.py:171
msgid "Game mode"
msgstr ""
#: mcpiedit.py:181
msgid "Time (In Ticks)"
msgstr ""
#: mcpiedit.py:187
msgid "Back"
msgstr ""
#: mcpiedit.py:189
msgid "Save"
msgstr ""
#: mcpiedit.py:218
msgid "Spawnpoint X"
msgstr ""
#: mcpiedit.py:224
msgid "Spawnpoint Y"
msgstr ""
#: mcpiedit.py:230
msgid "Spawnpoint Z"
msgstr ""
#: mcpiedit.py:236
msgid "Player Spawnpoint X"
msgstr ""
#: mcpiedit.py:242
msgid "Player Spawnpoint Y"
msgstr ""
#: mcpiedit.py:248
msgid "Player Spawnpoint Z"
msgstr ""
#: mcpiedit.py:263
msgid ""
"Note:\n"
"Player spawnpoints are very buggy!\n"
"You might spawn in the wrong\n"
"place or even outside the world!\n"
"Do not use on valuable worlds."
msgstr ""
#: mcpiedit.py:328
msgid "Open NBT File"
msgstr ""
#: mcpiedit.py:330
msgid "Minecraft Pi Level NBT (level.dat)"
msgstr ""
#: mcpiedit.py:349
msgid "MCPIEdit"
msgstr ""

View file

@ -1,165 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: planet-launcher\n"
"POT-Creation-Date: 2022-04-15 16:48-0400\n"
"PO-Revision-Date: 2022-04-16 21:54\n"
"Last-Translator: \n"
"Language-Team: Spanish\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Crowdin-Project: planet-launcher\n"
"X-Crowdin-Project-ID: 510486\n"
"X-Crowdin-Language: es-ES\n"
"X-Crowdin-File: main.po\n"
"X-Crowdin-File-ID: 2\n"
"Language: es_ES\n"
#: main.py:134
msgid "Please select the executable you downloaded.\n"
"If you installed a DEB, please select the \"Link\" option"
msgstr "Por favor, seleccione el ejecutable que descargó.\n"
"Si instaló un DEB, seleccione la opción \"Enlace\""
#: main.py:138 main.py:182
msgid "Select executable"
msgstr "Seleccionar ejecutable"
#: main.py:143
msgid "Link /usr/bin/minecraft-pi-reborn-client"
msgstr "Enlace /usr/bin/minecraft-pi-reborn-client"
#: main.py:148
msgid "Link flatpak"
msgstr "Enlace flatpak"
#: main.py:227
msgid "Launched with Planet Launcher"
msgstr "Lanzado con Planet Launcher"
#: main.py:228
msgid "Minecraft Pi Edition: Reborn"
msgstr "Minecraft: Pi Edición: Renacer"
#: main.py:238
msgid "Unable to initalize Discord RPC. Skipping."
msgstr "No se puede iniciar Discord RPC. Omitir."
#: main.py:269
msgid "Planet"
msgstr "Planet"
#: main.py:283
msgid "Play"
msgstr "Jugar"
#: main.py:288
msgid "Features"
msgstr "Funcionalidades"
#: main.py:293
msgid "Servers"
msgstr "Servidores"
#: main.py:299
msgid "Settings"
msgstr "Ajustes"
#: main.py:359
msgid "Banana Launcher"
msgstr "Lanzador de Banana"
#: main.py:363
msgid "Pluto Launcher"
msgstr "Lanzador de Pluto"
#: main.py:365
msgid "Planet Launcher"
msgstr "Lanzador de Planet"
#: main.py:378
msgid "Username"
msgstr "Nombre"
#: main.py:381
msgid "StevePi"
msgstr "StevePi"
#: main.py:384
msgid "Render Distance"
msgstr "Distancia de renderizado"
#: main.py:391
msgid "Profile"
msgstr "Perfil"
#: main.py:406
msgid "Hide Launcher"
msgstr "Ocultar lanzador"
#: main.py:535
msgid "Servers are stored in the format of <font color=\"gold\">IP: </font><font color=\"blue\">Port</font>"
msgstr "Los servidores se almacenan en el formato de <font color=\"gold\">IP: </font><font color=\"blue\">Puerto</font>"
#: main.py:588
msgid "Set the skin"
msgstr "Establecer el aspecto"
#: main.py:590
msgid "Select Skin"
msgstr "Seleccionar aspecto"
#: main.py:593
msgid "Reset config"
msgstr "Restablecer configuración"
#: main.py:595
msgid "Delete config"
msgstr "Eliminar configuración"
#: main.py:598
msgid "Delete executable"
msgstr "Borrar ejecutable"
#: main.py:600
msgid "Delete"
msgstr "Borrar"
#: main.py:603
msgid "Import settings"
msgstr "Importar ajustes"
#: main.py:623
msgid "General"
msgstr "General"
#: main.py:624
msgid "Changelog"
msgstr "Lista de cambios"
#: main.py:625
msgid "MCPIEdit"
msgstr "MCPIEdit"
#: main.py:705
msgid "Select skin file"
msgstr "Seleccionar archivo de aspecto"
#: main.py:719 main.py:736
msgid "Are you sure you want to reset?"
msgstr "¿Estás seguro de que quieres resetear?"
#: main.py:721
msgid "Are you sure you want to delete the config? This action is unrecoverable."
msgstr "¿Está seguro de que desea eliminar la configuración? Esta acción es irrecuperable."
#: main.py:738
msgid "Are you sure you want to delete the AppImage? This action is unrecoverable."
msgstr "¿Está seguro de que desea eliminar el AppImage? Esta acción es irrecuperable."
#: main.py:812
msgid "Using /usr/bin as an executable."
msgstr "Usando /usr/bin como un ejecutable."

View file

@ -1,133 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: planet-launcher\n"
"POT-Creation-Date: 2022-04-15 18:43-0400\n"
"PO-Revision-Date: 2022-04-16 21:54\n"
"Last-Translator: \n"
"Language-Team: Spanish\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Crowdin-Project: planet-launcher\n"
"X-Crowdin-Project-ID: 510486\n"
"X-Crowdin-Language: es-ES\n"
"X-Crowdin-File: mcpiedit.po\n"
"X-Crowdin-File-ID: 4\n"
"Language: es_ES\n"
#: mcpiedit.py:69
msgid "The default built-in NBT editor for Planet.\n\n"
"MCPIedit makes use of Pi-NBT\n"
" from the original MCPIedit project\n"
"by TheBrokenRail, which is\n"
"licensed under the MIT license."
msgstr "El editor NBT incorporado por defecto para Planet.\n\n"
"MCPIedit hace uso de Pi-NBT\n"
" del proyecto MCPIedit original\n"
"de TheBrokenRail, que está\n"
"licenciado bajo la licencia MIT."
#: mcpiedit.py:86
msgid "NBT editors allow you to edit your world\n"
"files to change game modes, time,\n"
"and even the world name. Select an NBT\n"
"file to edit using the button below."
msgstr "Los editores NBT te permiten editar los archivos del mundo\n"
"para cambiar los modos de juego, el tiempo,\n"
"e incluso el nombre del mundo. Seleccione un archivo NBT\n"
"para editar usando el botón de abajo."
#: mcpiedit.py:90
msgid "Select NBT File"
msgstr "Seleccionar archivo NBT"
#: mcpiedit.py:92
msgid "About"
msgstr "Sobre"
#: mcpiedit.py:120
msgid "General"
msgstr "General"
#: mcpiedit.py:121
msgid "World"
msgstr "Mundo"
#: mcpiedit.py:150
msgid "World name"
msgstr "Nombre del mundo"
#: mcpiedit.py:153
msgid "OneChunk"
msgstr "UnoFragmento"
#: mcpiedit.py:161
msgid "Last Played Timestamp"
msgstr "Última jugada"
#: mcpiedit.py:166
msgid "Game mode"
msgstr "Modo de juego"
#: mcpiedit.py:176
msgid "Time (In Ticks)"
msgstr "Tiempo (en Tics)"
#: mcpiedit.py:182
msgid "Back"
msgstr "Atrás"
#: mcpiedit.py:184
msgid "Save"
msgstr "Guardar"
#: mcpiedit.py:213
msgid "Spawnpoint X"
msgstr "Ubicación de Regenerar X"
#: mcpiedit.py:219
msgid "Spawnpoint Y"
msgstr "Ubicación de Regenerar Y"
#: mcpiedit.py:225
msgid "Spawnpoint Z"
msgstr "Ubicación de Regenerar Z"
#: mcpiedit.py:231
msgid "Player Spawnpoint X"
msgstr "Ubicación de Regenerar X del jugador"
#: mcpiedit.py:237
msgid "Player Spawnpoint Y"
msgstr "Ubicación de Regenerar Y del jugador"
#: mcpiedit.py:243
msgid "Player Spawnpoint Z"
msgstr "Ubicación de Regenerar Z del jugador"
#: mcpiedit.py:258
msgid "Note:\n"
"Player spawnpoints are very buggy!\n"
"You might spawn in the wrong\n"
"place or even outside the world!\n"
"Do not use on valuable worlds."
msgstr "Nota:\n"
"¡Los puntos de aparición de jugadores son muy erróneos!\n"
"¡Puedes aparecer en el lugar\n"
"incorrecto o incluso fuera del mundo!\n"
"No utilices en mundos valiosos."
#: mcpiedit.py:323
msgid "Open NBT File"
msgstr "Abrir archivo NBT"
#: mcpiedit.py:325
msgid "Minecraft Pi Level NBT (level.dat)"
msgstr "Nivel NBT de Minecraft Pi (level.dat)"
#: mcpiedit.py:344
msgid "MCPIEdit"
msgstr "MCPIEdit"

View file

@ -1,165 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: planet-launcher\n"
"POT-Creation-Date: 2022-04-15 16:48-0400\n"
"PO-Revision-Date: 2022-04-16 00:26\n"
"Last-Translator: \n"
"Language-Team: Russian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"Plural-Forms: nplurals=4; plural=((n%10==1 && n%100!=11) ? 0 : ((n%10 >= 2 && n%10 <=4 && (n%100 < 12 || n%100 > 14)) ? 1 : ((n%10 == 0 || (n%10 >= 5 && n%10 <=9)) || (n%100 >= 11 && n%100 <= 14)) ? 2 : 3));\n"
"X-Crowdin-Project: planet-launcher\n"
"X-Crowdin-Project-ID: 510486\n"
"X-Crowdin-Language: ru\n"
"X-Crowdin-File: main.po\n"
"X-Crowdin-File-ID: 2\n"
"Language: ru_RU\n"
#: main.py:134
msgid "Please select the executable you downloaded.\n"
"If you installed a DEB, please select the \"Link\" option"
msgstr "Пожалуйста выберите запускной файл который Вы скачали.\n"
"Если Вы установили DEB-архив, пожалуйста выберите \"Создать ссылку\""
#: main.py:138 main.py:182
msgid "Select executable"
msgstr "Выберите запускной файл"
#: main.py:143
msgid "Link /usr/bin/minecraft-pi-reborn-client"
msgstr "Создать ссылку на /usr/bin/minecraft-pi-reborn-client"
#: main.py:148
msgid "Link flatpak"
msgstr "Создаиь ссылку на FlatPak"
#: main.py:227
msgid "Launched with Planet Launcher"
msgstr "Запущено с помощью Planet Launcher"
#: main.py:228
msgid "Minecraft Pi Edition: Reborn"
msgstr "Майнкрафт Pi Edition: Перерожденная версия"
#: main.py:238
msgid "Unable to initalize Discord RPC. Skipping."
msgstr "Не удалось запустить Discord RPC. Пропускаем."
#: main.py:269
msgid "Planet"
msgstr "Planet (Планет Лаунчер)"
#: main.py:283
msgid "Play"
msgstr "Играть"
#: main.py:288
msgid "Features"
msgstr "Опции"
#: main.py:293
msgid "Servers"
msgstr "Сетевая игра"
#: main.py:299
msgid "Settings"
msgstr "Настройки"
#: main.py:359
msgid "Banana Launcher"
msgstr "Банановый Лаунчер"
#: main.py:363
msgid "Pluto Launcher"
msgstr "Лаунчер Плутона"
#: main.py:365
msgid "Planet Launcher"
msgstr "Planet Лаунчер"
#: main.py:378
msgid "Username"
msgstr "Имя пользователя"
#: main.py:381
msgid "StevePi"
msgstr "СтивПи"
#: main.py:384
msgid "Render Distance"
msgstr "Расстояние отображения"
#: main.py:391
msgid "Profile"
msgstr "Профиль запуска"
#: main.py:406
msgid "Hide Launcher"
msgstr "Скрыть после запуска"
#: main.py:535
msgid "Servers are stored in the format of <font color=\"gold\">IP: </font><font color=\"blue\">Port</font>"
msgstr "Серверы хранятся в формате <font color=\"gold\">IP: </font><font color=\"blue\">Порт</font>"
#: main.py:588
msgid "Set the skin"
msgstr "Выбрать скин"
#: main.py:590
msgid "Select Skin"
msgstr "Выбрать скин"
#: main.py:593
msgid "Reset config"
msgstr "Сбросить конфигурацию"
#: main.py:595
msgid "Delete config"
msgstr "Удалить конфигурвцию"
#: main.py:598
msgid "Delete executable"
msgstr "Удалить запускной файл"
#: main.py:600
msgid "Delete"
msgstr "Удалить"
#: main.py:603
msgid "Import settings"
msgstr "Импортировать настройки"
#: main.py:623
msgid "General"
msgstr "Общее"
#: main.py:624
msgid "Changelog"
msgstr "Журнал изменений"
#: main.py:625
msgid "MCPIEdit"
msgstr "Редактор MCPIEdit"
#: main.py:705
msgid "Select skin file"
msgstr "Выберите скин"
#: main.py:719 main.py:736
msgid "Are you sure you want to reset?"
msgstr "Вы действительно хотите сбросить данные?"
#: main.py:721
msgid "Are you sure you want to delete the config? This action is unrecoverable."
msgstr "Вы действительно хотите удалить файл конфигурации? Это действие необратимо."
#: main.py:738
msgid "Are you sure you want to delete the AppImage? This action is unrecoverable."
msgstr "Вы действительно хотите удалить файл AppImage? Это действие необратимо."
#: main.py:812
msgid "Using /usr/bin as an executable."
msgstr "Использование /usr/bin в качестве запускного файла."

View file

@ -1,133 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: planet-launcher\n"
"POT-Creation-Date: 2022-04-15 18:43-0400\n"
"PO-Revision-Date: 2022-04-16 00:26\n"
"Last-Translator: \n"
"Language-Team: Russian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"Plural-Forms: nplurals=4; plural=((n%10==1 && n%100!=11) ? 0 : ((n%10 >= 2 && n%10 <=4 && (n%100 < 12 || n%100 > 14)) ? 1 : ((n%10 == 0 || (n%10 >= 5 && n%10 <=9)) || (n%100 >= 11 && n%100 <= 14)) ? 2 : 3));\n"
"X-Crowdin-Project: planet-launcher\n"
"X-Crowdin-Project-ID: 510486\n"
"X-Crowdin-Language: ru\n"
"X-Crowdin-File: mcpiedit.po\n"
"X-Crowdin-File-ID: 4\n"
"Language: ru_RU\n"
#: mcpiedit.py:69
msgid "The default built-in NBT editor for Planet.\n\n"
"MCPIedit makes use of Pi-NBT\n"
" from the original MCPIedit project\n"
"by TheBrokenRail, which is\n"
"licensed under the MIT license."
msgstr "Встроенный редактор NBT для Planet.\n\n"
"MCPIedit использует Pi-NBT\n"
"из оригинального проекта MCPIedit, который создан\n"
"TheBrokenRail, \n"
"лицензирован под лицензией MIT."
#: mcpiedit.py:86
msgid "NBT editors allow you to edit your world\n"
"files to change game modes, time,\n"
"and even the world name. Select an NBT\n"
"file to edit using the button below."
msgstr "Редакторы NBT позволяют редактировать\n"
"файлы, чтобы изменить игровые режимы, время,\n"
"и даже название мира. Выберите файл NBT\n"
"для редактирования с помощью кнопки ниже."
#: mcpiedit.py:90
msgid "Select NBT File"
msgstr "Выберите NBT файл"
#: mcpiedit.py:92
msgid "About"
msgstr "О программе"
#: mcpiedit.py:120
msgid "General"
msgstr "Общее"
#: mcpiedit.py:121
msgid "World"
msgstr "Мир"
#: mcpiedit.py:150
msgid "World name"
msgstr "Название мира"
#: mcpiedit.py:153
msgid "OneChunk"
msgstr "Еднственный Чанк"
#: mcpiedit.py:161
msgid "Last Played Timestamp"
msgstr "Отметка времени последнего открытия мира"
#: mcpiedit.py:166
msgid "Game mode"
msgstr "Игровой режим"
#: mcpiedit.py:176
msgid "Time (In Ticks)"
msgstr "Время (в тиках)"
#: mcpiedit.py:182
msgid "Back"
msgstr "Обратно"
#: mcpiedit.py:184
msgid "Save"
msgstr "Сохранить"
#: mcpiedit.py:213
msgid "Spawnpoint X"
msgstr "Координаты Х"
#: mcpiedit.py:219
msgid "Spawnpoint Y"
msgstr "Координаты Y"
#: mcpiedit.py:225
msgid "Spawnpoint Z"
msgstr "Координаты Z"
#: mcpiedit.py:231
msgid "Player Spawnpoint X"
msgstr "Точка возрождения игрока X"
#: mcpiedit.py:237
msgid "Player Spawnpoint Y"
msgstr "Точка возрождения игрока Y"
#: mcpiedit.py:243
msgid "Player Spawnpoint Z"
msgstr "Точка возрождения игрока Z"
#: mcpiedit.py:258
msgid "Note:\n"
"Player spawnpoints are very buggy!\n"
"You might spawn in the wrong\n"
"place or even outside the world!\n"
"Do not use on valuable worlds."
msgstr "Примечание:\n"
"Точки появления игрока очень неточны!\n"
"Вы можете возродиться в неправильном\n"
"месте или даже за пределами мира!\n"
"Не пробуйте это на ценных мирах."
#: mcpiedit.py:323
msgid "Open NBT File"
msgstr "Открыть файл NBT"
#: mcpiedit.py:325
msgid "Minecraft Pi Level NBT (level.dat)"
msgstr "Файлы NBT уровня Minecraft Pi (level.dat)"
#: mcpiedit.py:344
msgid "MCPIEdit"
msgstr "Редактор MCPIEdit"

View file

@ -1,83 +0,0 @@
"""
Copyright (C) 2022 Alexey Pavlov
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
import subprocess
import os
def get_features_list(path_: str) -> list:
features = subprocess.run(
[path_, "--print-available-feature-flags"], stdout=subprocess.PIPE
).stdout.decode("utf-8")
features = features.split("\n")
returnlist = list()
for feature in features:
if feature.startswith("TRUE"):
feature = feature[5:]
if feature.startswith("FALSE"):
feature = feature[6:]
returnlist.append(feature)
return returnlist
def get_features_dict(path_: str) -> dict:
features = subprocess.run(
[path_, "--print-available-feature-flags"], stdout=subprocess.PIPE
).stdout.decode("utf-8")
features = features.split("\n")
returndict = dict()
for feature in features:
if feature.startswith("TRUE"):
feature = feature[5:]
returndict[feature] = True
if feature.startswith("FALSE"):
feature = feature[6:]
returndict[feature] = False
return returndict
def set_username(env, username: str = "StevePi"):
env["MCPI_USERNAME"] = username
return env
def set_render_distance(env, distance: str = "SHORT"):
if distance.upper() not in ["TINY", "SHORT", "NORMAL", "FAR"]:
raise Exception("Invalid render distance")
else:
env["MCPI_RENDER_DISTANCE"] = distance
return env
def set_hud(env, options: str = "fps,simple"):
env["GALLIUM_HUD"] = options
return env
def set_options(env, options: dict):
output = str()
for option in options:
if options[option]:
output += f"{option}|"
env["MCPI_FEATURE_FLAGS"] = output
return env
def run(env, path_: str):
return subprocess.Popen([path_], env=env, preexec_fn=os.setsid)

View file

@ -1,843 +0,0 @@
#!/usr/bin/python3
"""
Planet is an improved launcher for Minecraft Pi Edition: Reborn, inspired by gMCPIL, jMCPIL, MCPIL and MCPIL-R.
Copyright (C) 2022 Alexey Pavlov
Copyright (C) 2022 Red-Exe-Engineer
Copyright (C) 2022 Bigjango13
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
# Built-in modules import
import sys
import os
import random
from datetime import date
import json
import pathlib
import gettext
LOCALE = os.getenv("LANG", "en")
# Define the path used for later
absolute_path = pathlib.Path(__file__).parent.absolute()
# ran only if it's in a deb file
if str(absolute_path).startswith("/usr/bin"):
absolute_path = "/usr/lib/planet-launcher/"
# Make the launcher import local files
sys.path.append(absolute_path)
if os.path.exists("/usr/lib/planet-launcher/"):
sys.path.append("/usr/lib/planet-launcher/")
_ = gettext.translation(
"main", localedir=str(absolute_path) + "/assets/translations/", languages=[LOCALE]
).gettext
# Local imports
import launcher
from splashes import SPLASHES
import web
import mcpiedit
# PyQt5 imports
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtWebKit import *
from PyQt5.QtWebKitWidgets import *
from qtwidgets import AnimatedToggle
# Additional imports
import qdarktheme # Dark style for PyQt5
import pypresence # Discord RPC
from PIL import Image
import darkdetect
# Load dark theme
dark_stylesheet = qdarktheme.load_stylesheet()
USER = os.getenv("USER") # Get the username, used for later
# Create the mods directory if it does not exist
if not os.path.exists(f"/home/{USER}/.planet-launcher/mods"):
os.makedirs(f"/home/{USER}/.planet-launcher/mods")
if not os.path.exists(f"/home/{USER}/.minecraft-pi/overrides/images/mob/"):
os.makedirs(f"/home/{USER}/.minecraft-pi/overrides/images/mob/")
# if os.path.exists(f"/home/{USER}/.gmcpil.json"):
# with open(f"/home/{USER}/.gmcpil.json") as f:
# DEFAULT_FEATURES = json.loads(f.read())["features"]
# else:
# TODO: Add a tab with a button to import features from gMCPIL
if darkdetect.isDark():
theme = "dark"
else:
theme = "light"
class ConfigPluto(QDialog):
"""Startup configurator for Planet. Based on QDialog."""
def __init__(self):
super().__init__()
# Remove the window bar
self.setWindowFlag(Qt.FramelessWindowHint)
layout = QVBoxLayout() # Real layout used by the widger
titlelayout = QGridLayout() # Layout for the title
# Load the logo pixmap
logopixmap = QPixmap(f"{absolute_path}/assets/img/full/logo512.png").scaled(
100, 100, Qt.KeepAspectRatio
)
# Create the name label
namelabel = QLabel("Pluto Wizard")
logolabel = QLabel() # label used for the logo
logolabel.setPixmap(logopixmap) # Load the pixmap into the label
logolabel.setAlignment(Qt.AlignRight) # Align right
font = namelabel.font() # This font is just used to set the size
font.setPointSize(30)
namelabel.setFont(font) # Apply the font to the label
namelabel.setAlignment(Qt.AlignLeft) # Align left
titlelayout.addWidget(logolabel, 0, 0) # Add the logo into the layout
titlelayout.addWidget(namelabel, 0, 1) # Add the name into the layout
titlewidget = QWidget() # Fake widget that takes the title layout
titlewidget.setLayout(titlelayout) # Set the layout
# Label with information
info_label = QLabel(
_(
'Please select the executable you downloaded.\nIf you installed a DEB, please select the "Link" option'
)
)
self.executable_btn = QPushButton(_("Select executable")) # Button for AppImage
self.executable_btn.clicked.connect(
self.get_appimage
) # Connect to the function
self.premade_btn = QPushButton(
_("Link /usr/bin/minecraft-pi-reborn-client")
) # Button for Pre-installed debs
self.premade_btn.clicked.connect(self.link_appimage) # Connect to the function
self.flatpak_btn = QPushButton(_("Link flatpak")) # Button for linking flatpak
self.flatpak_btn.clicked.connect(self.link_flatpak) # Connect to the function
# Adding things to widgets
layout.addWidget(titlewidget)
layout.addWidget(info_label)
layout.addWidget(self.executable_btn)
layout.addWidget(self.premade_btn)
layout.addWidget(self.flatpak_btn)
self.setLayout(layout)
# Functions below are related to window movement
def mousePressEvent(self, event):
if event.button() == Qt.LeftButton:
self.moveFlag = True
self.movePosition = event.globalPos() - self.pos()
self.setCursor(QCursor(Qt.OpenHandCursor))
event.accept()
def mouseMoveEvent(self, event):
if Qt.LeftButton and self.moveFlag:
self.move(event.globalPos() - self.movePosition)
event.accept()
def mouseReleaseEvent(self, event):
self.moveFlag = False
self.setCursor(Qt.ArrowCursor)
def get_appimage(self):
self.hide() # Hide the dialog
# Open the file dialog
self.filename = QFileDialog.getOpenFileName(
self,
_("Select executable"),
"/",
"Executable files (*.AppImage *.bin *.sh *)",
)
def link_appimage(self):
self.hide() # hide the dialog
# Link the executable with the AppImage
os.symlink(
"/usr/bin/minecraft-pi-reborn-client",
f"/home/{USER}/.planet-launcher/minecraft.AppImage",
)
self.filename = list() # Make a fake list
self.filename.append(
False
) # Append False to the fake list. See end of file for more info
def link_flatpak(self):
script_text = (
"#!/bin/bash\nflatpak run com.thebrokenrail.MCPIReborn $1"
) # Script contents
with open(
f"/home/{USER}/.planet-launcher/minecraft.AppImage", "w"
) as file: # Open the file
file.write(script_text) # Write the script text
self.filename = list() # Fake list. See function above for more info
self.filename.append(False)
class Planet(QMainWindow):
"""Main window class. Contains tabs and everything"""
launchfeatures = dict() # Dictionary for custom features
env = os.environ.copy() # ENV variables
def __init__(self):
super().__init__()
self.center()
try:
RPC = pypresence.Presence(
787496148763541505
) # Try to initialize pypresence and find Discord
RPC.connect() # Connect to Discord
# Set the RPC Status
RPC.update(
state=_("Launched with Planet Launcher"),
details=_("Minecraft Pi Edition: Reborn"),
large_image=random.choice(
["revival", "logo"]
), # Randomly select the logo
small_image=random.choice(
["heart", "portal", "multiplayer", "logo", "revival"]
), # Randomly select the tiny image
)
except:
print(
_("Unable to initalize Discord RPC. Skipping.")
) # If it fails, e.g Discord is not found, skip. This doesn't matter much.
if not os.path.exists(
f"/home/{USER}/.planet-launcher/config.json"
): # Config file does not exist.
# Set the configuration variable
self.conf = {
"username": "StevePi",
"options": launcher.get_features_dict(
f"/home/{USER}/.planet-launcher/minecraft.AppImage"
),
"hidelauncher": True,
"profile": "Modded MCPE",
"render_distance": "Short",
"theme": theme,
"discord_rpc": True,
"version": "extended_2.3.2",
}
with open(
f"/home/{USER}/.planet-launcher/config.json", "w"
) as file: # Write it to the configuration file
file.write(json.dumps(self.conf))
else:
with open(
f"/home/{USER}/.planet-launcher/config.json"
) as file: # Else, it exists: Read from it.
self.conf = json.loads(file.read())
self.setWindowTitle(_("Planet")) # Set the window title
self.setWindowIcon(
QIcon(f"{absolute_path}/assets/img/full/logo512.png")
) # Set the window icon
self.widget = QWidget()
self.layout = QStackedLayout()
tabs = QTabWidget() # Create the tabs
tabs.setTabPosition(QTabWidget.North) # Select the tab position.
tabs.setMovable(True) # Allow tab movement.
# Tab part. Please check every function for more info
play_tab = tabs.addTab(self.play_tab(), _("Play")) # Add the play tab
tabs.setTabIcon(
play_tab, QIcon(f"{absolute_path}/assets/img/full/logo512.png")
) # Set the icon for the tab
features_tab = tabs.addTab(
self.features_tab(), _("Features")
) # Add the features tab
tabs.setTabIcon(
features_tab, QIcon(f"{absolute_path}/assets/img/full/heart512.png")
) # set the icon for the tab
servers_tab = tabs.addTab(self.servers_tab(), _("Servers")) # Servers tab
tabs.setTabIcon(
servers_tab, QIcon(f"{absolute_path}/assets/img/full/portal512.png")
) # Set the icon
# mods_tab = tabs.addTab(self.custom_mods_tab(), "Mods")
# tabs.setTabIcon(mods_tab, QIcon(f"{absolute_path}/assets/portal512.png"))
settings_tab = tabs.addTab(self.settings_tab(), _("Settings")) # Changelog tab
tabs.setTabIcon(
settings_tab, QIcon(f"{absolute_path}/assets/img/full/wrench512.png")
)
self.layout.addWidget(tabs)
self.widget.setLayout(self.layout)
self.setCentralWidget(self.widget) # Set the central widget to the tabs
self.setGeometry(
600, 900, 200, 200
) # Set the window geometry. Doesn't do much effect from my observations, unfortunartely
self.usernameedit.setText(
self.conf["username"]
) # Set the username text to the configuration's variant
self.profilebox.setCurrentText(self.conf["profile"]) # See top comment
self.distancebox.setCurrentText(
self.conf["render_distance"]
) # See top comments
for feature in self.features:
try:
if self.conf["options"][feature]:
self.features[feature].setCheckState(
Qt.Checked
) # Set to checked if the configuration has it to true
else:
self.features[feature].setCheckState(
Qt.Unchecked
) # Else, set it unchecked
except KeyError: # May happen on downgrades or upgrades of the Reborn version
pass
# Hide launcher/Show it depending on the config
self.showlauncher.setChecked(self.conf["hidelauncher"])
# Set the features
self.set_features()
def play_tab(self) -> QWidget:
"""The main tab, with the main functionality"""
layout = QGridLayout() # The layout
titlelayout = QGridLayout() # The layout for the title
# Load the logo pixmap
logopixmap = QPixmap(f"{absolute_path}/assets/img/full/logo512.png").scaled(
100, 100, Qt.KeepAspectRatio # Scale it, but keep the aspect ratio
)
logolabel = QLabel() # Label for the pixmap
logolabel.setPixmap(logopixmap) # apply the pixmap onto the label
logolabel.setAlignment(Qt.AlignRight) # Align the label
namelabel = QLabel() # Label for the title
# Ester eggs
if date.today().month == 4 and date.today().day == 1:
namelabel.setText(
_("Banana Launcher")
) # If the date is april fish, show the banana easter egg
else:
if random.randint(1, 100) == 1:
namelabel.setText(_("Pluto Launcher")) # a 1/100, Pluto launcher
else:
namelabel.setText(_("Planet Launcher")) # Else, just set it normal
font = namelabel.font() # Font used
font.setPointSize(30) # Set the font size
namelabel.setFont(font) # Aplly the font onto the label
namelabel.setAlignment(Qt.AlignLeft) # Align the label
splashlabel = QLabel(
f'<font color="gold">{random.choice(SPLASHES)}</font>'
) # Label for splash. Uses QSS for color
splashlabel.adjustSize() # Adjust the size just in case
splashlabel.setAlignment(Qt.AlignHCenter) # Align the label
usernamelabel = QLabel(
_("Username")
) # Label that is used to direct the line edit
self.usernameedit = QLineEdit() # Line Edit for username
self.usernameedit.setPlaceholderText(_("StevePi")) # Set ghost value
distancelabel = QLabel(
_("Render Distance")
) # Label that is used to direct the combo box
self.distancebox = QComboBox()
self.distancebox.addItems(["Far", "Normal", "Short", "Tiny"]) # Set the values
self.distancebox.setCurrentText("Short") # Set the default option
profilelabel = QLabel(
_("Profile")
) # Label that is used to direct the combo box
self.profilebox = QComboBox()
self.profilebox.addItems(
[
"Vanilla MCPi",
"Modded MCPi",
"Modded MCPE",
"Optimized MCPE",
"Custom",
] # Add items into the combo box
)
self.profilebox.setCurrentText("Modded MCPE") # Set the current selection
self.showlauncher = QRadioButton(
_("Hide Launcher")
) # RadioButton used for hiding the launcher
self.versionbox = QComboBox()
# versions = json.loads(web.get_versions())["versions"]
# version_list = list()
# for version in versions:
# version_list.append(versions[version])
# version_name_list = list()
# for version in version_list:
# version_name_list.append(version["name"])
# self.versionbox.addItems(version_name_list) # Set the values
# self.versionbox.setCurrentText("Short") # Set the default option
self.playbutton = QPushButton("Play") # The most powerful button
self.playbutton.setCheckable(True) # Allow checking it
self.playbutton.clicked.connect(
self.launch
) # Connect it to the executing function
# Add widgets into the title layout
titlelayout.addWidget(logolabel, 0, 0)
titlelayout.addWidget(namelabel, 0, 1)
titlewidget = QWidget()
titlewidget.setLayout(titlelayout) # Apply the layout onto a fake widget
layout.addWidget(
titlewidget, 0, 0, 2, 5
) # Apply that widget onto the main layout
# All other widgets are applied here
layout.addWidget(splashlabel, 2, 0, 1, 6)
layout.addWidget(usernamelabel, 3, 0)
layout.addWidget(self.usernameedit, 3, 4, 1, 2)
layout.addWidget(distancelabel, 4, 0)
layout.addWidget(self.distancebox, 4, 4, 1, 2)
layout.addWidget(profilelabel, 5, 0)
layout.addWidget(self.profilebox, 5, 4, 1, 2)
layout.addWidget(self.showlauncher, 6, 4)
# layout.addWidget(self.versionbox, 8, 0, 1, 3)
layout.addWidget(self.playbutton, 8, 4, 1, 2)
widget = QWidget()
widget.setLayout(layout) # Apply the layout onto the main widget
return widget
def features_tab(self) -> QWidget:
layout = QVBoxLayout()
self.features = dict() # Dictionary used for storing checkboxes for features
default_features = launcher.get_features_dict( # Get default feature list
f"/home/{USER}/.planet-launcher/minecraft.AppImage"
)
for feature in default_features: # Loop in default features
checkbox = QCheckBox(feature) # For each feature, create a checkbox
# TODO: Fix the error if newer features are added here, or check for them in self.conf
if default_features[feature]: # Check if it's checked. If so, check it
checkbox.setCheckState(Qt.Checked)
else:
checkbox.setCheckState(Qt.Unchecked)
checkbox.clicked.connect(self.set_features) # Connect saving function
self.features[feature] = checkbox # Add the checkbox into the list
layout.addWidget(checkbox) # Add the checkbox into the layout
fakewidget = QWidget() # Create a fake widget to apply the layout on
fakewidget.setLayout(layout) # Apply the layoutonto
scroll = QScrollArea() # Add a scoll area
scroll.setVerticalScrollBarPolicy(
Qt.ScrollBarAlwaysOn
) # Shoe the vertical scroll bar
scroll.setHorizontalScrollBarPolicy(
Qt.ScrollBarAlwaysOff
) # Hide the horizontak scroll bar
scroll.setWidgetResizable(
True
) # Allow window resizing and fix itt with the scrollbar
scroll.setWidget(fakewidget) # Set the main widget into the scrollbar
fakelayout = QGridLayout()
fakelayout.addWidget(scroll, 0, 0) # Apply the scrollbar onto the layout
widget = QWidget()
widget.setLayout(fakelayout)
return widget
def servers_tab(self) -> QWidget:
widget = QWidget()
layout = QGridLayout()
self.serversedit = QTextEdit() # Create a text editing area
if not os.path.exists(f"/home/{USER}/.minecraft-pi/servers.txt"):
with open(f"/home/{USER}/.minecraft-pi/servers.txt") as servers:
servers.write("pbptanarchy.tk")
self.serversedit.textChanged.connect(
self.save_servers
) # Connect on change to the save function
with open(f"/home/{USER}/.minecraft-pi/servers.txt") as servers:
self.serversedit.setPlainText(
servers.read()
) # Set the text of the text editing area
infolabel = QLabel( # Label with information about the server format
_(
'Servers are stored in the format of <font color="gold">IP: </font><font color="blue">Port</font>'
)
)
layout.addWidget(self.serversedit, 0, 0) # Add the widgets
layout.addWidget(infolabel, 6, 0)
widget.setLayout(layout)
return widget
def custom_mods_tab(self) -> QWidget:
layout = QVBoxLayout()
for mod in os.listdir(
f"/home/{USER}/.planet-launcher/mods/"
): # Loop in every mod in the mod directory
checkbox = QCheckBox(mod) # Create a checkbox with the mod name
checkbox.setCheckState(Qt.Unchecked) # Set it to unchecked
layout.addWidget(checkbox)
fakewidget = QWidget()
fakewidget.setLayout(layout)
scroll = QScrollArea()
scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scroll.setWidgetResizable(True)
scroll.setWidget(fakewidget)
fakelayout = QGridLayout()
fakelayout.addWidget(scroll, 0, 0)
widget = QWidget()
widget.setLayout(fakelayout)
return widget
def changelog_widget(self):
web_engine = QWebView() # Create a webview object
web_engine.load(
QUrl().fromLocalFile(f"{absolute_path}/assets/misc/changelog.html")
) # Load the local file
# TODO: Use two different tabs for the webview
return web_engine
def settings_widget(self):
widget = QWidget()
layout = QGridLayout()
skin_label = QLabel(_("Set the skin"))
self.skin_button = QPushButton(_("Select Skin"))
self.skin_button.clicked.connect(self.select_skin)
config_label = QLabel(_("Reset config"))
self.delete_config_button = QPushButton(_("Delete config"))
self.delete_config_button.clicked.connect(self.delete_config)
appimage_label = QLabel(_("Delete executable"))
self.delete_appimage_button = QPushButton(_("Delete"))
self.delete_appimage_button.clicked.connect(self.delete_appimage)
self.import_gmcpil_button = QPushButton(_("Import settings"))
self.import_gmcpil_button.clicked.connect(self.import_gmcpil)
layout.addWidget(skin_label, 0, 0)
layout.addWidget(self.skin_button, 0, 1)
layout.addWidget(config_label, 1, 0)
layout.addWidget(self.delete_config_button, 1, 1)
layout.addWidget(appimage_label, 2, 0)
layout.addWidget(self.delete_appimage_button, 2, 1)
widget.setLayout(layout)
return widget
def settings_tab(self):
tabs = QTabWidget()
tabs.setTabPosition(QTabWidget.South)
settings_tab = tabs.addTab(self.settings_widget(), _("General"))
changelog_tab = tabs.addTab(self.changelog_widget(), _("Changelog"))
editor_tab = tabs.addTab(mcpiedit.NBTEditor(), _("MCPIEdit"))
tabs.setTabIcon(
settings_tab, QIcon(f"{absolute_path}/assets/img/full/wrench512.png")
) # Set the icon
tabs.setTabIcon(
changelog_tab, QIcon(f"{absolute_path}/assets/img/full/git.png")
) # Set the icon
tabs.setTabIcon(
editor_tab, QIcon(f"{absolute_path}/assets/img/full/mcpiedit.png")
) # Set the icon
return tabs
def import_gmcpil(self):
with open(f"/home/{USER}/.gmcpil.json") as f:
gmcpil_features = json.loads(f.read())["features"]
for feature in gmcpil_features:
try:
if gmcpil_features[feature]:
self.features[feature].setCheckState(
Qt.Checked
) # Set to checked if the configuration has it to true
self.conf["options"][feature] = True
else:
self.features[feature].setCheckState(
Qt.Unchecked
) # Else, set it unchecked
self.conf["options"][feature] = False
except KeyError: # May happen on downgrades or upgrades of the Reborn version
pass
def mousePressEvent(self, event):
if event.button() == Qt.LeftButton:
self.moveFlag = True
self.movePosition = event.globalPos() - self.pos()
self.setCursor(QCursor(Qt.OpenHandCursor))
event.accept()
def mouseMoveEvent(self, event):
if Qt.LeftButton and self.moveFlag:
self.move(event.globalPos() - self.movePosition)
event.accept()
def mouseReleaseEvent(self, event):
self.moveFlag = False
self.setCursor(Qt.ArrowCursor)
def center(self):
qr = self.frameGeometry()
cp = QDesktopWidget().availableGeometry().center()
qr.moveCenter(cp)
self.move(qr.topLeft())
def set_features(self):
for feature in self.features:
if self.features[feature].isChecked():
self.launchfeatures[feature] = True
else:
self.launchfeatures[feature] = False
def save_profile(self):
self.set_features()
self.conf["username"] = self.usernameedit.text()
self.conf["options"] = self.launchfeatures
self.conf["render_distance"] = self.distancebox.currentText()
self.conf["profile"] = self.profilebox.currentText()
self.conf["hidelauncher"] = self.showlauncher.isChecked()
with open(f"/home/{USER}/.planet-launcher/config.json", "w") as file:
file.write(json.dumps(self.conf))
def save_servers(self):
with open(f"/home/{USER}/.minecraft-pi/servers.txt", "w") as file:
file.write(self.serversedit.toPlainText())
def select_skin(self):
filename = QFileDialog.getOpenFileName(
self, _("Select skin file"), "/", "PNG files (*.png)"
)
if not filename == "":
with open(
f"/home/{USER}/.minecraft-pi/overrides/images/mob/char.png", "w"
) as skin:
skin.write("quick placeholder")
Image.open(filename[0]).crop((0, 0, 64, 32)).convert("RGBA").save(
f"/home/{USER}/.minecraft-pi/overrides/images/mob/char.png"
)
def delete_config(self):
dialog = QMessageBox()
dialog.setWindowTitle(_("Are you sure you want to reset?"))
dialog.setText(
_(
"Are you sure you want to delete the config? This action is unrecoverable."
)
)
dialog.setStandardButtons(QMessageBox.Ok | QMessageBox.Abort)
dialog.setIcon(QMessageBox.Warning)
button = dialog.exec()
if button == QMessageBox.Ok:
os.remove(f"/home/{USER}/.planet-launcher/config.json")
self.hide()
sys.exit()
def delete_appimage(self):
dialog = QMessageBox()
dialog.setWindowTitle(_("Are you sure you want to reset?"))
dialog.setText(
_(
"Are you sure you want to delete the AppImage? This action is unrecoverable."
)
)
dialog.setStandardButtons(QMessageBox.Ok | QMessageBox.Abort)
dialog.setIcon(QMessageBox.Warning)
button = dialog.exec()
if button == QMessageBox.Ok:
os.remove(f"/home/{USER}/.planet-launcher/minecraft.AppImage")
self.hide()
sys.exit()
def launch(self):
self.save_profile()
if self.profilebox.currentText().lower() == "vanilla mcpi":
self.launchfeatures = launcher.get_features_dict(
f"/home/{USER}/.planet-launcher/minecraft.AppImage"
)
for feature in self.launchfeatures:
self.launchfeatures[feature] = False
elif self.profilebox.currentText().lower() == "modded mcpi":
self.launchfeatures = launcher.get_features_dict(
f"/home/{USER}/.planet-launcher/minecraft.AppImage"
)
self.launchfeatures["Touch GUI"] = False
elif self.profilebox.currentText().lower() == "modded mcpe":
self.launchfeatures = launcher.get_features_dict(
f"/home/{USER}/.planet-launcher/minecraft.AppImage"
)
elif self.profilebox.currentText().lower() == "optimized mcpe":
self.launchfeatures = launcher.get_features_dict(
f"/home/{USER}/.planet-launcher/minecraft.AppImage"
)
self.launchfeatures["Fancy Graphics"] = False
self.launchfeatures["Smooth Lightning"] = False
self.launchfeatures["Animated Water"] = False
self.launchfeatures['Disable "gui_blocks" Atlas'] = False
self.env = launcher.set_username(self.env, self.usernameedit.text())
self.env = launcher.set_options(self.env, self.launchfeatures)
self.env = launcher.set_render_distance(
self.env, self.distancebox.currentText()
)
if self.showlauncher.isChecked() == True:
self.hide()
launcher.run(
self.env, f"/home/{USER}/.planet-launcher/minecraft.AppImage"
).wait()
else:
launcher.run(self.env, f"/home/{USER}/.planet-launcher/minecraft.AppImage")
self.show()
if __name__ == "__main__":
apppath = str()
app = QApplication(sys.argv)
if os.path.exists(f"/home/{USER}/.planet-launcher/config.json"):
with open(f"/home/{USER}/.planet-launcher/config.json") as file:
app.setPalette(qdarktheme.load_palette(json.loads(file.read())["theme"]))
else:
app.setPalette(qdarktheme.load_palette(theme))
if not os.path.exists(f"/home/{USER}/.planet-launcher/minecraft.AppImage"):
pluto = ConfigPluto()
pluto.show()
pluto.exec()
if pluto.filename[0] == "":
sys.exit(-1)
elif pluto.filename[0] == False:
print(_("Using /usr/bin as an executable."))
else:
with open(pluto.filename[0], "rb") as appimage:
with open(
f"/home/{USER}/.planet-launcher/minecraft.AppImage", "wb"
) as out:
out.write(appimage.read())
os.chmod(f"/home/{USER}/.planet-launcher/minecraft.AppImage", 0o755)
window = Planet()
window.show()
app.exec()

View file

@ -1,363 +0,0 @@
"""
Copyright (C) 2022 Alexey Pavlov
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
# MCPIEdit
# This is a different editor from revival's MCPIedit!
# This one is intended to work with Planet but it can work on its own
import sys
import os
import pathlib
import gettext
LOCALE = os.getenv("LANG")
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
import nbt_utils as nbt
USER = os.getenv("USER") # Get the username, used for later
absolute_path = pathlib.Path(__file__).parent.absolute()
if str(absolute_path).startswith("/usr/bin"):
absolute_path = "/usr/lib/planet-launcher/"
sys.path.append(absolute_path)
if os.path.exists("/usr/lib/planet-launcher/"):
sys.path.append("/usr/lib/planet-launcher/")
if not os.path.exists(f"/home/{USER}/.minecraft-pi/games/com.mojang/minecraftWorlds/"):
os.makedirs(f"/home/{USER}/.minecraft-pi/games/com.mojang/minecraftWorlds/")
_ = gettext.translation(
"mcpiedit",
localedir=str(absolute_path) + "/assets/translations/",
languages=[LOCALE],
).gettext
GAME_TYPES = {"Survival": nbt.pynbt.TAG_Int(0), "Creative": nbt.pynbt.TAG_Int(1)}
GAME_INTREGERS = {"0": "Survival", "1": "Creative"}
BOOLEAN_INTREGERS = {0: False, 1: True}
BOOLEAN_INTREGERS_REVERSED = {False: 0, True: 1}
class AboutWindow(QWidget):
def __init__(self):
super().__init__()
layout = QVBoxLayout()
label = QLabel("About MCPIedit")
label.setAlignment(Qt.AlignHCenter)
font = label.font() # Font used
font.setPointSize(15) # Set the font size
label.setFont(font) # Aplly the font onto the label
desc_label = QLabel(
_(
"The default built-in NBT editor for Planet.\n\nMCPIedit makes use of Pi-NBT\n from the original MCPIedit project\nby TheBrokenRail, which is\nlicensed under the MIT license."
)
)
desc_label.setAlignment(Qt.AlignHCenter)
layout.addWidget(label)
layout.addWidget(desc_label)
self.setLayout(layout)
class FileSelectorTab(QWidget):
def __init__(self):
super().__init__()
layout = QVBoxLayout()
info_label = QLabel(
_(
"NBT editors allow you to edit your world\nfiles to change game modes, time,\nand even the world name. Select an NBT\nfile to edit using the button below."
)
)
info_label.setAlignment(Qt.AlignHCenter)
self.load_button = QPushButton(_("Select NBT File"))
self.about_button = QPushButton(_("About"))
self.about_button.clicked.connect(self.about_window)
layout.addWidget(info_label)
layout.addWidget(self.load_button)
layout.addWidget(self.about_button)
self.setLayout(layout)
def about_window(self):
self.window = AboutWindow()
self.window.show()
class EditorTab(QWidget):
def __init__(self, filename):
super().__init__()
layout = QVBoxLayout()
self.nbt = nbt.load_nbt(filename, True)
self.filename = filename
self.tabs = QTabWidget()
self.tabs.setTabPosition(QTabWidget.West)
self.tabs.setMovable(True)
self.tabs.addTab(self.main_tab(), _("General"))
self.tabs.addTab(self.world_tab(), _("World"))
self.name_edit.setText(str(self.nbt["LevelName"].value))
self.timestamp_box.setValue(int(self.nbt["LastPlayed"].value))
self.game_box.setCurrentText(
GAME_INTREGERS[str(int(self.nbt["GameType"].value))]
)
self.seed_edit.setText(str(int(self.nbt["RandomSeed"].value)))
self.time_edit.setText(str(int(self.nbt["Time"].value)))
# self.mobs_toggle.setChecked(BOOLEAN_INTREGERS[int(self.nbt["SpawnMobs"])]) # REMOVED BECAUSE DOES NOT WORK
self.spawn_x_box.setValue(int(self.nbt["SpawnX"].value))
self.spawn_y_box.setValue(int(self.nbt["SpawnY"].value))
self.spawn_z_box.setValue(int(self.nbt["SpawnZ"].value))
self.player_spawn_x_box.setValue(int(self.nbt["Player"]["SpawnX"].value))
self.player_spawn_y_box.setValue(int(self.nbt["Player"]["SpawnY"].value))
self.player_spawn_z_box.setValue(int(self.nbt["Player"]["SpawnZ"].value))
layout.addWidget(self.tabs)
self.setLayout(layout)
def main_tab(self):
widget = QWidget()
layout = QGridLayout()
self.name_label = QLabel(_("World name"))
self.name_edit = QLineEdit()
self.name_edit.setPlaceholderText(_("OneChunk"))
self.seed_label = QLabel("World Seed")
self.seed_edit = QLineEdit()
self.seed_edit.setPlaceholderText("-121542953")
self.seed_edit.setValidator(QIntValidator())
self.timestamp_label = QLabel(_("Last Played Timestamp"))
self.timestamp_box = QSpinBox()
self.timestamp_box.setMaximum(2147483647)
self.game_label = QLabel(_("Game mode"))
self.game_box = QComboBox()
self.game_box.addItems(["Survival", "Creative"])
# self.mobs_toggle = AnimatedToggle(
# checked_color="#59b8e0",
# pulse_checked_color="#92cee8"
# )
self.time_label = QLabel(_("Time (In Ticks)"))
self.time_edit = QLineEdit()
self.time_edit.setPlaceholderText("1770")
self.time_edit.setValidator(QIntValidator())
self.back_button = QPushButton(_("Back"))
self.save_button = QPushButton(_("Save"))
self.save_button.clicked.connect(self.save)
layout.addWidget(self.name_label, 0, 0)
layout.addWidget(self.name_edit, 0, 1)
layout.addWidget(self.seed_label, 1, 0)
layout.addWidget(self.seed_edit, 1, 1)
layout.addWidget(self.timestamp_label, 2, 0)
layout.addWidget(self.timestamp_box, 2, 1)
layout.addWidget(self.game_label, 3, 0)
layout.addWidget(self.game_box, 3, 1)
layout.addWidget(self.time_label, 4, 0)
layout.addWidget(self.time_edit, 4, 1)
layout.addWidget(self.back_button, 5, 0)
layout.addWidget(self.save_button, 5, 1)
widget.setLayout(layout)
return widget
def world_tab(self):
layout = QGridLayout()
x_label = QLabel(_("Spawnpoint X"))
self.spawn_x_box = QSpinBox()
self.spawn_x_box.setMinimum(-128)
self.spawn_x_box.setMaximum(128)
y_label = QLabel(_("Spawnpoint Y"))
self.spawn_y_box = QSpinBox()
self.spawn_y_box.setMinimum(-64)
self.spawn_y_box.setMaximum(64)
z_label = QLabel(_("Spawnpoint Z"))
self.spawn_z_box = QSpinBox()
self.spawn_z_box.setMinimum(-128)
self.spawn_z_box.setMaximum(128)
player_x_label = QLabel(_("Player Spawnpoint X"))
self.player_spawn_x_box = QSpinBox()
self.player_spawn_x_box.setMinimum(-128)
self.player_spawn_x_box.setMaximum(128)
player_y_label = QLabel(_("Player Spawnpoint Y"))
self.player_spawn_y_box = QSpinBox()
self.player_spawn_y_box.setMinimum(-64)
self.player_spawn_y_box.setMaximum(64)
player_z_label = QLabel(_("Player Spawnpoint Z"))
self.player_spawn_z_box = QSpinBox()
self.player_spawn_z_box.setMinimum(-128)
self.player_spawn_z_box.setMaximum(128)
layout.addWidget(x_label, 0, 0)
layout.addWidget(y_label, 1, 0)
layout.addWidget(z_label, 2, 0)
layout.addWidget(player_x_label, 3, 0)
layout.addWidget(player_y_label, 4, 0)
layout.addWidget(player_z_label, 5, 0)
note_label = QLabel(
_(
"Note:\nPlayer spawnpoints are very buggy!\nYou might spawn in the wrong\nplace or even outside the world!\nDo not use on valuable worlds."
)
)
layout.addWidget(self.spawn_x_box, 0, 1)
layout.addWidget(self.spawn_y_box, 1, 1)
layout.addWidget(self.spawn_z_box, 2, 1)
layout.addWidget(self.player_spawn_x_box, 3, 1)
layout.addWidget(self.player_spawn_y_box, 4, 1)
layout.addWidget(self.player_spawn_z_box, 5, 1)
layout.addWidget(note_label, 6, 0, 1, 2)
widget = QWidget()
widget.setLayout(layout)
self.scroll = QScrollArea()
self.scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
self.scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.scroll.setWidgetResizable(True)
self.scroll.setWidget(widget)
return self.scroll
def save(self):
self.nbt["LevelName"] = nbt.pynbt.TAG_String(self.name_edit.text())
self.nbt["LastPlayed"] = nbt.pynbt.TAG_Long(self.timestamp_box.value())
self.nbt["GameType"] = GAME_TYPES[self.game_box.currentText()]
self.nbt["RandomSeed"] = nbt.pynbt.TAG_Long(int(self.seed_edit.text()))
self.nbt["Time"] = nbt.pynbt.TAG_Long(int(self.time_edit.text()))
self.nbt["SpawnX"] = nbt.pynbt.TAG_Int(self.spawn_x_box.value())
self.nbt["SpawnY"] = nbt.pynbt.TAG_Int(self.spawn_y_box.value())
self.nbt["SpawnZ"] = nbt.pynbt.TAG_Int(self.spawn_z_box.value())
self.nbt["Player"]["SpawnX"] = nbt.pynbt.TAG_Int(
self.player_spawn_x_box.value()
)
self.nbt["Player"]["SpawnY"] = nbt.pynbt.TAG_Int(
self.player_spawn_y_box.value()
)
self.nbt["Player"]["SpawnZ"] = nbt.pynbt.TAG_Int(
self.player_spawn_z_box.value()
)
nbt.save_nbt(self.nbt, self.filename)
class NBTEditor(QWidget):
def __init__(self):
super().__init__()
self.layout = QStackedLayout()
selector = FileSelectorTab()
selector.load_button.clicked.connect(self.load_nbt)
self.layout.addWidget(selector)
self.setLayout(self.layout)
def load_nbt(self):
fname = QFileDialog.getOpenFileName(
self,
_("Open NBT File"),
f"/home/{USER}/.minecraft-pi/games/com.mojang/minecraftWorlds/",
_("Minecraft Pi Level NBT (level.dat)"),
)
if fname[0] == "":
return
editor = EditorTab(fname[0])
editor.back_button.clicked.connect(lambda: self.layout.setCurrentIndex(0))
self.layout.insertWidget(1, editor)
self.layout.setCurrentIndex(1)
self.setLayout(self.layout)
if __name__ == "__main__":
app = QApplication(sys.argv)
window = QMainWindow()
window.setCentralWidget(NBTEditor())
window.setWindowTitle(_("MCPIEdit"))
window.setWindowIcon(QIcon(f"{absolute_path}/assets/img/full/mcpiedit.png"))
window.show()
app.exec()

View file

@ -1,67 +0,0 @@
"""
This file is uniquely licensed under the MIT license because it may be useful in other applications an utilites.
MIT License
Copyright (c) 2022 Alexey Pavlov
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:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
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.
"""
import pynbt
import subprocess
def remove_header(filename: str):
# with open(filename, "rb") as file:
# data = file.read()
# with open(filename, "wb") as write_file:
# write_file.write(data[8:])
# This is WIP code! Do not use!
return subprocess.Popen(
["pi-nbt", "remove-header", filename, filename + "_temp.dat"]
).wait()
def add_header(filename: str):
return subprocess.Popen(
["pi-nbt", "add-header", filename + "_temp.dat", filename]
).wait()
def load_nbt(filename: str, header=False):
if header:
remove_header(filename)
with open(filename + "_temp.dat", "rb") as nbt:
nbt = pynbt.NBTFile(io=nbt, little_endian=True)
return nbt
def save_nbt(nbt: pynbt.NBTFile, filename: str, header=True):
with open(filename + "_temp.dat", "wb") as writefile:
nbt.save(io=writefile, little_endian=True)
if header:
add_header(filename)

View file

@ -1,68 +0,0 @@
"""
Copyright (C) 2022 Alexey Pavlov
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
SPLASHES = [
"The moon is not a planet",
"Pluto = Planet",
"Ayy Yep!",
"What's my purpose?",
"MCPI_SPEEDHACK",
"MCPIL-Revival",
"Minescripters",
"I use Planet BTW",
"Snowball",
"Robo",
"If I could, I would. But I can't, so I shan't.",
"SyntaxError: invalid syntax",
"We Fixed The Rail!",
"The World Of Notch!",
"github.com/mcpiscript/Planet!",
"Now with fly-hacks!",
"Now with custom skins!",
"Now with *fancy icons*!",
"@Banana",
"BANANA!",
'To "Na" Or Not To "Na", that is the question!',
"Not Minecraft Java!",
"Oh yeah, that version...",
"Segmentation fault (core dumped)",
"It's the Segment's Fault!",
"Who is StevePi?",
"(Not) Made by Notch!",
"Open-Source!",
"RIP all MCPILs, 2020-2022",
"StevePi = Leha confirmed?",
"Watch out for StevePi!",
"Didn't remove Herobrine!",
"Check out PBPT Anarchy!",
"你好中国",
"한국 안녕하세요!",
"日本ハロー!",
"Привет Россия!",
"Підтримай Україну!",
"Supercalifragilisticexpialidocious!",
"Now with multiplayer!",
"RED EXE ENGINEER GAMING",
"Play Minecraft Pi Edition, watch Red-Exe-Engineer, get PIG!",
"Wat",
"About the same size as Earth",
"Now with translations!",
"Now with dynamic building!",
"Now with more surprises!",
"Now with more confusion!",
]

View file

@ -1,217 +0,0 @@
#!/usr/bin/env python3
"""
MCPiT: Minecraft Pi Edition Texturepack Tool v.1.1
Copyright (C) 2022 Alexey Pavlov
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
from zipfile import *
import os
import shutil
import click
USER = os.getenv("USER")
INDEX = [
# Armor
"chain_1.png",
"chain_2.png",
"cloth_1.png",
"cloth_2.png",
"diamond_1.png",
"diamond_2.png",
"gold_1.png",
"gold_2.png",
"iron_1.png",
"iron_2.png",
# Miscelannous
"kz.png",
"clouds.png",
# Font and GUI
"default8.png",
"background.png",
"bg32.png",
"cursor.png",
"default_world.png",
"gui.png",
"gui2.png",
"gui_blocks.png",
"icons.png",
"itemframe.png",
"items.png", # Items
"pi_title.png",
"spritesheet.png",
"title.png",
"touchgui.png",
"minecon140.png",
"raknet_high_72.png",
"raknet_low_18.png",
# Item entitites
"arrows.png",
"camera.png",
"sign.png",
# Mobs
"chicken.png",
"cow.png",
"creeper.png",
"pig.png",
"pigzombie.png",
"sheep.png",
"sheep_fur.png",
"skeleton.png",
"spider.png",
"zombie.png",
# Misc entities
"particles.png",
# Blocks
"terrain.png",
]
TEXTURE_PATHS = [
"armor/chain_1.png",
"armor/chain_2.png",
"armor/cloth_1.png",
"armor/cloth_2.png",
"armor/diamond_1.png",
"armor/diamond_2.png",
"armor/gold_1.png",
"armor/gold_2.png",
"armor/iron_1.png",
"armor/iron_2.png",
"art/kz.png",
"environment/clouds.png",
"font/default8.png",
"gui/background.png",
"gui/bg32.png",
"gui/cursor.png",
"gui/default_world.png",
"gui/gui.png",
"gui/gui2.png",
"gui/gui_blocks.png",
"gui/icons.png",
"gui/itemframe.png",
"gui/items.png",
"gui/pi_title.png",
"gui/spritesheet.png",
"gui/title.png",
"gui/touchgui.png",
"gui/badge/minecon140.png",
"gui/logo/raknet_high_72.png",
"gui/logo/raknet_low_18.png",
"item/arrows.png",
"item/camera.png",
"item/sign.png",
"mob/chicken.png",
"mob/cow.png",
"mob/creeper.png",
"mob/pig.png",
"mob/pigzombie.png",
"mob/sheep.png",
"mob/sheep_fur.png",
"mob/skeleton.png",
"mob/spider.png",
"mob/zombie.png",
"particles.png",
"terrain.png",
]
def pepack_install(zip_path):
with ZipFile(zip_path) as zip_file:
zip_file.extractall(path=f"/home/{USER}/.minecraft-pi/overrides/")
def mcpit_install(zip_path):
not_found = list()
found = list()
with ZipFile(zip_path) as zip_file:
for file in zip_file.namelist():
if file in INDEX:
found.append(file)
else:
not_found.append(file)
for file in found:
zip_file.extract(
file,
path=f"/home/{USER}/.minecraft-pi/overrides/images/"
+ TEXTURE_PATHS[INDEX.index(file)][: -len(INDEX[INDEX.index(file)])],
)
if "changelog" in zip_file.namelist():
with zip_file.open("changelog") as file:
click.echo(file.read())
if "credits" in zip_file.namelist():
with zip_file.open("credits") as file:
click.echo(file.read())
def install_pack(zip_path, pack_format):
if pack_format == "mcpit":
mcpit_install(zip_path)
elif pack_format == "pepack":
pepack_install(zip_path)
def erase_pack():
shutil.rmtree(f"/home/{USER}/.minecraft-pi/overrides/images")
@click.group()
def main():
pass
@main.command(help="Install a texture pack")
@click.argument("pack_path", type=click.Path(exists=True))
@click.option(
"--mcpit",
"-m",
"pack_format",
is_flag=True,
default=True,
help="Use MCPiT format.",
flag_value="mcpit",
)
@click.option(
"--pepack",
"-p",
"pack_format",
is_flag=True,
default=False,
help="Use PEPack format.",
flag_value="pepack",
)
def install(pack_path, pack_format):
install_pack(pack_path, pack_format)
@main.command(help="Erase the pack files")
def erase():
erase_pack()
@main.command(help="Show version and license")
def version():
click.echo(__doc__)
if __name__ == "__main__":
main()

View file

@ -1,137 +0,0 @@
"""
This file is part of mcpit/Planet.
mcpit/Planet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
mcpit/Planet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with mcpit/Planet. If not, see <https://www.gnu.org/licenses/>.
"""
from PIL import Image
POSITIONS = {
# Row 1
"grass_carried": (0, 0, 16, 16),
"stone": (16, 0, 32, 16),
"dirt": (32, 0, 48, 16),
"grass_side_carried": (48, 0, 64, 16),
"planks_oak": (64, 0, 80, 16),
"stone_slab_side": (80, 0, 96, 16),
"stone_slab_top": (96, 0, 112, 16),
"brick": (112, 0, 128, 16),
"tnt_side": (128, 0, 144, 16),
"tnt_top": (144, 0, 160, 16),
"tnt_bottom": (160, 0, 176, 16),
"web": (176, 0, 192, 16),
"flower_rose": (192, 0, 208, 16),
"flower_dandelion": (208, 0, 224, 16),
"sapling_oak": (240, 0, 256, 16),
# Row 2
"cobblestone": (0, 16, 16, 32),
"bedrock": (16, 16, 32, 32),
"sand": (32, 16, 48, 32), # I love these blocks
"gravel": (48, 16, 64, 32),
"oak_log": (64, 16, 80, 32),
"oak_log_top": (80, 16, 96, 32),
"iron_block": (96, 16, 112, 32),
"gold_block": (112, 16, 128, 32),
"diamond_block": (128, 16, 144, 32),
"chest_top": (144, 16, 160, 32),
"chest_side": (160, 16, 176, 32),
"chest_front": (176, 16, 192, 32),
"mushroom_red": (192, 16, 208, 32),
"mushroom_brown": (208, 16, 224, 32),
"fire_0_placeholder": (240, 16, 256, 32),
# Row 3
"gold_ore": (0, 32, 16, 48),
"iron_ore": (16, 32, 32, 48),
"coal_ore": (32, 32, 48, 48),
"bookshelf": (48, 32, 64, 48),
"cobblestone_mossy": (64, 32, 80, 48),
"obsidian": (80, 32, 96, 48),
"grass_side": (96, 32, 112, 48),
"tallgrass": (112, 32, 128, 48),
"grass_top": (128, 32, 144, 48),
"crafting_table_top": (176, 32, 192, 48),
"furnace_front": (192, 32, 208, 48),
"furnace_side": (208, 32, 224, 48),
"fire_1_placeholder": (240, 32, 256, 48),
# Row 4
"glass": (16, 48, 32, 64),
"diamond_ore": (32, 48, 48, 64),
"redstone_ore": (48, 48, 64, 64),
"leaves_oak_carried": (64, 48, 80, 64),
"leaves_big_oak_carried": (80, 48, 96, 64),
"stonebrick": (96, 48, 112, 64),
"deadbush": (112, 48, 128, 64),
"shrub": (128, 48, 144, 64),
"crafting_table_side": (176, 48, 192, 64),
"crafting_table_front": (192, 48, 208, 64),
"furnace_front_on": (208, 48, 224, 64),
"furnace_top": (224, 48, 240, 64),
"spruce_sapling": (240, 48, 256, 64),
# Row 5
"white_wool": (0, 64, 16, 80),
"snow": (32, 64, 48, 80),
"ice": (48, 64, 64, 80),
"grass_block_snow": (64, 64, 80, 80),
"cactus_top": (80, 64, 96, 80),
"cactus_side": (96, 64, 112, 80),
"cactus_bottom": (112, 64, 128, 80),
"clay": (128, 64, 144, 80),
"sugarcane_extracted": (144, 64, 160, 80),
"birch_sapling": (240, 64, 256, 80),
# Row 6
"torch": (0, 80, 16, 96),
"oak_door_top": (16, 80, 32, 96),
"iron_door_top": (32, 80, 48, 96),
"ladder": (48, 80, 64, 96),
"oak_trapdoor": (64, 80, 80, 96),
"farmland_moist": (96, 80, 112, 96),
"farmland": (112, 80, 128, 96),
"wheat_stage0": (128, 80, 144, 96),
"wheat_stage1": (144, 80, 160, 96),
"wheat_stage2": (160, 80, 176, 96),
"wheat_stage3": (176, 80, 192, 96),
"wheat_stage4": (192, 80, 208, 96),
"wheat_stage5": (208, 80, 224, 96),
"wheat_stage6": (224, 80, 240, 96),
"wheat_stage7": (240, 80, 256, 96),
# Row 7
"oak_door_bottom": (16, 96, 32, 112),
"iron_door_bottom": (32, 96, 48, 112),
"mossy_stone_bricks": (48, 96, 64, 112),
"cracked_stone_bricks": (64, 96, 80, 112),
"netherrack": (96, 96, 112, 112),
"soul_sand": (112, 96, 128, 112),
"glowstone": (128, 96, 144, 112),
"melon_stem": (240, 96, 256, 112),
# Row 8
"black_wool": (16, 112, 32, 128),
"gray_wool": (32, 112, 48, 128),
"dark_oak_log": (64, 112, 80, 128),
"birch_log": (80, 112, 96, 128),
"attached_melon_stem": (240, 112, 256, 128),
# Row 9
"red_wool": (16, 128, 32, 144),
"pink_wool": (32, 128, 48, 144),
"birch_leaves": (48, 128, 64, 144),
"dark_oak_leaves": (32, 128, 48, 144),
"bed1": (48, 128, 64, 144),
"bed2": (64, 128, 80, 144),
"melon_side": (80, 128, 96, 144),
"melon_top": (96, 128, 112, 144),
"lapis_block": (112, 128, 128, 144),
}
def extract_fire():
pass
if __name__ == "__main__":
with Image.open(
"/usr/lib/minecraft-pi-reborn-client/data/images/terrain.png"
) as img:
region = img.crop(POSITIONS["black_wool"])
region.show()

View file

@ -1,37 +0,0 @@
"""
Copyright (C) 2022 Alexey Pavlov
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
from urllib.request import urlopen
import requests
def get_versions() -> str:
return str(
urlopen(
"https://gist.github.com/leha-code/3e8fea40346536b451e45fc1728ed250/raw/versions.json"
).read(),
"UTF-8",
)
def check_internet() -> bool:
try:
requests.head("http://www.google.com/")
return True
except requests.ConnectionError:
return False

View file

@ -1,7 +0,0 @@
pyqt5
pyqtdarktheme
pypresence
pillow
qtwidgets
darkdetect
pynbt

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

View file

@ -1,14 +0,0 @@
Package: planet-launcher
Version: 1.2.0pre1
Architecture: all
Maintainer: mcpiscript <mcpiscript@gmail.com>
Depends: python3-pyqt5, python3:any, python3-pyqt5.qtwebkit, python3-pyqt5.qtsvg, python3-pyqt5.qtwebkit, python3-pyqt5.qtmultimedia, gcc
Replaces: mcpil, mcpil-r, gmcpil, jmcpil
Recommends: python3-pyqtdarkmode, python3-minecraftpi
Provides: pi-nbt, mcpiedit, mcpit
Section: games
Priority: optional
Homepage: https://github.com/mcpiscript/Planet
Description: A better launcher for Minecraft: Pi Edition
A better launcher.
This launcher requires you to download an AppImage file from the official Jenkins.

View file

@ -1,6 +0,0 @@
pip3 install pyqtdarktheme pypresence pillow darkdetect qtwidgets pynbt
link /usr/lib/planet-launcher/main.py /usr/bin/planet-launcher
chmod 755 /usr/lib/planet-launcher/main.py
link /usr/lib/planet-launcher/assets/misc/planet-launcher.desktop /usr/share/applications/planet-launcher.desktop
link /usr/lib/planet-launcher/textures.py /usr/bin/mcpit
gcc /usr/lib/planet-launcher/pi-nbt.c -o /usr/bin/pi-nbt

View file

@ -1,4 +0,0 @@
rm -rf /usr/bin/planet-launcher
rm -rf /usr/share/applications/planet-launcher.desktop
rm -rf /usr/bin/pi-nbt
rm -rf /usr/bin/mcpit

View file

@ -1,24 +0,0 @@
#!/bin/bash
rm -r planet/__pycache__
mkdir build
mkdir build/planet
mkdir build/planet/usr
mkdir build/planet/usr/lib
cp -r ./planet/ ./build/planet/usr/lib/planet-launcher
mkdir build/planet/DEBIAN
cp ./LICENSE ./build/planet/DEBIAN/license
cp ./scripts/package/deb/control ./build/planet/DEBIAN/control
cp ./scripts/package/deb/postinst ./build/planet/DEBIAN/postinst
cp ./scripts/package/deb/postrm ./build/planet/DEBIAN/postrm
wget https://github.com/MCPI-Revival/MCPIedit/raw/master/pi-nbt.c -O ./build/planet/usr/lib/planet-launcher/pi-nbt.c -q
dpkg-deb --build ./build/planet
mkdir dist
cp ./build/planet.deb ./dist/planet.deb
rm -r build

15
styles.css Normal file
View file

@ -0,0 +1,15 @@
body {
background-color: black;
}
.mainimage {
text-align: center;
padding-top: 30px;
}
.mainheader {
font-family: 'IBM Plex Sans Hebrew', sans-serif;
font-size: 1.5em;
text-align: center;
color: white;
}