private static void readTile(DataBuffer buffer, int x, int y, int plane, int shapeOffset)
	{
		GameTile tile = tile(new Position(x, y, plane));
		GameTile under = null;
		
		if (plane > 0)
		{
			under = tile(new Position(x, y, plane - 1));
		}
		
		tile.clip().set(Collision.OPEN);
		
		while (buffer.hasRemaining())
		{
			int setting = buffer.getUnsigned();
			
			if (setting == 0)
			{
				if (plane == 0)
				{
					tile.setHeight(-calculateVertexHeight(932731 + x, 556238 + y) * 8);
					//vertexHeights[0][x][y] = -Region.calculateVertexHeight(932731 + x + xOffset, 556238 + y + yOffset) * 8;
				}
				else
				{
					tile.setHeight(under.height() - 240);
					//vertexHeights[plane][x][y] = vertexHeights[plane - 1][x][y] - 240;
					break;
				}
				break;
			}
			
			if (setting == 1)
			{
				int height = buffer.getUnsigned();
				
				if (height == 1)
				{
					height = 0;
				}
				
				if (plane == 0)
				{
					tile.setHeight(-height * 8);
					//vertexHeights[0][x][y] = -height * 8;
				}
				else
				{
					tile.setHeight(under.height() - height * 8);
					//vertexHeights[plane][x][y] = vertexHeights[plane - 1][x][y] - height * 8;
					break;
				}
				break;
			}
			
			if (setting <= 49)
			{
				tile.setOverlayID(buffer.get());
				tile.setOverlayClip((setting - 2) / 4);
				tile.setOverlayRotation(setting - 2 + shapeOffset & 0x3);
			}
			else if (setting <= 81)
			{
				tile.flags().set(setting - 49);
			}
			else
			{
				tile.setUnderlayID(setting - 81);
			}
		}
		
		putTile(tile);
	}