This repository has been archived by the owner on Feb 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
381 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Python stuff | ||
|
||
__pycache__/ | ||
build/ | ||
*.pyc |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> | ||
<mime-type type="application/x-mcpimod"> | ||
<comment>Minecraft Pi Mod</comment> | ||
<icon name="application-x-mcpimod" /> | ||
<glob pattern="*.mcpi" /> | ||
</mime-type> | ||
</mime-info> |
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions
6
install_files/mcpil.desktop → .install_files/tk.mcpi.mcpil.desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
[Desktop Entry] | ||
Name=MCPIL | ||
Comment=Minecraft Pi Launcher | ||
Exec=$(EXECUTABLE_PATH) | ||
Icon=$(ICON_PATH) | ||
Exec=$(EXECUTABLE_PATH) %f | ||
Icon=mcpil | ||
Terminal=false | ||
Type=Application | ||
Categories=Application;Game; | ||
MimeType=application/x-mcpimod | ||
StartupNotify=true | ||
GenericName=Minecraft Pi Launcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# __init__.py | ||
# | ||
# Copyright 2020 Alvarito050506 <donfrutosgomez@gmail.com> | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; version 2 of the License. | ||
# | ||
# 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 General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
# MA 02110-1301, USA. | ||
# | ||
# | ||
|
||
import sys | ||
import psutil | ||
from os import environ | ||
|
||
def get_user_name(): | ||
return environ.get("MCPIL_USERNAME"); | ||
|
||
def get_world_name(): | ||
mcpi_process = psutil.Process(int(environ.get("MCPIL_PID"))); | ||
return mcpi_process.open_files()[-1].path.split("/")[-2]; | ||
|
||
def get_game_mode(): | ||
world_name = get_world_name(); | ||
world_file = open("/root/.minecraft/games/com.mojang/minecraftWorlds/" + world_name + "/level.dat", "rb"); | ||
world_file.seek(0x16); | ||
game_mode = int.from_bytes(world_file.read(1), "little"); | ||
world_file.close(); | ||
return game_mode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# setup.py | ||
# | ||
# Copyright 2020 Alvarito050506 <donfrutosgomez@gmail.com> | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; version 2 of the License. | ||
# | ||
# 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 General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
# MA 02110-1301, USA. | ||
# | ||
# | ||
|
||
from distutils.core import setup | ||
from os import chdir, path | ||
|
||
chdir(path.dirname(__file__)); | ||
|
||
setup( | ||
name="mcpil", | ||
version="v0.1.1", | ||
description="MCPI API extensions", | ||
author="Alvarito050506", | ||
packages=["mcpil"], | ||
classifiers=[ | ||
"Development Status :: 3 - Alpha", | ||
"Environment :: Console", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)" | ||
] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.