format with black

This commit is contained in:
Alexey Pavlov 2022-04-13 22:10:14 -04:00
parent 01ec43a095
commit af4f9ae95e
4 changed files with 36 additions and 15 deletions

View File

@ -46,6 +46,9 @@ Planet is a **maintained, feature-rich and a flexible** launcher. It is supporte
* `pypresence`
* `pyqtdarkmode`
* Pillow
* `qtwidgets`
* `darkdetect`
* PyNBT
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
@ -72,19 +75,32 @@ Use [our PPA](https://github.com/mcpiscript/ppa)
| 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 | No | Yes | Yes | 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
[*] AppImage support
[*] Skin support
[*] NBT editor
[ ] Texture packs
[ ] Mods
[ ] Chat logging
[ ] MarketPi
## Credits
- [Leha-code](https://github.com/leha-code) - Creator and maintainer
- [Red-exe-engineer](https://github.com/red-exe-engineer) - Active contributor

View File

@ -190,9 +190,7 @@ class ConfigPluto(QDialog):
) # 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
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

View File

@ -103,7 +103,9 @@ class EditorTab(QWidget):
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.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
@ -270,12 +272,17 @@ class EditorTab(QWidget):
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())
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):

View File

@ -53,15 +53,15 @@ 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)
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)
with open(filename + "_temp.dat", "wb") as writefile:
nbt.save(io=writefile, little_endian=True)
if header:
add_header(filename)