Skip to content

Instantly share code, notes, and snippets.

View EvilSupahFly's full-sized avatar
🧙‍♂️
Trying to make Flatpak and Python play nice with Amulet

EvilSupahFly EvilSupahFly

🧙‍♂️
Trying to make Flatpak and Python play nice with Amulet
View GitHub Profile
import os
import json
import copy
from typing import Union, Iterable, Iterator, Optional
from PIL import Image
import numpy
import glob
import itertools
import logging
@EvilSupahFly
EvilSupahFly / download_resources.py
Created March 2, 2025 03:26
download_resources.py
import os
import shutil
import zipfile
import json
from urllib.request import urlopen, Request
import io
from typing import Generator, TypeVar, Any, Optional
import logging
from minecraft_model_reader.api.resource_pack import JavaResourcePack
@EvilSupahFly
EvilSupahFly / resource_pack_manager.py
Created March 2, 2025 03:23
resource_pack_manager.py
import os
import json
import copy
from typing import Union, Iterable, Iterator, Optional
from PIL import Image
import numpy
import glob
import itertools
import logging
@EvilSupahFly
EvilSupahFly / amulet_PIP_terminal.log
Last active February 28, 2025 12:05
Modified Amulet run log from PIP
2025-02-28 06:27:42,870 - amulet.level.load - INFO - Loading level /home/seann/.minecraft/saves/Amplified_1_21_1
2025-02-28 06:27:43,190 - OpenGL.acceleratesupport - INFO - No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
2025-02-28 06:27:45,516 - minecraft_model_reader.api.resource_pack.java.download_resources - INFO - Downloading java launcher manifest file.
2025-02-28 06:27:45,638 - minecraft_model_reader.api.resource_pack.java.download_resources - INFO - Finished downloading java launcher manifest file.
2025-02-28 06:27:45,662 - minecraft_model_reader.api.resource_pack.java.resource_pack_manager - INFO - Initializing ResourceManager with 3 resource pack(s).
2025-02-28 06:27:45,663 - minecraft_model_reader.api.resource_pack.java.resource_pack_manager - TRACE - __init__(): Water/lava textures may not have been loaded properly. Water: False, Lava: False
2025-02-28 06:27:46,116 - minecraft_model_reader.api.resource_pack.java.resource_pack_manager - TRACE - textures(): Missing water/lava
@EvilSupahFly
EvilSupahFly / debug_terminal.log
Last active March 1, 2025 19:44
Amulet Flatpak Output - Debug
2025-03-01 14:42:15,353 - amulet.level.load - INFO - Loading level /home/seann/.minecraft/saves/Amplified_1_21_1
2025-03-01 14:42:15,471 - OpenGL.acceleratesupport - INFO - No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
2025-03-01 14:42:18,576 - minecraft_model_reader.api.resource_pack.java.download_resources - INFO - Downloading java launcher manifest file.
2025-03-01 14:42:18,780 - minecraft_model_reader.api.resource_pack.java.download_resources - INFO - Finished downloading java launcher manifest file.
2025-03-01 14:42:18,813 - minecraft_model_reader.api.resource_pack.java.resource_pack_manager - TRACE - __init__: Iterable self._packs = [JavaResourcePack(/app/lib/python3.12/site-packages/amulet_map_editor/programs/edit/amulet_resource_pack/java), JavaResourcePack(/home/seann/.var/app/io.github.evilsupahfly.amulet_flatpak/cache/AmuletMapEditor/resource_packs/java/vanilla), JavaResourcePack(/app/lib/python3.12/site-packages/minecraft_model_reader/api/resource_pack/java/java_vanilla_f
@EvilSupahFly
EvilSupahFly / pip-gen.yaml
Created February 16, 2025 19:19
pip-gen.yaml
# Generated with flatpak-pip-generator --requirements-file=requirements.txt --yaml --output=pip-gen
build-commands: []
buildsystem: simple
modules:
- name: python3-versioneer
buildsystem: simple
build-options:
network: true # This allows internet access for this module
build-commands:
- pip3 install --verbose --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST}
@EvilSupahFly
EvilSupahFly / resource_pack_manager.py
Created February 16, 2025 19:15
resource_pack_manager.py
import os
import json
import copy
from typing import Union, Iterable, Iterator, Optional
from PIL import Image
import numpy
import glob
import itertools
import logging
#### Generated by do_this.sh >>>
id: io.github.evilsupahfly.amulet_flatpak
#name: Amulet Map Editor
#version: 0.10.39
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk
command: launch-amulet
finish-args:
@EvilSupahFly
EvilSupahFly / install_v2.sh
Created February 11, 2025 03:26
install_v2.sh
#!/bin/bash
#
# This is nearing the final evolution of my Game Installer Script. Command-line parameters are now optional,
# I've added colour to the output, the logic has been tweaked out a bit so now the script will check for WINE,
# and attempt to install it, should it not be found, and I've also added commentary to each section to explain
# what it all does and added extensive error handling. As far as features go, I was thinking of making both the
# MSVC redist and Vulkan functions which could be called independently of actually performing an install with
# a command-line parameter, but I don't really see the need at this point.
IFS=$'\n'
@EvilSupahFly
EvilSupahFly / install_v7.sh
Last active February 12, 2025 18:41
Install Script (version 7)
#!/usr/bin/env bash
# Function to check if colour output is supported (Canadian spelling!)
supports_colour() {
if [ -t 1 ] && command -v tput &> /dev/null; then
local colours
colours=$(tput colors 2>/dev/null)
if [[ -n "$colours" && "$colours" -ge 8 ]]; then
return 0 # Colour support detected
fi