From f96622659bee7e3d991e4dbabb14380037921f6f Mon Sep 17 00:00:00 2001
From: Grimet <97934952+Grimet14@users.noreply.github.com>
Date: Thu, 21 Apr 2022 18:26:17 -0700
Subject: [PATCH 01/11] Update README.md (#20)
---
README.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 56f610c..8787b8d 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
Planet Launcher
- An interactive launcher for MCPi-Reborn
+ An interactive launcher for MCPi-Reborn.
Try Planet now »
@@ -16,6 +16,8 @@
Report Bug
|
Request Feature
+ |
+ Website (Under Development)
From ff28e12124dbfb815968dafb7ebc445092b343e0 Mon Sep 17 00:00:00 2001
From: Grimet <97934952+Grimet14@users.noreply.github.com>
Date: Fri, 22 Apr 2022 03:48:17 -0700
Subject: [PATCH 02/11] Add me to active contributers. (#22)
* Update README.md
* Update README.md
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 8787b8d..424f496 100644
--- a/README.md
+++ b/README.md
@@ -152,6 +152,7 @@ Planet is licensed under the [GNU Affero General Public License](https://www.gnu
- [Leha-code](https://github.com/leha-code) - Creator and maintainer
- [Red-exe-engineer](https://github.com/red-exe-engineer) - Active contributor
+- [Grimet14](https://github.com/grimet14) - Active contributor
- [Bigjango13](https://github.com/bigjango13) - Multiple fixes
### Translations
From b0cf644eb28be1c808571c0e880d5865819667ea Mon Sep 17 00:00:00 2001
From: Alexey Pavlov
Date: Sun, 24 Apr 2022 22:01:19 -0400
Subject: [PATCH 03/11] Add desktop entry into games category
---
planet/assets/misc/planet-launcher.desktop | 1 +
1 file changed, 1 insertion(+)
diff --git a/planet/assets/misc/planet-launcher.desktop b/planet/assets/misc/planet-launcher.desktop
index d46c9ae..d6a589f 100644
--- a/planet/assets/misc/planet-launcher.desktop
+++ b/planet/assets/misc/planet-launcher.desktop
@@ -7,3 +7,4 @@ Comment=A better launcher
GenericName=Minecraft Pi Launcher
Categories=games, minecraft
Keywords=Minecraft, MCPIL, gMCPIL, jMCPIL, Minecraft Pi, Minecraft launcher, MCPI, MCPI-Revival, mcpiscript
+Categories=Application;Game;
From 6db29308a22e16442661bc3d3a841a79137194bc Mon Sep 17 00:00:00 2001
From: leha-code
Date: Wed, 27 Apr 2022 19:37:45 -0400
Subject: [PATCH 04/11] Move NBT editor to EditPi's repo
---
README.md | 3 +-
planet/main.py | 5 +-
planet/mcpiedit.py | 363 -----------------------------------
planet/nbt_utils.py | 67 -------
requirements.txt | 1 +
scripts/package/deb/postinst | 2 +-
6 files changed, 6 insertions(+), 435 deletions(-)
delete mode 100644 planet/mcpiedit.py
delete mode 100644 planet/nbt_utils.py
diff --git a/README.md b/README.md
index 56f610c..2aa8331 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ Instead of making you type in every single field, Planet lets you write it one t
* 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.
-
+* The NBT editor is now served through [`editpi`](https://github.com/mcpiscript/editpi)
## Installation
#### Prerequisites
@@ -61,6 +61,7 @@ Instead of making you type in every single field, Planet lets you write it one t
* `darkdetect`
* PyNBT
* `click`
+* EditPi
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
diff --git a/planet/main.py b/planet/main.py
index f2a9bed..2be8759 100644
--- a/planet/main.py
+++ b/planet/main.py
@@ -56,8 +56,6 @@ _ = gettext.translation(
# Local imports
import launcher
from splashes import SPLASHES
-import web
-import mcpiedit
# PyQt5 imports
from PyQt5.QtCore import *
@@ -66,7 +64,6 @@ from PyQt5.QtGui import *
from PyQt5.QtWebKit import *
from PyQt5.QtWebKitWidgets import *
-from qtwidgets import AnimatedToggle
# Additional imports
import qdarktheme # Dark style for PyQt5
@@ -74,6 +71,8 @@ import pypresence # Discord RPC
from PIL import Image
import darkdetect
+import editpi as mcpiedit
+
# Load dark theme
dark_stylesheet = qdarktheme.load_stylesheet()
diff --git a/planet/mcpiedit.py b/planet/mcpiedit.py
deleted file mode 100644
index ad7ff12..0000000
--- a/planet/mcpiedit.py
+++ /dev/null
@@ -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 .
-
-
-"""
-
-# 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()
diff --git a/planet/nbt_utils.py b/planet/nbt_utils.py
deleted file mode 100644
index 4b61b53..0000000
--- a/planet/nbt_utils.py
+++ /dev/null
@@ -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)
diff --git a/requirements.txt b/requirements.txt
index c83f11c..d842460 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -5,3 +5,4 @@ pillow
qtwidgets
darkdetect
pynbt
+editpi
diff --git a/scripts/package/deb/postinst b/scripts/package/deb/postinst
index 312d2f6..cfc43f3 100755
--- a/scripts/package/deb/postinst
+++ b/scripts/package/deb/postinst
@@ -1,4 +1,4 @@
-pip3 install pyqtdarktheme pypresence pillow darkdetect qtwidgets pynbt
+pip3 install pyqtdarktheme pypresence pillow darkdetect qtwidgets pynbt editpi
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
From 739552017b732c6c3febff74fd27468d00f45667 Mon Sep 17 00:00:00 2001
From: leha-code
Date: Wed, 27 Apr 2022 19:43:42 -0400
Subject: [PATCH 05/11] Add polish translation
---
README.md | 1 +
.../translations/pl/LC_MESSAGES/main.mo | Bin 0 -> 3246 bytes
.../translations/pl/LC_MESSAGES/main.po | 165 ++++++++++++++++++
3 files changed, 166 insertions(+)
create mode 100644 planet/assets/translations/pl/LC_MESSAGES/main.mo
create mode 100644 planet/assets/translations/pl/LC_MESSAGES/main.po
diff --git a/README.md b/README.md
index 8d8be25..c5732d7 100644
--- a/README.md
+++ b/README.md
@@ -159,6 +159,7 @@ Planet is licensed under the [GNU Affero General Public License](https://www.gnu
### Translations
- Spanish translation by [BasedSkeleton](https://github.com/basedskeleton)
- Russian translation by [Leha-code](https://github.com/leha-code)
+- Polish translation by karolxyz8
### Additional Credits
- Heart, Planet, Pi, Steve and Portal icons by LEHAtupointow.
diff --git a/planet/assets/translations/pl/LC_MESSAGES/main.mo b/planet/assets/translations/pl/LC_MESSAGES/main.mo
new file mode 100644
index 0000000000000000000000000000000000000000..407ba7276ef990def86efaf8769a1e90f8fa5091
GIT binary patch
literal 3246
zcmb`JO^h7H6~`-y2{3#G0>l9Vk4
z_4VGX_g=l-&+a?)nm{{(=Mg-sKM>+182u10wBP+mh(Ca5z$W+?@G4zgWufjTlo*`v1Zv_Sa)@%2BWnvK_C2KL_6ep+Z~-e+qsAJ_!B;
zWIg{W_+OCE^A*VJ?kr9GL?GL-1oFHF+0H8<`{_jxrij0StoLn@{qzB7z>h%QcO1^(
zb&KHr;4=6CxCQcj4?GNJ;G^KHAlvsYD8Uaww)CR3Xj(b@I?@*
zmHQmXeZcmzPaem^Ikmqbt;ElY0k)52<#`1j!SfKFIXv7ro@^uA&1Yphrj2dm#%JZm
zHvb9_=NvbY7q_OfzvJ5uHEBrCM0qr3mJB&QPPm&I9W@IxCi
zHQ|nOVr55~u8M3|tmbAHpoz9=PhC-A>e*JYuB69_6Y-QXFh3H%*KIYE*Br#wd4evl
zO*avRqBae+-=S6{jqA>uEl&ZO<76Mt!LczpMteQKM;BI<#S+%sdXgD=E_qEY*
zk{&5OUua#MF0@w4g!9BP@}Vp)CdwH(Q20Q9FZLvHJIuZ)lm-0NLv(^>J9rjn%tIUJ
z`4dD%_Lf@D1Q*n0&6B~Z^r}v^O05=D7J}MusZyygR7x8%@xhjpCPDUCS0{{^Zi-78
zY$-XYQ_Ds=*(sfCo?DwKs+KFI75D|Y7i?uQ1bcPG&qKd9rzqT!4nb>N+*%J7XX{u=
zN4a3lgtm>-)oF2C`_km1c-0QhW_60QF5CxU74BTz}5Oq_R<#==VaNmHrs4I6K5)gCblw;0-alX-Uvr
zt<%YBWnu9*`}R+x!UFaUuj9(pX#lsEV|&ARE~vH_Pu}^b)<#LJj50!vi`CFr#41$D
zh|(lAyH|Iw?JvoaWIyal>Z!z&(aN@mPKGivvMkPj+kU_M2KDn&jNpX5-8WE?C9XVb
z;kU_p8uHcnO*RO{>;#RktEpLeRklO9d+p}Zycy#Ug?HE)YFO%1zF1I#`zRP;E(ljaBX%AlVl5NydTy$x;V+Xid
zmPUlCc~jxW`tMr0vGjW>-cLE%6PL1Wt=tIFK6uI#)c2ph=Q4`zwv*$R;J9+>X}lv%
zBP0-)Z@4<2m~76=xRH?>U(et#>_URrn4?O0El+!M-(1GUYR2U|A(vNkh-IJUr5tBH
zkRN;Y%Axeq?R9T7|AvY2OENL4YiY7AkXw7nF)jS(p=w~q*KylMvTw&PhocNGJW%^vNTMFxgMV|*%h6C$7dK^u
Y1cTGrZE7!zs0SH&WYT@v3m=rl*Qc(9b^rhX
literal 0
HcmV?d00001
diff --git a/planet/assets/translations/pl/LC_MESSAGES/main.po b/planet/assets/translations/pl/LC_MESSAGES/main.po
new file mode 100644
index 0000000..706ec8d
--- /dev/null
+++ b/planet/assets/translations/pl/LC_MESSAGES/main.po
@@ -0,0 +1,165 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: planet-launcher\n"
+"POT-Creation-Date: 2022-04-15 16:48-0400\n"
+"PO-Revision-Date: 2022-04-27 00:40\n"
+"Last-Translator: \n"
+"Language-Team: Polish\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==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
+"X-Crowdin-Project: planet-launcher\n"
+"X-Crowdin-Project-ID: 510486\n"
+"X-Crowdin-Language: pl\n"
+"X-Crowdin-File: main.po\n"
+"X-Crowdin-File-ID: 2\n"
+"Language: pl_PL\n"
+
+#: main.py:134
+msgid "Please select the executable you downloaded.\n"
+"If you installed a DEB, please select the \"Link\" option"
+msgstr "Wybierz plik wykonywalny, który pobrałeś.\n"
+"Jeśli zainstalowałeś plik DEB, należy wybrać opcję \"Linkuj\""
+
+#: main.py:138 main.py:182
+msgid "Select executable"
+msgstr "Wybierz plik wykonywalny"
+
+#: main.py:143
+msgid "Link /usr/bin/minecraft-pi-reborn-client"
+msgstr "Linkuj /usr/bin/minecraft-pi-reborn-client"
+
+#: main.py:148
+msgid "Link flatpak"
+msgstr "Linkuj flatpak"
+
+#: main.py:227
+msgid "Launched with Planet Launcher"
+msgstr "Uruchomiono z Planet Launcher"
+
+#: main.py:228
+msgid "Minecraft Pi Edition: Reborn"
+msgstr "Minecraft Pi Edition: Reborn"
+
+#: main.py:238
+msgid "Unable to initalize Discord RPC. Skipping."
+msgstr "Nie można zakończyć Discord RPC. Pomijanie."
+
+#: main.py:269
+msgid "Planet"
+msgstr "Planet"
+
+#: main.py:283
+msgid "Play"
+msgstr "Graj"
+
+#: main.py:288
+msgid "Features"
+msgstr "Funkcje"
+
+#: main.py:293
+msgid "Servers"
+msgstr "Serwery"
+
+#: main.py:299
+msgid "Settings"
+msgstr "Ustawienia"
+
+#: main.py:359
+msgid "Banana Launcher"
+msgstr "Banana Launcher"
+
+#: main.py:363
+msgid "Pluto Launcher"
+msgstr "Pluto Launcher"
+
+#: main.py:365
+msgid "Planet Launcher"
+msgstr "Planet Launcher"
+
+#: main.py:378
+msgid "Username"
+msgstr "Nazwa gracza"
+
+#: main.py:381
+msgid "StevePi"
+msgstr "StevePi"
+
+#: main.py:384
+msgid "Render Distance"
+msgstr "Dystans renderowania"
+
+#: main.py:391
+msgid "Profile"
+msgstr "Profil"
+
+#: main.py:406
+msgid "Hide Launcher"
+msgstr "Ukryj Launcher"
+
+#: main.py:535
+msgid "Servers are stored in the format of IP: Port"
+msgstr "Serwery są przechowywane w formacie IP: Port"
+
+#: main.py:588
+msgid "Set the skin"
+msgstr "Wybierz własny awatar"
+
+#: main.py:590
+msgid "Select Skin"
+msgstr "Wybierz awatar"
+
+#: main.py:593
+msgid "Reset config"
+msgstr "Resetuj konfigurację"
+
+#: main.py:595
+msgid "Delete config"
+msgstr "Usuń konfigurację"
+
+#: main.py:598
+msgid "Delete executable"
+msgstr "Usuń plik wykonywalny"
+
+#: main.py:600
+msgid "Delete"
+msgstr "Usuń"
+
+#: main.py:603
+msgid "Import settings"
+msgstr "Importuj ustawienia"
+
+#: main.py:623
+msgid "General"
+msgstr "Ogólne"
+
+#: main.py:624
+msgid "Changelog"
+msgstr "Spis treści aktualizacji"
+
+#: main.py:625
+msgid "MCPIEdit"
+msgstr "MCPIEdit"
+
+#: main.py:705
+msgid "Select skin file"
+msgstr "Wybierz plik własnego awataru"
+
+#: main.py:719 main.py:736
+msgid "Are you sure you want to reset?"
+msgstr "Jesteś pewien, że chcesz resetować?"
+
+#: main.py:721
+msgid "Are you sure you want to delete the config? This action is unrecoverable."
+msgstr "Na pewno chcesz usunąć tę konfigurację? Ta operacja jest nieodwracalna."
+
+#: main.py:738
+msgid "Are you sure you want to delete the AppImage? This action is unrecoverable."
+msgstr "Czy na pewno chcesz usunąć AppImage? Ta akcja jest nieodwracalna."
+
+#: main.py:812
+msgid "Using /usr/bin as an executable."
+msgstr "Używanie /usr/bin jako pliku wykonywalnego."
+
From 87e6e89a5e3cbbb3718d1bacf56dde31b8f95057 Mon Sep 17 00:00:00 2001
From: leha-code
Date: Wed, 27 Apr 2022 20:50:55 -0400
Subject: [PATCH 06/11] v1.2.0
---
planet/main.py | 36 +++++-
planet/textures.py | 217 -----------------------------------
planet/weaving.py | 137 ----------------------
scripts/package/deb/control | 4 +-
scripts/package/deb/postinst | 2 +-
5 files changed, 33 insertions(+), 363 deletions(-)
delete mode 100755 planet/textures.py
delete mode 100644 planet/weaving.py
diff --git a/planet/main.py b/planet/main.py
index 2be8759..47000fe 100644
--- a/planet/main.py
+++ b/planet/main.py
@@ -72,6 +72,7 @@ from PIL import Image
import darkdetect
import editpi as mcpiedit
+import mcpit
# Load dark theme
dark_stylesheet = qdarktheme.load_stylesheet()
@@ -148,15 +149,15 @@ class ConfigPluto(QDialog):
) # 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
+ #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)
+ #layout.addWidget(self.flatpak_btn)
self.setLayout(layout)
@@ -613,9 +614,16 @@ class Planet(QMainWindow):
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)
+
+ mcpit_install_label = QLabel(_("Install texture pack"))
+
+ self.import_mcpit_button = QPushButton(_("Select file"))
+ self.import_mcpit_button.clicked.connect(self.install_texture_pack)
+
+ mcpit_delete_label = QLabel(_("Delete texture pack"))
+
+ self.delete_mcpit_button = QPushButton(_("Delete"))
+ self.delete_mcpit_button.clicked.connect(mcpit.erase_pack)
layout.addWidget(skin_label, 0, 0)
layout.addWidget(self.skin_button, 0, 1)
@@ -625,6 +633,12 @@ class Planet(QMainWindow):
layout.addWidget(appimage_label, 2, 0)
layout.addWidget(self.delete_appimage_button, 2, 1)
+
+ layout.addWidget(mcpit_install_label)
+ layout.addWidget(self.import_mcpit_button, 3, 1)
+
+ layout.addWidget(mcpit_delete_label)
+ layout.addWidget(self.delete_mcpit_button, 4, 1)
widget.setLayout(layout)
@@ -727,6 +741,16 @@ class Planet(QMainWindow):
Image.open(filename[0]).crop((0, 0, 64, 32)).convert("RGBA").save(
f"/home/{USER}/.minecraft-pi/overrides/images/mob/char.png"
)
+
+ def install_texture_pack(self):
+ pack = QFileDialog.getOpenFileName(
+ self, _("Select pack file"), "/", "mcpit files (*.mcpit);;PePack files (*.zip *.pepack)"
+ )
+ if pack[1] == "mcpit files (*.mcpit)":
+ mcpit.mcpit_install(pack[0], False)
+ else:
+ mcpit.pepack_install(pack[0])
+
def delete_config(self):
dialog = QMessageBox()
diff --git a/planet/textures.py b/planet/textures.py
deleted file mode 100755
index 406e454..0000000
--- a/planet/textures.py
+++ /dev/null
@@ -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 .
-
-
-"""
-
-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()
diff --git a/planet/weaving.py b/planet/weaving.py
deleted file mode 100644
index a8feec6..0000000
--- a/planet/weaving.py
+++ /dev/null
@@ -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 .
-"""
-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()
diff --git a/scripts/package/deb/control b/scripts/package/deb/control
index 73b6146..3a859a8 100755
--- a/scripts/package/deb/control
+++ b/scripts/package/deb/control
@@ -1,11 +1,11 @@
Package: planet-launcher
-Version: 1.2.0pre1
+Version: 1.2.0
Architecture: all
Maintainer: mcpiscript
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
+Provides: pi-nbt, mcpiedit, mcpit, editpi
Section: games
Priority: optional
Homepage: https://github.com/mcpiscript/Planet
diff --git a/scripts/package/deb/postinst b/scripts/package/deb/postinst
index cfc43f3..717b159 100755
--- a/scripts/package/deb/postinst
+++ b/scripts/package/deb/postinst
@@ -1,4 +1,4 @@
-pip3 install pyqtdarktheme pypresence pillow darkdetect qtwidgets pynbt editpi
+pip3 install pyqtdarktheme pypresence pillow darkdetect qtwidgets editpi mcpit
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
From c2d2a9a1a5d2da4b67448f42293444d93e286714 Mon Sep 17 00:00:00 2001
From: paradox89 <72633854+89paradox@users.noreply.github.com>
Date: Wed, 27 Apr 2022 20:01:09 -0500
Subject: [PATCH 07/11] open file in write mode (#24)
Open server list in write mode.
---
planet/main.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/planet/main.py b/planet/main.py
index 47000fe..0566aec 100644
--- a/planet/main.py
+++ b/planet/main.py
@@ -533,7 +533,7 @@ class Planet(QMainWindow):
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:
+ with open(f"/home/{USER}/.minecraft-pi/servers.txt", 'w') as servers:
servers.write("pbptanarchy.tk")
self.serversedit.textChanged.connect(
From 2431e2c081813dc4039e3c99e6372a6110ea74af Mon Sep 17 00:00:00 2001
From: paradox89 <72633854+89paradox@users.noreply.github.com>
Date: Wed, 27 Apr 2022 21:17:33 -0500
Subject: [PATCH 08/11] Many bug fixes (#25)
* open file in write mode
Open server list in write mode.
* various bug fixes
- raise ValueError rather then Exception.
- "Invalid render distance: (distance)" instead of "Invalid render distance".
- open server list in read-only mode.
---
planet/launcher.py | 2 +-
planet/main.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/planet/launcher.py b/planet/launcher.py
index 135a17a..e20218e 100644
--- a/planet/launcher.py
+++ b/planet/launcher.py
@@ -58,7 +58,7 @@ def set_username(env, username: str = "StevePi"):
def set_render_distance(env, distance: str = "SHORT"):
if distance.upper() not in ["TINY", "SHORT", "NORMAL", "FAR"]:
- raise Exception("Invalid render distance")
+ raise ValueError("Invalid render distance: {0}".format(distance))
else:
env["MCPI_RENDER_DISTANCE"] = distance
return env
diff --git a/planet/main.py b/planet/main.py
index 0566aec..cf070e6 100644
--- a/planet/main.py
+++ b/planet/main.py
@@ -539,7 +539,7 @@ class Planet(QMainWindow):
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:
+ with open(f"/home/{USER}/.minecraft-pi/servers.txt", 'r') as servers:
self.serversedit.setPlainText(
servers.read()
) # Set the text of the text editing area
From 46bc43d39e66d6d6669ade0e9277a8ef7cefecd2 Mon Sep 17 00:00:00 2001
From: "Alexey \"LEHAtupointow\" Pavlov"
Date: Thu, 28 Apr 2022 12:53:06 -0800
Subject: [PATCH 09/11] Update roadmap
---
README.md | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index c5732d7..c0d9e5b 100644
--- a/README.md
+++ b/README.md
@@ -47,9 +47,8 @@ Instead of making you type in every single field, Planet lets you write it one t
* 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.
* The NBT editor is now served through [`editpi`](https://github.com/mcpiscript/editpi)
+* Texture packs are installed through [`mcpit`](https://github.com/mcpiscript/mcpit)
## Installation
#### Prerequisites
@@ -61,9 +60,8 @@ Instead of making you type in every single field, Planet lets you write it one t
* Pillow
* `qtwidgets`
* `darkdetect`
-* PyNBT
-* `click`
* EditPi
+* `mcpit`
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
@@ -101,6 +99,7 @@ Use [our PPA](https://github.com/mcpiscript/ppa)
| Easy GUI navigation | Yes | Yes | Yes | No | Yes |
| Skin support | Yes | No | No | No | No |
| Built-in NBT editor | Yes | No | No | No | No |
+| Texure pack support | 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
@@ -114,11 +113,10 @@ Use [our PPA](https://github.com/mcpiscript/ppa)
- [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)
+- [x] Texture pack support
- [ ] Mods
- [ ] Chat logging
- [ ] MarketPi
-- [ ] World generation from seed
## Contributing
From ec3df527aa0e14aa03da28b2eb8e186320cf7a68 Mon Sep 17 00:00:00 2001
From: LEHAtupointow
Date: Sun, 26 Jun 2022 10:48:16 -0800
Subject: [PATCH 10/11] Fallback to English translation if the current locale
isn't found.
---
planet/main.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/planet/main.py b/planet/main.py
index cf070e6..80936d6 100644
--- a/planet/main.py
+++ b/planet/main.py
@@ -49,9 +49,14 @@ 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
+try:
+ _ = gettext.translation(
+ "main", localedir=str(absolute_path) + "/assets/translations/", languages=[LOCALE]
+ ).gettext
+except:
+ _ = gettext.translation(
+ "main", localedir=str(absolute_path) + "/assets/translations/", languages=["en"]
+ ).gettext
# Local imports
import launcher
From 40668cf0359326f802871622d4dc46e44f65a2d0 Mon Sep 17 00:00:00 2001
From: Alexey Pavlov
Date: Mon, 18 Jul 2022 23:29:03 -0400
Subject: [PATCH 11/11] add g4o2
---
README.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c0d9e5b..37c38dc 100644
--- a/README.md
+++ b/README.md
@@ -51,10 +51,10 @@ Instead of making you type in every single field, Planet lets you write it one t
* Texture packs are installed through [`mcpit`](https://github.com/mcpiscript/mcpit)
## Installation
-#### Prerequisites
+i#### Prerequisites
* [Minecraft Pi: Reborn](https://jenkins.thebrokenrail.com) AppImage or DEB install
* PyQt5
-* Python 3
+*i Python 3
* `pypresence`
* `qtdarktheme`
* Pillow
@@ -152,6 +152,7 @@ Planet is licensed under the [GNU Affero General Public License](https://www.gnu
- [Leha-code](https://github.com/leha-code) - Creator and maintainer
- [Red-exe-engineer](https://github.com/red-exe-engineer) - Active contributor
- [Grimet14](https://github.com/grimet14) - Active contributor
+- [g4o2](https://github.com/Maxhu787) - Making the website look better
- [Bigjango13](https://github.com/bigjango13) - Multiple fixes
### Translations