this.windowScale = windowScale;
this.windowSize = 1 << windowScale;
this.windowMask = bitmask(windowScale);
this.window = new ManagedChunk[windowSize * windowSize];
this.cache = new ChunkCache(cacheSize);
this.relighter = new ChunkRelighter();
this.cleanup = new LinkedList<ManagedChunk>();
this.lightingEnabled = true;
shutdownHook = new CloseOpenChunks(this);
Runtime.getRuntime().addShutdownHook(shutdownHook);