forked from mcedit/pymclevel
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmclevelbase.py
66 lines (55 loc) · 1.36 KB
/
mclevelbase.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
'''
Created on Jul 22, 2011
@author: Rio
'''
import os
import traceback
from datetime import datetime
from StringIO import StringIO
from copy import deepcopy
import itertools
from contextlib import closing
import gzip
from numpy import array, floor, fromstring, uint8, zeros
from logging import warn, error, info, debug
import nbt
from nbt import *
from box import BoundingBox
from materials import *
import blockrotation
from entity import *
FaceXIncreasing = 0
FaceXDecreasing = 1
FaceYIncreasing = 2
FaceYDecreasing = 3
FaceZIncreasing = 4
FaceZDecreasing = 5
MaxDirections = 6
#String constants for common tag names
Entities = "Entities"
TileEntities = "TileEntities"
Map = "Map"
Width = "Width"
Height = "Height"
Length = "Length"
Blocks = "Blocks"
Data = "Data"
Inventory = 'Inventory'
#entities
def decompress_first(func):
def dec_first(self, *args, **kw):
self.decompress();
return func(self, *args, **kw);
dec_first.__doc__ = func.__doc__
return dec_first
def unpack_first(func):
def upk_first(self, *args, **kw):
self.unpackChunkData();
return func(self, *args, **kw);
upk_first.__doc__ = func.__doc__
return upk_first
class PlayerNotFound(Exception): pass
class ChunkNotPresent(Exception): pass
class RegionMalformed(Exception): pass
class ChunkMalformed(ChunkNotPresent): pass
from level import MCLevel, EntityLevel