Use new-style classes so properties work
Properties don't work on old-style classes. Convert classes to new-style by explicitly inheriting from object.
This commit is contained in:
parent
31b4fcbf13
commit
c3c44a60bf
@ -4,7 +4,7 @@ from materials import classicMaterials, materials
|
||||
from numpy import *
|
||||
NOTEX = 184
|
||||
#wow, punching this map in would have been much easier in hex
|
||||
class MCMaterials():
|
||||
class MCMaterials(object):
|
||||
def materialNamed(self, name):
|
||||
return self.names.index(name);
|
||||
|
||||
@ -423,4 +423,4 @@ def texCoords(idx):
|
||||
materials.blockTextures = array([map(texCoords, faces) for (faces, name) in materials.blockTextures], dtype='uint8')
|
||||
classicMaterials.blockTextures = array([map(texCoords, faces) for (faces, name) in classicMaterials.blockTextures], dtype='uint8')
|
||||
|
||||
alphaMaterials = materials;
|
||||
alphaMaterials = materials;
|
||||
|
@ -269,7 +269,7 @@ def decompress_first(func):
|
||||
return func(self, *args, **kw);
|
||||
return dec_first
|
||||
|
||||
class MCLevel:
|
||||
class MCLevel(object):
|
||||
""" MCLevel is an abstract class providing many routines to the different level types,
|
||||
including a common copyEntitiesFrom built on class-specific routines, and
|
||||
a dummy getChunk/getPresentChunks for the finite levels.
|
||||
@ -1188,7 +1188,7 @@ class PlayerNotFound(Exception): pass
|
||||
class ChunkNotPresent(Exception): pass
|
||||
class ChunkMalformed(ChunkNotPresent): pass
|
||||
|
||||
class ZeroChunk:
|
||||
class ZeroChunk(object):
|
||||
" a placebo for neighboring-chunk routines "
|
||||
def compress(self): pass
|
||||
def load(self): pass
|
||||
|
2
nbt.py
2
nbt.py
@ -23,7 +23,7 @@ import StringIO;
|
||||
from numpy import array, zeros, uint8, fromstring
|
||||
TAGfmt = ">b"
|
||||
|
||||
class TAG_Value:
|
||||
class TAG_Value(object):
|
||||
"""Simple values. Subclasses override fmt to change the type and size.
|
||||
Subclasses may set dataType instead of overriding setValue for automatic data type coercion"""
|
||||
|
||||
|
Reference in New Issue
Block a user