diff --git a/infiniteworld.py b/infiniteworld.py index 990b93a..d0ba271 100644 --- a/infiniteworld.py +++ b/infiniteworld.py @@ -585,11 +585,11 @@ def ZeroChunk(height=512): if z is None: z = _zeros[height] = _ZeroChunk(height) return z - -class _ZeroChunk(object): + +from level import ChunkBase + +class _ZeroChunk(ChunkBase): " a placebo for neighboring-chunk routines " - def compress(self): pass - def load(self): pass def __init__(self, height=512): zeroChunk = zeros((16, 16, height), uint8) whiteLight = zeroChunk + 15; @@ -598,7 +598,8 @@ class _ZeroChunk(object): self.SkyLight = whiteLight self.Data = zeroChunk -class InfdevChunk(EntityLevel): + +class InfdevChunk(ChunkBase): """ This is a 16x16xH chunk in an (infinite) world. The properties Blocks, Data, SkyLight, BlockLight, and Heightmap are ndarrays containing the respective blocks in the chunk file. diff --git a/java.py b/java.py index 0e3a668..32b9b73 100644 --- a/java.py +++ b/java.py @@ -5,6 +5,7 @@ Created on Jul 22, 2011 ''' __all__ = ["MCJavaLevel"] from mclevelbase import * +from level import MCLevel import re diff --git a/level.py b/level.py index 13338d0..8a85bdd 100644 --- a/level.py +++ b/level.py @@ -772,13 +772,14 @@ class EntityLevel(MCLevel): return self._fakeEntities[cx, cz] -class FakeChunk(EntityLevel): +class ChunkBase(EntityLevel): def load(self):pass def compress(self):pass - def __init__(self):pass def chunkChanged(self):pass @property def materials(self): return self.world.materials + +class FakeChunk(ChunkBase): @property def HeightMap(self): if hasattr(self, "_heightMap"): diff --git a/pocket.py b/pocket.py index d388b10..881441c 100644 --- a/pocket.py +++ b/pocket.py @@ -297,7 +297,7 @@ class PocketChunksFile(object): coords = ((i % 32, i // 32) for i in indexes) return coords -from infiniteworld import InfdevChunk, ChunkedLevelMixin +from infiniteworld import ChunkBase, ChunkedLevelMixin from level import MCLevel class PocketWorld(ChunkedLevelMixin, MCLevel): @@ -350,7 +350,7 @@ class PocketWorld(ChunkedLevelMixin, MCLevel): if cx>31 or cz>31 or cx < 0 or cz < 0: return False return self.chunkFile.getOffset(cx,cz) != 0 -class PocketChunk(InfdevChunk): +class PocketChunk(ChunkBase): Blocks = Data = SkyLight = BlockLight = None HeightMap = FakeChunk.HeightMap