repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
MCEdit-Unified | MCEdit-Unified-master/leveleditor.py | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 134,511 | 37.355289 | 195 | py |
MCEdit-Unified | MCEdit-Unified-master/mceutils.py | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 19,496 | 28.143498 | 159 | py |
MCEdit-Unified | MCEdit-Unified-master/compass.py | """
compass
"""
import logging
from OpenGL import GL
from drawable import Drawable
from glutils import gl
from mceutils import loadPNGTexture
from config import config
import os
log = logging.getLogger(__name__)
def makeQuad(minx, miny, width, height):
return [minx, miny, minx + width, miny, minx + width, mi... | 1,743 | 27.590164 | 103 | py |
MCEdit-Unified | MCEdit-Unified-master/mcplatform.py | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 50,148 | 38.394344 | 203 | py |
MCEdit-Unified | MCEdit-Unified-master/config.py | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 22,623 | 35.025478 | 139 | py |
MCEdit-Unified | MCEdit-Unified-master/release.py | import os.path
import directories
import json
import urllib2
import sys
from sys import platform as _platform
VERSION = None
TAG = None
DEV = None
def build_version_tag_dev():
'''
Get and return the name of the current version, the stage of development
MCEdit-Unified is in, and if the program is in deve... | 2,996 | 31.225806 | 177 | py |
MCEdit-Unified | MCEdit-Unified-master/drawable.py | """
${NAME}
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
log = logging.getLogger(__name__)
from OpenGL import GL
class Drawable(object):
def __init__(self):
super(Drawable, self).__init__()
self._displayList = None
self.invalid... | 1,390 | 20.075758 | 82 | py |
MCEdit-Unified | MCEdit-Unified-master/mcedit.py | # !/usr/bin/env python2.7
# -*- coding: utf_8 -*-
# import resource_packs # not the right place, moving it a bit further
#-# Modified by D.C.-G. for translation purpose
#.# Marks the layout modifications. -- D.C.-G.
from __future__ import unicode_literals
"""
mcedit.py
Startup, main menu, keyboard configuration, auto... | 42,368 | 37.693151 | 457 | py |
MCEdit-Unified | MCEdit-Unified-master/directories.py | # -*- coding: utf-8 -*-
"""Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE... | 16,057 | 34.448124 | 124 | py |
MCEdit-Unified | MCEdit-Unified-master/splash.py | #! /usr/bin/env python
# Taken from http://www.pygame.org/project-Splash+screen-1186-.html by Rock Achu (rockhachu2)
# and tweaked ;)
import os
import directories
if os.sys.platform == 'linux2':
os.sys.path.insert(1, os.path.expanduser('~/.local/lib/python2.7/site-packages'))
os.sys.path.insert(1, os.path.abspa... | 3,879 | 35.603774 | 150 | py |
MCEdit-Unified | MCEdit-Unified-master/ftp_client.py | import ftputil
import os
import shutil
from ftputil.error import PermanentError
class CouldNotFindPropertiesException(Exception):
"""
An Exception that is raised when the 'server.properties' file could not be found at the default directory of the FTP Server
"""
pass
class CouldNotFindWorldFolderExcept... | 7,028 | 42.122699 | 215 | py |
MCEdit-Unified | MCEdit-Unified-master/waypoints.py | from pymclevel import nbt
import os
import logging
import shutil
log = logging.getLogger()
class WaypointManager:
'''
Class for handling the API to load and save waypoints
'''
def __init__(self, worldDir=None, editor=None):
self.worldDirectory = worldDir
self.waypoints = {}
s... | 7,249 | 46.385621 | 207 | py |
MCEdit-Unified | MCEdit-Unified-master/mclangres.py | # -*- coding: utf_8 -*-
#
# mclangres.py
#
# Collect the Minecraft internal translations.
#
"""
Uses `.minecraft/assets/indexes/[version].json`. The version is the highest
found by default.
"""
import re
import os
import codecs
from distutils.version import LooseVersion
from directories import getMinecraftLauncherDire... | 13,861 | 44.006494 | 170 | py |
MCEdit-Unified | MCEdit-Unified-master/raycaster.py | import math
"""
This function will produce a generator that will give out the blocks
visited by a raycast in sequence. It is up to the user to terminate the generator.
First described here by John Amanatides
http://www.cse.yorku.ca/~amana/research/grid.pdf
Implementation in javascript by Kevin Reid:
https://gamedev.s... | 4,181 | 25.468354 | 95 | py |
MCEdit-Unified | MCEdit-Unified-master/glutils.py | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 7,742 | 28.218868 | 133 | py |
MCEdit-Unified | MCEdit-Unified-master/mce.py | # !/usr/bin/env python
import pymclevel.mclevelbase
import pymclevel.mclevel
import pymclevel.materials
import pymclevel.infiniteworld
import sys
import os
from pymclevel.box import BoundingBox, Vector
import numpy
from numpy import zeros, bincount
import logging
import itertools
import traceback
import shlex
import op... | 47,382 | 30.60974 | 124 | py |
MCEdit-Unified | MCEdit-Unified-master/frustum.py | """View frustum modeling as series of clipping planes
The Frustum object itself is only responsible for
extracting the clipping planes from an OpenGL model-view
matrix. The bulk of the frustum-culling algorithm is
implemented in the bounding volume objects found in the
OpenGLContext.scenegraph.boundingvolume module.
... | 6,077 | 34.964497 | 106 | py |
MCEdit-Unified | MCEdit-Unified-master/png.py | #!/usr/bin/env python
from __future__ import print_function
# png.py - PNG encoder/decoder in pure Python
#
# Copyright (C) 2006 Johann C. Rocholl <[email protected]>
# Portions Copyright (C) 2009 David Jones <[email protected]>
# And probably portions Copyright (C) 2006 Nicko van Someren <[email protected]>
#
# Orig... | 101,130 | 36.400518 | 100 | py |
MCEdit-Unified | MCEdit-Unified-master/resource_packs.py | # -*- coding: utf-8 -*-
#!# If the comman line parameter '--debug-packs' is given, the logging level is set to debug.
#!# Otherwise, it is set to critical.
from PIL import Image
import zipfile
import directories
import os
import shutil
from config import config
from cStringIO import StringIO
import locale
import trace... | 42,430 | 37.963269 | 180 | py |
MCEdit-Unified | MCEdit-Unified-master/pkgutil.py | """Utilities to support packages."""
# NOTE: This module must remain compatible with Python 2.3, as it is shared
# by setuptools for distribution with Python 2.3 and up.
import os
import sys
import imp
import os.path
from types import ModuleType
__all__ = [
'get_importer', 'iter_importers', 'get_loader', 'find_l... | 20,304 | 33.12605 | 79 | py |
MCEdit-Unified | MCEdit-Unified-master/depths.py | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 1,043 | 35 | 72 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/box.py | from collections import namedtuple
import itertools
import math
_Vector = namedtuple("_Vector", ("x", "y", "z"))
class Vector(_Vector):
__slots__ = ()
def __add__(self, other):
return Vector(self[0] + other[0], self[1] + other[1], self[2] + other[2])
def __sub__(self, other):
return Vec... | 7,517 | 28.252918 | 118 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/id_definitions.py | # id_definitions.py
#
# D.C.-G. (LaChal) 2016
#
# Load the data according to the game version from the versioned resources.
#
"""
The logic here is to load the JSON definitions for blocks, entities and tile entities for a given game version.
Data for each game platform is contained in subfolders of the 'mcver' one and... | 13,302 | 43.196013 | 168 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/faces.py | FaceXIncreasing = 0
FaceXDecreasing = 1
FaceYIncreasing = 2
FaceYDecreasing = 3
FaceZIncreasing = 4
FaceZDecreasing = 5
MaxDirections = 6
faceDirections = (
(FaceXIncreasing, (1, 0, 0)),
(FaceXDecreasing, (-1, 0, 0)),
(FaceYIncreasing, (0, 1, 0)),
(FaceYDecreasing, (0, -1, 0)),
(FaceZIncreasing, (0... | 366 | 20.588235 | 34 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/nbt.py | # vim:set sw=2 sts=2 ts=2:
"""
Named Binary Tag library. Serializes and deserializes TAG_* objects
to and from binary data. Load a Minecraft level by calling nbt.load().
Create your own TAG_* objects and set their values.
Save a TAG_* object to a file or StringIO object.
Read the test functions at the end of the file... | 20,429 | 27.896747 | 178 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/leveldbpocket.py | dimension = '' #overworld
# dimension = '\x01\x00\x00\x00' #nether
# dimension = '\x02\x00\x00\x00' #end
import itertools
import time
from math import floor, ceil, log
from level import FakeChunk, MCLevel
import logging
from materials import pocketMaterials
import os
from mclevelbase import ChunkNotPresent, ChunkMal... | 87,248 | 40.389469 | 204 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/setup.py | from setuptools import setup
from setuptools.extension import Extension
from Cython.Distutils import build_ext
import numpy
version = '0.1'
install_requires = [
# -*- Extra requirements: -*-
"numpy",
"pyyaml",
]
ext_modules = [Extension("_nbt", ["_nbt.pyx"])]
setup(name='pymclevel',
version=version... | 1,439 | 26.692308 | 77 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/cachefunc.py | # From http://code.activestate.com/recipes/498245/
import collections
import functools
from itertools import ifilterfalse
from heapq import nsmallest
from operator import itemgetter
class Counter(dict):
'Mapping where default values are zero'
@staticmethod
def __missing__(key):
return 0
def lru... | 5,237 | 29.631579 | 95 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/biome_types.py | biome_types = {
-1: '(Uncalculated)',
0: 'Ocean',
1: 'Plains',
2: 'Desert',
3: 'Extreme Hills',
4: 'Forest',
5: 'Taiga',
6: 'Swamppland',
7: 'River',
8: 'Hell (Nether)',
9: 'Sky (End)',
10: 'Frozen Ocean',
11: 'Frozen River',
12: 'Ice Plains',
13: 'Ice Mountai... | 1,571 | 22.462687 | 32 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/indev.py | """
Created on Jul 22, 2011
@author: Rio
Indev levels:
TAG_Compound "MinecraftLevel"
{
TAG_Compound "Environment"
{
TAG_Short "SurroundingGroundHeight"// Height of surrounding ground (in blocks)
TAG_Byte "SurroundingGroundType" // Block ID of surrounding ground
TAG_Short "SurroundingWaterHe... | 11,565 | 34.697531 | 111 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/mclevelbase.py | '''
Created on Jul 22, 2011
@author: Rio
'''
from contextlib import contextmanager
from logging import getLogger
log = getLogger(__name__)
@contextmanager
def notclosing(f):
yield f
class PlayerNotFound(Exception):
pass
class ChunkNotPresent(Exception):
pass
class RegionMalformed(Exception):
... | 980 | 17.509434 | 81 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/regionfile.py | import logging
import os
import struct
import zlib
from numpy import fromstring
import time
from mclevelbase import notclosing, RegionMalformed, ChunkNotPresent
import nbt
log = logging.getLogger(__name__)
__author__ = 'Rio'
def deflate(data):
return zlib.compress(data, 2)
def inflate(data):
return zlib.... | 12,451 | 33.977528 | 129 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/pocket.py | from level import FakeChunk
import logging
from materials import pocketMaterials
from mclevelbase import ChunkNotPresent, notclosing
from nbt import TAG_List
from numpy import array, fromstring, zeros
import os
import struct
# values are usually little-endian, unlike Minecraft PC
logger = logging.getLogger(__name__)
... | 15,372 | 34.585648 | 182 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/level.py | '''
Created on Jul 22, 2011
@author: Rio
'''
from box import BoundingBox
from collections import defaultdict
from entity import Entity, TileEntity, TileTick
import itertools
from logging import getLogger
import materials
from math import floor
from mclevelbase import ChunkMalformed, ChunkNotPresent
import nbt
from nu... | 23,962 | 31.736339 | 153 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/BOParser.py | import ConfigParser
from pymclevel import schematic, materials
from entity import TileEntity
import nbt
import logging
import re
import os
from random import randint
from directories import getDataDir, getDataFile
log = logging.getLogger(__name__)
# Load the bo3.def file (internal BO3 block names).
bo3_blocks = {}
#i... | 11,236 | 46.214286 | 202 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test_leveldb.py | # !/usr/bin/env python
#
# Copyright (C) 2012 Space Monkey, Inc.
#
# 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,... | 35,969 | 44.474083 | 94 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/items.py | from logging import getLogger
import json
import directories
import os
import shutil
import types
logger = getLogger(__name__)
class ItemType(object):
def __init__(self, id, name, maxdamage=0, damagevalue=0, stacksize=64):
self.id = id
self.name = name
self.maxdamage = maxdamage
s... | 2,951 | 30.404255 | 107 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/materials.py | from logging import getLogger
from numpy import zeros, rollaxis, indices
import traceback
from os.path import join
from collections import defaultdict
from pprint import pformat
import mclangres
import json
import os
import pkg_resources
import id_definitions
NOTEX = (496, 496)
log = getLogger(__name__)
try:
pkg... | 59,779 | 41.976276 | 133 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/mclevel.py | # -*- coding: utf-8 -*-
"""
MCLevel interfaces
Sample usage:
import mclevel
# Call mclevel.fromFile to identify and open any of these four file formats:
#
# Classic levels - gzipped serialized java objects. Returns an instance of MCJavalevel
# Indev levels - gzipped NBT data in a single file. Returns an MCIndevLev... | 11,260 | 35.800654 | 125 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/block_fill.py | import logging
import materials
log = logging.getLogger(__name__)
import numpy
from mclevelbase import exhaust
import blockrotation
from box import BoundingBox
from entity import TileEntity
def blockReplaceTable(blocksToReplace):
blocktable = numpy.zeros((materials.id_limit, 16), dtype='bool')
for b in blo... | 4,437 | 32.877863 | 134 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/run_regression_test.py | # !/usr/bin/env python
import tempfile
import sys
import subprocess
import shutil
import os
import hashlib
import contextlib
import gzip
import fnmatch
import tarfile
import zipfile
def generate_file_list(directory):
for dirpath, dirnames, filenames in os.walk(directory):
for filename in filenames:
... | 5,917 | 28.59 | 114 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/player.py | import nbt
import player_cache
class Player:
def __init__(self, playerNBTFile):
self.nbtFile = playerNBTFile
self.nbtFileName = playerNBTFile.split("\\")[-1]
self.root_tag = nbt.load(playerNBTFile)
# Properties setup
self._uuid = self.nbtFileName.split(".")[0]
pla... | 1,695 | 23.941176 | 113 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/setup_leveldb.py | #!/usr/bin/python2.7
#
# setup_leveldb.py
#
# Compiles and installs Minecraft Pocket Edtition binary support.
#
__author__ = "D.C.-G. 2017"
__version__ = "0.4.0"
import sys
import os
import platform
import fnmatch
import re
if sys.platform != "linux2":
print "This script can't run on other platforms than Linux on... | 15,212 | 36.014599 | 137 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/infiniteworld.py | '''
Created on Jul 22, 2011
@author: Rio
'''
import collections
from datetime import datetime
import itertools
from logging import getLogger
from math import floor
import os
import random
import shutil
import struct
import time
import traceback
import weakref
import zlib
import sys
from box import BoundingBox
from e... | 83,854 | 33.954148 | 153 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/javalevel.py | '''
Created on Jul 22, 2011
@author: Rio
'''
__all__ = ["MCJavaLevel"]
from cStringIO import StringIO
import gzip
from level import MCLevel
from logging import getLogger
from numpy import fromstring
import os
import re
log = getLogger(__name__)
class MCJavaLevel(MCLevel):
_gamePlatform = 'javalevel'
def... | 5,903 | 29.590674 | 153 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/block_copy.py | from datetime import datetime
import logging
log = logging.getLogger(__name__)
import numpy
from box import BoundingBox
from mclevelbase import exhaust
import materials
from entity import Entity, TileEntity
from copy import deepcopy
def convertBlocks(destLevel, sourceLevel, blocks, blockData):
return materials.... | 7,258 | 39.780899 | 194 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/minecraft_server.py | import atexit
import itertools
import logging
import os
from os.path import dirname, join, basename
import random
from pymclevel import PocketLeveldbWorld
import re
import shutil
import subprocess
import sys
import tempfile
import time
import urllib
import json
import urllib2
import infiniteworld
from directories impo... | 26,166 | 36.542324 | 199 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/__init__.py | # Versioned data relative objects
MCEDIT_DEFS = {}
MCEDIT_IDS = {} # Maps the numeric and name ids to entries in MCEDIT_DEFS
from box import BoundingBox, FloatBox
from entity import Entity, TileEntity
from faces import faceDirections, FaceXDecreasing, FaceXIncreasing, FaceYDecreasing, FaceYIncreasing, FaceZDecreasing... | 1,284 | 50.4 | 120 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/id_definitions_2.py | import os
import json
from logging import getLogger
import collections
#from pymclevel import MCEDIT_DEFS, MCEDIT_IDS
#import pymclevel
import re
#import id_definitions
log = getLogger(__name__)
def get_deps(base_version, file_name):
deps = [base_version]
print "Base: {}".format(base_version)
fp = open(os... | 1,394 | 25.826923 | 61 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/blockrotation.py | import materials
from materials import alphaMaterials
from numpy import arange, zeros
# #!# Needed for the bad hack done with 'blocktable'...
import collections
import re
class __Rotation:
def __init__(self):
for i, blocktype in enumerate(self.blocktypes):
self.blocktypes[i] = eval(blocktype)... | 27,196 | 27.038144 | 162 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/leveldb.py | # !/usr/bin/env python
#
# Copyright (C) 2012 Space Monkey, Inc.
#
# 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,... | 43,146 | 35.076087 | 137 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/entity.py | '''
Created on Jul 23, 2011
@author: Rio
'''
from math import isnan
import random
import nbt
from copy import deepcopy
__all__ = ["Entity", "TileEntity", "TileTick"]
UNKNOWN_ENTITY_MASK = 1000
class TileEntity(object):
baseStructures = {
"Furnace": (
("BurnTime", nbt.TAG_Short),
... | 28,748 | 35.026316 | 142 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/schematic.py | """
Created on Jul 22, 2011
@author: Rio
"""
import atexit
from contextlib import closing
import os
import shutil
import zipfile
from logging import getLogger
import blockrotation
from box import BoundingBox
import infiniteworld
from level import MCLevel, EntityLevel
from materials import alphaMaterials, MCMaterials,... | 43,343 | 36.92126 | 173 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/schematic_test.py | import itertools
import os
import unittest
from pymclevel import mclevel
from templevel import TempLevel, mktemp
from pymclevel.schematic import MCSchematic
from pymclevel.box import BoundingBox
__author__ = 'Rio'
class TestSchematics(unittest.TestCase):
def setUp(self):
# self.alphaLevel = TempLevel("Do... | 2,936 | 35.259259 | 104 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/nbt_test.py | from cStringIO import StringIO
import os
from os.path import join
import time
import unittest
import numpy
from pymclevel import nbt
from templevel import TempLevel
__author__ = 'Rio'
class TestNBT():
@staticmethod
def testLoad():
"Load an indev level."
level = nbt.load("testfiles/hell.mcleve... | 6,328 | 32.486772 | 114 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/entity_test.py | from pymclevel import fromFile
from templevel import TempLevel
__author__ = 'Rio'
def test_command_block():
level = TempLevel("AnvilWorld").level
cmdblock = fromFile("testfiles/Commandblock.schematic")
point = level.bounds.origin + [p / 2 for p in level.bounds.size]
level.copyBlocksFrom(cmdblock, c... | 565 | 24.727273 | 68 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/java_test.py | import unittest
import numpy
from templevel import TempLevel
from pymclevel.box import BoundingBox
__author__ = 'Rio'
class TestJavaLevel(unittest.TestCase):
def setUp(self):
self.creativelevel = TempLevel("Dojo_64_64_128.dat")
self.indevlevel = TempLevel("hell.mclevel")
def testCopy(self):
... | 701 | 29.521739 | 117 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/extended_id_test.py | from pymclevel import BoundingBox
from pymclevel.schematic import MCSchematic
from pymclevel import MCInfdevOldLevel
from templevel import TempLevel
__author__ = 'Rio'
def test_schematic_extended_ids():
s = MCSchematic(shape=(1, 1, 5))
s.Blocks[0, 0, 0] = 2048
temp = TempLevel("schematic", createFunc=s.s... | 1,205 | 23.612245 | 84 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/time_relight.py | from pymclevel.infiniteworld import MCInfdevOldLevel
from pymclevel import mclevel
from timeit import timeit
import templevel
# import logging
#logging.basicConfig(level=logging.INFO)
def natural_relight():
world = mclevel.fromFile("testfiles/AnvilWorld")
t = timeit(lambda: world.generateLights(world.allChu... | 1,163 | 29.631579 | 115 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/indev_test.py | import unittest
from templevel import TempLevel
from pymclevel.box import BoundingBox
from pymclevel.entity import Entity, TileEntity
__author__ = 'Rio'
class TestIndevLevel(unittest.TestCase):
def setUp(self):
self.srclevel = TempLevel("hell.mclevel")
self.indevlevel = TempLevel("hueg.mclevel"... | 1,287 | 32.894737 | 97 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/templevel.py | import atexit
import os
from os.path import join
import shutil
import tempfile
from pymclevel import mclevel
__author__ = 'Rio'
tempdir = os.path.join(tempfile.gettempdir(), "pymclevel_test")
if not os.path.exists(tempdir):
os.mkdir(tempdir)
def mktemp(suffix):
td = tempfile.mkdtemp(suffix, dir=tempdir)
... | 1,394 | 23.910714 | 63 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/mcr_test.py | import anvil_test
from templevel import TempLevel
__author__ = 'Rio'
class TestMCR(anvil_test.TestAnvilLevel):
def setUp(self):
self.indevLevel = TempLevel("hell.mclevel")
self.anvilLevel = TempLevel("PyTestWorld")
| 238 | 20.727273 | 51 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/pocket_test.py | import unittest
import numpy
from templevel import TempLevel
__author__ = 'Rio'
class TestPocket(unittest.TestCase):
def setUp(self):
# self.alphaLevel = TempLevel("Dojo_64_64_128.dat")
self.level = TempLevel("PocketWorld")
self.alphalevel = TempLevel("AnvilWorld")
def testPocket(sel... | 883 | 30.571429 | 95 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/time_nbt.py | from StringIO import StringIO
__author__ = 'Rio'
import pymclevel.nbt as nbt
from timeit import timeit
path = "testfiles/TileTicks.nbt"
test_data = file(path, "rb").read()
test_file = None
resaved_test_file = None
def load_file():
global test_file
test_file = nbt.load(buf=test_data)
def save_file():
... | 737 | 20.085714 | 61 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/__init__.py | __author__ = 'Rio'
| 19 | 9 | 18 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/server_test.py | import unittest
from pymclevel.minecraft_server import MCServerChunkGenerator
from templevel import TempLevel
from pymclevel.box import BoundingBox
__author__ = 'Rio'
class TestServerGen(unittest.TestCase):
def setUp(self):
# self.alphaLevel = TempLevel("Dojo_64_64_128.dat")
self.alphalevel = Tem... | 1,056 | 30.088235 | 115 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/session_lock_test.py | from pymclevel.infiniteworld import SessionLockLost, MCInfdevOldLevel
from templevel import TempLevel
import unittest
class SessionLockTest(unittest.TestCase):
def test_session_lock(self):
temp = TempLevel("AnvilWorld")
level = temp.level
def touch():
level.saveInPlace()
... | 366 | 23.466667 | 69 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/anvil_test.py | import itertools
import os
import shutil
import unittest
import numpy
from pymclevel import mclevel
from pymclevel.infiniteworld import MCInfdevOldLevel
from pymclevel import nbt
from pymclevel.schematic import MCSchematic
from pymclevel.box import BoundingBox
from pymclevel import block_copy
from templevel import mkt... | 6,338 | 33.82967 | 117 | py |
MCEdit-Unified | MCEdit-Unified-master/pymclevel/test/test_primordial.py | from templevel import TempLevel
def testPrimordialDesert():
templevel = TempLevel("PrimordialDesert")
level = templevel.level
for chunk in level.allChunks:
level.getChunk(*chunk)
| 201 | 21.444444 | 45 | py |
MCEdit-Unified | MCEdit-Unified-master/utilities/mcworld_support.py | import tempfile
import shutil
import zipfile
import atexit
import os
import glob
DO_REMOVE = True
def trim_any_leftovers():
print tempfile.gettempdir()
leftovers = glob.glob(os.path.join(tempfile.gettempdir(), 'mcworld_*', ''))
for d in leftovers:
print "Found left over directory: {}".format(d)
... | 1,674 | 29.454545 | 79 | py |
MCEdit-Unified | MCEdit-Unified-master/utilities/misc.py |
# Taken from: http://stackoverflow.com/a/7346105
class Singleton:
"""
A non-thread-safe helper class to ease implementing singletons.
This should be used as a decorator -- not a metaclass -- to the
class that should be a singleton.
The decorated class can define one `__init__` function that
ta... | 2,054 | 30.615385 | 96 | py |
MCEdit-Unified | MCEdit-Unified-master/utilities/gl_display_context.py | from OpenGL import GL, GLU
from config import config
import pygame
from pygame import display, image
import logging
import sys
import directories
import os
import mcplatform
import numpy
import pymclevel
from resource_packs import ResourcePackHandler
import glutils
import mceutils
import functools
DEBUG_WM = mcplatfor... | 7,347 | 34.497585 | 123 | py |
MCEdit-Unified | MCEdit-Unified-master/utilities/__init__.py | 0 | 0 | 0 | py | |
MCEdit-Unified | MCEdit-Unified-master/utilities/mcver_updater.py | import urllib2
import json
import os
from logging import getLogger
def run():
log = getLogger(__name__)
num = False
def download(_gamePlatform, _gameVersionNumber, url):
_download = False
dir_path = os.path.join(base, "mcver", _gamePlatform, _gameVersionNumber)
file_path = os.path.... | 2,062 | 33.966102 | 118 | py |
MCEdit-Unified | MCEdit-Unified-master/panels/control.py | from __future__ import unicode_literals
from config import config
import release
import platform
from albow import AttrRef, Row, Column
from albow.resource import get_font
from albow.controls import Label
from albow.extended_widgets import HotkeyColumn
from pygame import key
from glbackground import Panel
arch = pla... | 2,874 | 37.333333 | 120 | py |
MCEdit-Unified | MCEdit-Unified-master/panels/graphics.py | from __future__ import unicode_literals
import albow
from albow.dialogs import Dialog
from resource_packs import ResourcePackHandler
import pymclevel
from config import config
class GraphicsPanel(Dialog):
anchor = 'wh'
def __init__(self, mcedit):
Dialog.__init__(self)
self.mcedit = mcedit
... | 7,380 | 42.934524 | 169 | py |
MCEdit-Unified | MCEdit-Unified-master/panels/options.py | from __future__ import unicode_literals
import albow
from albow.dialogs import Dialog
from config import config
import pygame
from albow.translate import _, buildTemplate
import sys
import os
import logging
import traceback
import directories
old_lang = None
old_fprop = None
class OptionsPanel(Dialog):
anchor = '... | 19,479 | 46.745098 | 163 | py |
MCEdit-Unified | MCEdit-Unified-master/panels/__init__.py | from graphics import GraphicsPanel
from options import OptionsPanel
from control import ControlPanel
| 101 | 24.5 | 34 | py |
MCEdit-Unified | MCEdit-Unified-master/viewports/camera.py | # -*- coding: utf_8 -*-
# The above line is necessary, unless we want problems with encodings...
from __future__ import unicode_literals
import sys
from compass import CompassOverlay
from raycaster import TooFarException
import raycaster
import keys
import pygame
import math
import copy
import numpy
from config import... | 84,320 | 38.31049 | 251 | py |
MCEdit-Unified | MCEdit-Unified-master/viewports/chunk.py | from camera import CameraViewport
from OpenGL import GL
import mceutils
class ChunkViewport(CameraViewport):
defaultScale = 1.0 # pixels per block
def __init__(self, *a, **kw):
CameraViewport.__init__(self, *a, **kw)
def setup_projection(self):
w, h = (0.5 * s / self.defaultScale
... | 2,489 | 25.489362 | 82 | py |
MCEdit-Unified | MCEdit-Unified-master/viewports/__init__.py | from camera import CameraViewport
from chunk import ChunkViewport
| 66 | 21.333333 | 33 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/nudgebutton.py | #-# Modified by D.C.-G. for translation purpose
from albow import Label
from albow.translate import _
from config import config
from glbackground import GLBackground
import pygame
class NudgeButton(GLBackground):
""" A button that captures movement keys while pressed and sends them to a listener as nudge events.
... | 2,225 | 33.78125 | 198 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/filter.py | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 48,824 | 39.755426 | 153 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/tooloptions.py | from glbackground import Panel
class ToolOptions(Panel):
def key_down(self, evt):
if self.root.getKey(evt) == 'Escape':
self.escape_action()
def escape_action(self, *args, **kwargs):
self.dismiss()
| 238 | 18.916667 | 45 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/timeditor.py | import directories
from albow.controls import RotatableImage, Label
import pygame
from albow.widget import Widget
from albow.layout import Column, Row
from albow.fields import TimeField, IntField
class ModifiedTimeField(TimeField):
_callback = None
def __init__(self, callback=None, **kwds):
s... | 5,657 | 37.753425 | 125 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/editortool.py | from OpenGL import GL
import numpy
from depths import DepthOffset
from pymclevel import BoundingBox
from config import config
from albow.translate import _
class EditorTool(object):
surfaceBuild = False
panel = None
optionsPanel = None
toolIconName = None
worldTooltipText = None
previewRendere... | 8,857 | 25.842424 | 131 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/select.py | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 55,133 | 39.039216 | 332 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/chunk.py | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 19,830 | 36.773333 | 190 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/fill.py | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 16,035 | 36.555035 | 153 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/player.py | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 46,013 | 38.633075 | 219 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/brush.py | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 46,244 | 38.593322 | 170 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/thumbview.py | from OpenGL import GLU, GL
from numpy import array
from albow import Widget
from albow.openglwidgets import GLPerspective
from glutils import FramebufferTexture, gl
import pymclevel
from renderer import PreviewRenderer
class ThumbView(GLPerspective):
def __init__(self, sch, **kw):
GLPerspective.__init__(s... | 5,153 | 36.897059 | 158 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/clone.py | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 45,041 | 34.861465 | 203 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/__init__.py | """Copyright (c) 2010-2012 David Rio Vierra
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | 1,076 | 43.875 | 72 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/blockview.py | from OpenGL import GL
from numpy import array
from albow import ButtonBase, ValueDisplay, AttrRef, Row
from albow.openglwidgets import GLOrtho
import thumbview
import blockpicker
from glbackground import Panel, GLBackground
from glutils import DisplayList
#&# Prototype for blocks/items names
import mclangres
#&#
cla... | 6,436 | 32.010256 | 154 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/operation.py | #-# Modified by D.C.-G. for translation purpose
import atexit
import os
import shutil
import tempfile
import albow
from albow.translate import _
from pymclevel import BoundingBox
import numpy
from albow.root import Cancel
import pymclevel
from albow import showProgress
from pymclevel.mclevelbase import exhaust
undo_fo... | 5,267 | 35.839161 | 132 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/blockpicker.py | from albow import Label, TextFieldWrapped, Row, TableView, TableColumn, Column, Widget, Button, AttrRef, CheckBoxLabel
from albow.dialogs import Dialog
from editortools import thumbview
from editortools import blockview
from glbackground import GLBackground
from pymclevel import materials
from albow.root import get_roo... | 13,869 | 34.747423 | 282 | py |
MCEdit-Unified | MCEdit-Unified-master/editortools/nbtexplorer.py | # -*- coding: utf-8 -*-
#
# nbtexplorer.py
#
# D.C.-G. (LaChal) 2014
#
# Display NBT structure
#
#
# TODO:
# * add local undo/redo for loaded NBT files
# * change/optimize the undo/redo when edit level NBT data
# * add a style editor and an image wrapper for the bullets
from pygame import key, draw, image, Rect, event,... | 52,719 | 39.616333 | 212 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/file_dialogs.py | # -*- coding: utf-8 -*-
#
# Albow - File Dialogs
#
#-# Modified by D.C.-G. for translation purpose
"""
TODO:
* Implement Windows support.
"""
import os, sys
from pygame import event, image
from pygame.transform import scale
from pygame.locals import *
from albow.widget import Widget
from albow.dialogs import Dialog,... | 20,467 | 34.473137 | 146 | py |
MCEdit-Unified | MCEdit-Unified-master/albow/theme.py | #
# Albow - Themes
#
import resource
debug_theme = False
class ThemeProperty(object):
def __init__(self, name):
self.name = name
self.cache_name = intern("_" + name)
def __get__(self, obj, owner):
if debug_theme:
print "%s(%r).__get__(%r)" % (self.__class__.__name__, sel... | 6,859 | 28.44206 | 82 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.