Skip to content

Instantly share code, notes, and snippets.

View Podshot's full-sized avatar

Ben Gothard Podshot

  • Rose-Hulman Institute of Technology
  • Terre Haute, IN
View GitHub Profile
from __future__ import annotations
from enum import IntFlag
from typing import List
from collections.abc import Mapping, MutableSequence
from pprint import pprint
from dataclasses import dataclass
from amulet_map_editor.programs.edit.plugins.api.simple_operation_panel import (
SimpleOperationPanel,
)
import subprocess
import os
import sys
import threading
import glob
import urllib.request
from __future__ import annotations
from typing import Dict, Union
from os.path import (
join as opjoin,
splitext as opsplit,
dirname as opdir,
isdir,
normpath,
from __future__ import annotations
from typing import TYPE_CHECKING, Tuple, Union
import numpy as np
import wx
from amulet_map_editor.amulet_wx.simple import SimpleDialog
from .construction import Construction, ConstructionSection
>>> import PyMCTranslate
Traceback (most recent call last):
File "C:\Users\gotharbg\Documents\Python Projects\Amulet-Core\venv\lib\site-packages\pymctranslate-0.0.0-py3.7.egg\PyMCTranslate\py3\translation_manager.py", line 7, in <module>
from amulet.api.block import Block
File "C:\Program Files\JetBrains\PyCharm 2019.2.1\plugins\python\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\gotharbg\Documents\Python Projects\Amulet-Core\amulet\__init__.py", line 2, in <module>
from .world_interface import *
File "C:\Program Files\JetBrains\PyCharm 2019.2.1\plugins\python\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)

Due to the changes in our repository names, if you've downloaded our source code through Git you will have to update your corresponding local repositories to relfect these changes.

  1. Navigate to the directory where the Amulet source code it (usually named Amulet-Map-Editor)
  2. Run the following command in a terminal/command shell: git remotes -v 1. If the output URLs start with https:// then run this command: git remote set-url origin https://github.com/Amulet-Team/Amulet-Core.git 2. If the output Urls start with git@ then run this command: git remote set-url origin [email protected]:Amulet-Team/Amulet-Core.git
  3. Verify that the commands completed successfully by running git remotes -v again and checking that the new URLs have replaced the old ones
  4. Rename the parent directory (Amulet-Map-Editor) to Amulet-Core
from __future__ import annotations
import numpy as np
'''
Known caveats:
- Calling any numpy function that doesn't modify the array will still trigger the _changed flag to True
'''
class DummyChunk:
def __init__(self):
@Podshot
Podshot / gen_version.py
Created March 16, 2019 15:14
Utility script for generating version.py files for the Amulet Map Editor
from __future__ import annotations
from typing import Tuple
VERSION_PY_CONTENT = """
VERSION_NUMBER = ({ver_major}, {ver_minor}, {ver_patch})
VERSION_INT = {ver_int}
VERSION_STAGE = "{ver_stage}"
VERSION_STRING = f"{{'.'.join((str(n) for n in VERSION_NUMBER))}}-{{VERSION_STAGE}}"
@Podshot
Podshot / 1.12.json
Last active April 17, 2018 01:43
block specification
{
"version": "1.12",
"map_to": "1.13",
"blocks": {
"air": {
"id": 0,
"/* When state is omitted (see anvil for inclusion of state), default state of 1.13 definitions are used */": "",
"map_to": "air"
},
"stone": {
@Podshot
Podshot / chunk_reader.py
Last active September 20, 2023 21:04
Proof of Concept for converting BlockState Long IDs to Palette indices. Critical for loading 1.13 Minecraft Java Edition worlds. Run with the command: "python proof_of_concept.py" to use. If you use any snippet of code from this, please give appropriate credit to the respective authors.
"""
Standalone chunk loader/reader from pymclevel with all the fancy repair/OOP stuff removed
"""
from __future__ import unicode_literals, print_function
import os
try:
from pymclevel import nbt
except ImportError:
import nbt
import struct